After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 764049 - Better error message for connection refused
Better error message for connection refused
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: sftp backend
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2016-03-22 21:56 UTC by Bastien Nocera
Modified: 2016-10-04 11:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sftp: Fix error code if ssh is not properly configured (1.21 KB, patch)
2016-03-23 08:22 UTC, Ondrej Holy
committed Details | Review

Description Bastien Nocera 2016-03-22 21:56:23 UTC
nautilus when connecting to a computer on which I forgot to enable SSH, I get:
Don't have permission to access the requested location

The error from ssh is a better one:
ssh: connect to host classic.local port 22: Connection refused
which tells me I forgot to enable the service, rather than thinking it forgot to ask me about a password.
Comment 1 Ondrej Holy 2016-03-23 08:21:09 UTC
Sftp backend fails with "Connection refused by server", this is feature of Nautilus. However the backend returns G_IO_ERROR_PERMISSION_DENIED, but it should use G_IO_ERROR_CONNECTION_REFUSED instead. Consequently Nautilus will show "Unhandled error message: Connection refused by server"...

So, let's fix the error code in this bug report. Maybe another bug report should be filed for Nautilus, because it would be good to include the original error message in their error messages probably...
Comment 2 Ondrej Holy 2016-03-23 08:22:11 UTC
Created attachment 324571 [details] [review]
sftp: Fix error code if ssh is not properly configured

G_IO_ERROR_PERMISSION_DENIED is returned if ssh is not properly configured. Nautilus shows "Don't have permission to access the requested location" in such case rather than "Connection refused by server", which is confusing. G_IO_ERROR_CONNECTION_REFUSED should be returned instead.
Comment 3 Ondrej Holy 2016-10-04 11:04:44 UTC
Attachment 324571 [details] pushed as 88f9166 - sftp: Fix error code if ssh is not properly configured