Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: While opening repository /home/user/.local/share/flatpak/repo: openat(config): No such file or directory #3585

Closed
71walceli opened this issue Apr 29, 2020 · 7 comments
Labels

Comments

@71walceli
Copy link

71walceli commented Apr 29, 2020

Linux distribution and version

Linux Mint 18.3

Flatpak version

Flatpak 1.7.2

Description of the problem

Every time I want to do anything with flatpak, such as installing software, I get the following:

error: While opening repository /home/apk/.local/share/flatpak/repo: openat(config): No such file or directory

I have surfed the Web and tried reinstalling if several tomes. When I google the error message, there doesn't seem to be results addressing this issue. Quoting the message (quoting in different ways and even removing the path), Google or DuckDuckGo say that there are no results. Looking ut up without quotes brings up unrelated results, so I couldn't find anything specific to this.

Here is my local flatpak directory

apk@HP-ProBook-6470b ~ $ tree $fpdir 
/home/apk/.local/share/flatpak
├── db
└── repo
    ├── extensions
    ├── objects
    ├── refs
    │   ├── heads
    │   ├── mirrors
    │   └── remotes
    ├── state
    └── tmp
        └── cache

At this moment, I don't know what else to do.

I also have to point out is that I installed Linux Mint a few months ago.

Steps to reproduce

Almost every flatpak command fails, even flatpak list, flatpak install ..., flatpak run and so on. The only one that does work is flatpak --version Apart from that,I have no idea what causes it.

@mwleeds
Copy link
Collaborator

mwleeds commented Apr 30, 2020

Looks like your repo config was somehow deleted. If you don't care about saving the apps in your user installation you can just do rm -rf ~/.local/share/flatpak. Otherwise you can do echo -e "[core]\nrepo_version=1\nmode=bare-user-only" > ~/.local/share/flatpak/repo/config but you'll also have to re-add any remotes you had configured (e.g. flathub).

@mwleeds
Copy link
Collaborator

mwleeds commented Apr 30, 2020

flatpak --user repair can't currently handle this situation, but it's kind of impossible to recover from perfectly; there's no backup of the config file.

@mwleeds
Copy link
Collaborator

mwleeds commented Apr 30, 2020

Tagging as invalid since this is likely not Flatpak's fault.

@71walceli
Copy link
Author

I ran rm -rf /home/apk/.local/share/flatpak as I wasn't able to install any flatpak program in the first place, and added flathub repo. Now, it seems to work fine:

apk@HP-ProBook-6470b ~ $ rm -rf $fpdir 
apk@HP-ProBook-6470b ~ $ flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Note that the directories 

'/var/lib/flatpak/exports/share'
'/home/apk/.local/share/flatpak/exports/share'

are not in the search path set by the XDG_DATA_DIRS environment variable, so
applications installed by Flatpak may not appear on your desktop until the
session is restarted.

apk@HP-ProBook-6470b ~ $ flatpak list 
apk@HP-ProBook-6470b ~ $ flatpak list 
apk@HP-ProBook-6470b ~ $ flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Note that the directories 

'/var/lib/flatpak/exports/share'
'/home/apk/.local/share/flatpak/exports/share'

are not in the search path set by the XDG_DATA_DIRS environment variable, so
applications installed by Flatpak may not appear on your desktop until the
session is restarted.

apk@HP-ProBook-6470b ~ $ flatpak list
apk@HP-ProBook-6470b ~ $ flatpak --user install flathub com.leinardi.gst

Note that the directories 

'/var/lib/flatpak/exports/share'
'/home/apk/.local/share/flatpak/exports/share'

are not in the search path set by the XDG_DATA_DIRS environment variable, so
applications installed by Flatpak may not appear on your desktop until the
session is restarted.

Looking for matches…
Required runtime for com.leinardi.gst/x86_64/stable (runtime/org.gnome.Platform/x86_64/3.36) found in remote flathub
Do you want to install it? [Y/n]: 

com.leinardi.gst permissions:
    ipc      network      fallback-x11      wayland      x11      dri      file access [1]     dbus access [2]

    [1] /sys:ro
    [2] org.freedesktop.Flatpak


        ID                                              Branch            Op           Remote            Download
 1. [✓] org.freedesktop.Platform.GL.default             19.08             i            flathub            94,4 MB / 94,9 MB
 2. [✓] org.freedesktop.Platform.VAAPI.Intel            19.08             i            flathub             8,6 MB / 8,7 MB
 3. [✓] org.freedesktop.Platform.openh264               2.0               i            flathub           265,1 kB / 916,8 kB
 4. [✓] org.gnome.Platform.Locale                       3.36              i            flathub            17,7 kB / 322,9 MB
 5. [✓] org.gnome.Platform                              3.36              i            flathub           272,4 MB / 322,9 MB
 6. [✓] com.leinardi.gst                                stable            i            flathub             4,9 MB / 6,3 MB

Installation complete.
apk@HP-ProBook-6470b ~ $ flatpak list
Name                                               Application ID                                  Version            Branch           Installation
GtkStressTesting                                   com.leinardi.gst                                0.7.2              stable           user
default                                            org.freedesktop.Platform.GL.default                                19.08            user
Intel                                              org.freedesktop.Platform.VAAPI.Intel                               19.08            user
openh264                                           org.freedesktop.Platform.openh264                                  2.0              user
GNOME Application Platform version 3.36            org.gnome.Platform                                                 3.36             user
apk@HP-ProBook-6470b ~ $ flatpak run com.leinardi.gst 

Note that the directories 

'/var/lib/flatpak/exports/share'
'/home/apk/.local/share/flatpak/exports/share'

are not in the search path set by the XDG_DATA_DIRS environment variable, so
applications installed by Flatpak may not appear on your desktop until the
session is restarted.


(gst:2): Gtk-WARNING **: 20:08:18.037: Locale not supported by C library.
        Using the fallback 'C' locale.
/app/lib/python3.7/site-packages/gst/di.py:49: Warning: invalid cast from 'GtkHeaderBar' to 'GtkMenuShell'
  builder.add_from_resource(_UI_RESOURCE_PATH.format(APP_MAIN_UI_NAME))
apk@HP-ProBook-6470b ~ $ 

The warning that I should restart is the only thing that is left to do, other than that, I was able to install and run some program.

As @mwleeds said, the repo config got deleted, probably when I had to reinstall Mint, I don't really know how and when...

Thanks a lot @mwleeds for your assistance.

@mwleeds
Copy link
Collaborator

mwleeds commented Apr 30, 2020

Great, glad things are working for you now!

@mwleeds mwleeds closed this as completed Apr 30, 2020
@mwleeds
Copy link
Collaborator

mwleeds commented Apr 30, 2020

I guess flatpak repair could offer to delete the installation if it seems unrecoverable, if anyone wants to work on that improvement.

@elsiehupp
Copy link

@mwleeds commented on Apr 29, 2020:

I guess flatpak repair could offer to delete the installation if it seems unrecoverable, if anyone wants to work on that improvement.

I ran into this issue after carelessly deleting parts of my Flatpak repo directory while trying to free up space on the disk volume. I ran flatpak repair multiple times with the expectation that it would help, and, as we have observed, it did not.

Even if flatpak repair doesn't repair this sort of damage, it should provide a more meaningful error message if it doesn't. (I found my way here by searching for the error message from flatpak remotes, which is the title of this Issue.)

Personally I would prefer if flatpak repair was the sort of blanket panacea that would take care of things like this, though, especially considering this one has a relatively easy fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants