xdg-open on Kubuntu 20.04 reports 'Could not connect to localhost: Connection refused' if localhost service not already up

Bug #1889477 reported by Number7

This bug report will be marked for expiration in 11 days if no further activity occurs. (find out why)

10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kde-cli-tools (Ubuntu)
Incomplete
Low
Unassigned

Bug Description

 1) The release of Ubuntu you are using, via 'lsb_release -rd' or System -> About Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
(Kubuntu 20.04 Fresh Install)

 2) The version of the package you are using, via 'apt-cache policy pkgname' or by checking in Software Center
xdg-utils:
  Installed: 1.1.3-2ubuntu1
  Candidate: 1.1.3-2ubuntu1

 3) What you expected to happen
xdg-open "http://localhost:1313" to open the default browser at http://localhost:1313

 4) What happened instead
A gui dialog titled 'Error -- KIO Client' pops up with the message 'Could not connect to host localhost: Connection refused.'

 5) More Info
I use xdg-open "http://localhost:someport" in my bash scripts before it actually starts the service as a time saver. On older Ubuntu and other distros it would open the default browser (Firefox) with a page not found. I press reload once the service is setup and Firefox loads the page.

On Kubuntu 20.04 xdg-open gets blocked if the port is not already opened.

Example command:

xdg-open "http://localhost:1313"

This did work on Kubuntu and Ubuntu 18.04 and Ubuntu 19.10. Currently works on Manjaro KDE with latest stable update. Worked on Fedora 31 KDE (can not remember if I tested 32).

Current Manjaro package reported as: xdg-utils 1.1.3+19+g9816ebb-1

Ubuntu 20.04 not tested.

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: xdg-utils 1.1.3-2ubuntu1
ProcVersionSignature: Ubuntu 5.4.0-42.46-generic 5.4.44
Uname: Linux 5.4.0-42-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.4
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: KDE
Date: Wed Jul 29 13:53:07 2020
InstallationDate: Installed on 2020-05-28 (62 days ago)
InstallationMedia: Kubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
PackageArchitecture: all
SourcePackage: xdg-utils
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Number7 (jbwyatt4) wrote :
Changed in xdg-utils (Ubuntu):
importance: Undecided → Low
Revision history for this message
Alex A. D. (hinell) wrote :

I'm using the same versions. Opening http:... links works fine for me.

Revision history for this message
Number7 (jbwyatt4) wrote :

Hi Alex,

My scripts run xdg-open http://localhost:something before starting the service as a time saver to setup my workspace.

Did you already have the service running when you started it up?

It works fine when the service is already up, but it throws this new error when it is not. In the past it would just open a new tab in the browser and move on. In Kubuntu 20.04 I have to click the button in the dialog for it to exit.

Since it does not happen in Manjaro with either KDE 18 or 19.2 in my experience I assuming it is a Kubuntu/Ubuntu issue.

Revision history for this message
Nicholas Guriev (mymedia) wrote :

xdg-utils use KDE native tools to open URLs. In your case, kde-open5 is invoked which hangs on networking request and than fails. More clear example:

 $ kde-open5 http://192.0.2.42:8080/

affects: xdg-utils (Ubuntu) → kde-cli-tools (Ubuntu)
Revision history for this message
Scarlett Gately Moore (scarlettmoore) wrote :

I cannot reproduce this on 24.04, please update this bug if it is still an issue on a supported release.

Changed in kde-cli-tools (Ubuntu):
status: New → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.