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 573942 - GIO based GtkFileChooserDialogs error: "Password dialog cancelled"
GIO based GtkFileChooserDialogs error: "Password dialog cancelled"
Status: RESOLVED DUPLICATE of bug 553133
Product: glib
Classification: Platform
Component: gio
2.16.x
Other Linux
: Normal major
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2009-03-03 17:11 UTC by Philippe Chaintreuil
Modified: 2009-03-06 17:29 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Simple demo app that uses a GtkFileChooserDialog to illustrate the problem. (1.47 KB, application/x-bzip)
2009-03-03 17:14 UTC, Philippe Chaintreuil
Details

Description Philippe Chaintreuil 2009-03-03 17:11:20 UTC
Anytime I try to use GIO to access remote systems I get an error dialog and the GtkFileChooser does not get populated.

The error dialog reads:

-------------------------------------------------
The folder contents could not be displayed

Password dialog cancelled
                                    [ OK ]
-------------------------------------------------

If I use a "gnome-vfs" backend, the problem does not exist.
Comment 1 Philippe Chaintreuil 2009-03-03 17:14:21 UTC
Created attachment 129953 [details]
Simple demo app that uses a GtkFileChooserDialog to illustrate the problem.

Here's a demo app with rudimentary makefile that has a text entry for a remote URI, defaulted to "sftp://localhost/$(CWD)/".  That will be used for a GtkFileChooserDialog.  The backend can be selected with radio buttons on the main app window.

GIO gives me the above error 100% of the time, GnomeVFS works fine.
Comment 2 Alexander Larsson 2009-03-04 11:29:54 UTC
It works for me with svn trunk...
Comment 3 Philippe Chaintreuil 2009-03-04 13:09:20 UTC
I've confirmed this on a FC8 and on Ubuntu 8.04 in addition to my Gentoo machine.

Any ideas why this is coming up?  Any ideas for a work around?  Any ideas how I detect a good GIO install from a bad one in this respect?

It's a little disconcerting because GIO is actually the default backend for me.


Or, am I doing something incorrect/stupid in my test case attached?
Comment 4 Alexander Larsson 2009-03-06 09:46:56 UTC
I don't see anything wrong with the testcase, but nor does it fail for me here.

So, i don't have any idea what is going wrong here. The error generally means the user got a password dialog and he pressed cancel on the dialog or closed it.
Comment 5 Philippe Chaintreuil 2009-03-06 13:27:29 UTC
Any idea where that text is coming from?  I found the first line ("...could not be displayed") in gtkfilechooserdefault.c's error_changing_folder_dialog() function, but I can't find the 2nd line ("Password dialog cancelled") in the tar's for either glib-2.16.6, nor gtk+-2.12.11.
Comment 6 Philippe Chaintreuil 2009-03-06 16:00:15 UTC
Okay, I've been digging for the last several hours.  I found the "Password dialog cancelled" line via Google's code search in gvfsbackendsftp.c's handle_login() function right after a call to g_mount_source_ask_password().

Digging deeper I think the punting is coming from g_mount_source_ask_password_async()'s check near the top:

---------------------------------------------------------
if (source->dbus_id[0] == 0)
     { 
      g_simple_async_report_error_in_idle (G_OBJECT (source),
                            callback,
                            user_data,
                            G_IO_ERROR, G_IO_ERROR_FAILED, 
                            "Internal Error"); 
       return;
     }
---------------------------------------------------------

Using dbus-monitor, when I run my test app I get:
---------------------------------------------------------
method call sender=:1.5 -> dest=:1.43 path=/org/gtk/vfs/mountable; interface=org.gtk.vfs.Mountable; member=mount
   struct {
      array [
         byte 47
  [...]
         byte 103
      ]
      array [
         struct {
            string "host"
            array [
               byte 108
               byte 111
               byte 99
               byte 97
               byte 108
               byte 104
               byte 111
               byte 115
               byte 116
            ]
         }
         struct {
            string "type"
            array [
               byte 115
               byte 102
               byte 116
               byte 112
            ]
         }
      ]
   }
   boolean false
   string ""
   object path "/"
error sender=:1.43 -> dest=:1.5 error_name=org.glib.GError.g_2Dio_2Derror_2Dquark.c14 reply_serial=93
   string "Password dialog cancelled"
error sender=:1.5 -> dest=:1.28 error_name=org.glib.GError.g_2Dio_2Derror_2Dquark.c14 reply_serial=46
   string "Password dialog cancelled"
---------------------------------------------------------

But If I watch when I run gvfs-mount sftp://localhost/home/ I get:
---------------------------------------------------------
method call sender=:1.60 -> dest=:1.69 path=/org/gtk/vfs/mountable; interface=org.gtk.vfs.Mountable; member=mount
   struct {
      array [
         byte 47
         byte 104
  [...]
         byte 112
      ]
      array [
         struct {
            string "host"
            array [
               byte 108
               byte 111
               byte 99
               byte 97
               byte 108
               byte 104
               byte 111
               byte 115
               byte 116
            ]
         }
         struct {
            string "type"
            array [
               byte 115
               byte 102
               byte 116
               byte 112
            ]
         }
         struct {
            string "user"
            array [
               byte 112
               byte 101
               byte 101
               byte 112
            ]
         }
      ]
   }
   boolean false
   string ":1.68"
   object path "/org/gtk/gvfs/mountop/0"
method call sender=:1.69 -> dest=:1.68 path=/org/gtk/gvfs/mountop/0; interface=org.gtk.vfs.MountOperation; member=askPassword
   string "Enter password"
   string "peep"
   string ""
   uint32 9
---------------------------------------------------------

The important difference between the two being what I assume is the dbus_id as the first one is "", and the 2nd one is a more valid ":1.68".

Who's supposed to be setting this dbus_id when it's sent?
Comment 7 Philippe Chaintreuil 2009-03-06 17:29:27 UTC
Looks like I'm a duplicate of #553133.


2008-09-26 Matthias Clasen fixed it in gtkfilechooserdefault.c by using GtkMountOperation, which is what is in charge of displaying the dialog.  That file doesn't even exist in gtk+-2.12.11.

The fix didn't make it into the distribution until 2.14.4.

I'll just set the default GtkSetting's "gtk-file-chooser-backend" to "gnome-vfs" (since I'm making a GnomeApp) on versions older than that.

*** This bug has been marked as a duplicate of 553133 ***