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 785729 - Fails to install .flatpakrepo file with " (1)" in its name
Fails to install .flatpakrepo file with " (1)" in its name
Status: RESOLVED OBSOLETE
Product: gnome-software
Classification: Applications
Component: Flatpak
3.24.x
Other Linux
: Normal normal
: ---
Assigned To: Richard Hughes
Richard Hughes
Depends on:
Blocks:
 
 
Reported: 2017-08-02 12:32 UTC by Will Thompson
Modified: 2018-01-24 17:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gnome-software --verbose output for this bug (2.30 MB, text/x-log)
2017-08-02 12:32 UTC, Will Thompson
Details

Description Will Thompson 2017-08-02 12:32:23 UTC
Created attachment 356775 [details]
gnome-software --verbose output for this bug

I visited https://flathub.org/ and downloaded the flatpakrepo file. Apparently I have downloaded this file once before, so the browser named the new copy "flathub (1).flatpakrepo". Opening the file in GNOME Software presented me with a well-formed page with an Install button, but clicking Install silently did nothing.

In the --verbose log I see the following (among other lines) when I open the file:

12:24:02:0536 Gs  autogenerating unique-id for flathub (1)


And when I click Install, I see the following:

12:24:16:0830 Gs  adding system/*/*/source/flathub (1)/* as nothing matched hash
12:24:16:0831 As  run 0x55892d878850~GsPlugin::shell-extensions(gs_plugin_app_install)
12:24:16:0831 As  run 0x55892d878850~GsPlugin::packagekit(gs_plugin_app_install)
12:24:16:0831 As  run 0x55892d878850~GsPlugin::fwupd(gs_plugin_app_install)
12:24:16:0831 As  run 0x55892d878850~GsPlugin::flatpak(gs_plugin_app_install)
12:24:16:0831 GsPluginFlatpak chose GsFlatpak-system-default using scope
12:24:16:0831 As  run 0x55892d878850~GsFlatpak-system-default::refine{flathub (1)}
12:24:16:0831 As  run 0x55892d878850~GsFlatpak-system-default::refine-appstream{flathub (1)}
12:24:16:0831 As  run 0x55892d878850~GsFlatpak-system-default::refine-metadata{flathub (1)}
12:24:16:0832 flatpak Calling system helper: ConfigureRemote
12:24:19:0689 Gs  recovering state on flathub (1) from installing to available
12:24:19:0693 Gs  failed to install flathub (1): cannot modify remote: GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code0: Invalid remote name flathub (1)

It appears the remote name is derived from the filename, without regard for whether it is a valid Flatpak remote name. If I rename the file to 
flathub
Comment 1 Will Thompson 2017-08-02 12:33:35 UTC
Ha. My comment was truncated at the astral plane character I entered…

If I rename the file to flathub<U+1F4A9 PILE OF POO>.flatpakrepo, I see the same error but with "flathub<U+1F4A9 PILE OF POO>".
Comment 2 Richard Hughes 2017-08-03 11:05:26 UTC
system-helper/flatpak-system-helper.c seems to be checking for the '/' char, so I assume we somehow escape PILE OF POO to a forward slash somewhere. I'll add a failing self test now and then we can work out how to fix this.
Comment 3 Richard Hughes 2017-08-03 11:45:32 UTC
commit 4b65ab55f6beac2f20a954e60bae76f78a0663f3 (HEAD -> master)
Author: Richard Hughes <richard@hughsie.com>
Date:   Thu Aug 3 12:39:37 2017 +0100

    flatpak: Ensure remote names are valid ASCII and without spaces
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=785729, although I think we also
    need to de-duplicate based on the URI contained in the remote file.
Comment 4 GNOME Infrastructure Team 2018-01-24 17:42:03 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-software/issues/207.