`nix-flatpak` Issue; Possibly Flathub Repo Disabled?

I use nix-flatpak to manage my flatpaks, basically a handful of packages that don’t work natively for me, on all my and my family’s PCs and it works well. However, I ran into an issue on my laptop recently that keeps appearing.

I think it has something to do with the repo being disabled (see very bottom). So I attempted to remove and re-add the flathub repo, but I removed all flatpaks when doing so. I figured a rebuild would prompt me to reinstall the flatpaks. It did not and I still get the following error. Your help is appreciated!

building the system configuration...
activating the configuration...
setting up /etc...
reloading user units for zonsopkomst...
restarting sysinit-reactivation.target
warning: the following units failed: flatpak-managed-install.service

× flatpak-managed-install.service
     Loaded: loaded (/etc/systemd/system/flatpak-managed-install.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Sat 2024-07-20 11:52:22 CDT; 47ms ago
    Process: 44228 ExecStart=/nix/store/845640x0x0pnb55h2caj46dpsjjh3vry-flatpak-managed-install (code=exited, status=1/FAILURE)
   Main PID: 44228 (code=exited, status=1/FAILURE)
         IP: 8.6K in, 1.4K out
        CPU: 83ms

Jul 20 11:52:22 weda systemd[1]: Starting flatpak-managed-install.service...
Jul 20 11:52:22 weda 845640x0x0pnb55h2caj46dpsjjh3vry-flatpak-managed-install[44328]: error: No installed refs found for ‘com.github.cassidyjames.clairvoyant’
Jul 20 11:52:22 weda systemd[1]: flatpak-managed-install.service: Main process exited, code=exited, status=1/FAILURE
Jul 20 11:52:22 weda systemd[1]: flatpak-managed-install.service: Failed with result 'exit-code'.
Jul 20 11:52:22 weda systemd[1]: Failed to start flatpak-managed-install.service.
Jul 20 11:52:22 weda systemd[1]: flatpak-managed-install.service: Consumed 83ms CPU time, received 8.6K IP traffic, sent 1.4K IP traffic.
warning: error(s) occurred while switching to the new configuration

zonsopkomst  …/flake   working   ♥ 11:52  flatpak remotes
Name    Options
flathub system

zonsopkomst  …/flake   working   ♥ 11:53  flatpak remotes --show-disabled 
Name    Options
flathub system

Hi @gmodena. I am hoping you can provide some advice on how to fix this error or if I should open an issue on your github? It worked perfectly before this error- much thanks for what you do!

In addition, I scoured my system for any reference to the com.github.cassidyjames.clairvoyant reference, but could not find any config files pointing to this. I cleaned my system with Warehouse and Flatsweep as well.

Thanks,
zons

Hey @Zonsopkomst,

Unfortunately, I was not able to reproduce. The following worked for me:

  1. Installing the package manually: flatpak install flathub com.github.cassidyjames.clairvoyant
  2. installing com.github.cassidyjames.clairvoyant with nix-flatpack (main) in a testing vm.
Jul 20 11:52:22 weda 845640x0x0pnb55h2caj46dpsjjh3vry-flatpak-managed-install[44328]: error: No installed refs found for ‘com.github.cassidyjames.clairvoyant’

Are you having this issue only with com.github.cassidyjames.clairvoyant, or also other flatpaks?

So I attempted to remove and re-add the flathub repo, but I removed all flatpaks when doing so.

Weird. What version of nix-flatpak are you using? Could you post your config?

Could you also share the output of:

flatpak remotes -d

Thank you for looking into. Here are answers to your questions. Please let me know if you require any additional details.

I attempted this and clairvoyant installed sucessfully. I then uninstalled it so that I have no flatpaks installed and rebuilt my system using my flake. It appears to have the same issue:

zonsopkomst@weda

zonsopkomst  ~  ♥ 12:28  cd && cd flake && nix flake update && sudo nixos-rebuild switch --flake .# && flatpak update && flatpak uninstall --unused 
 
warning: updating lock file '/home/zonsopkomst/flake/flake.lock':
• Updated input 'home-manager':
    'github:nix-community/home-manager/afd2021bedff2de92dfce0e257a3d03ae65c603d' (2024-07-16)
  → 'github:nix-community/home-manager/bc2b96acda50229bc99925dde5c8e561e90b0b00' (2024-07-26)
• Updated input 'hyprland':
    'github:hyprwm/Hyprland/f642fb97df5c69267a03452533de383ff8023570' (2024-07-20)
  → 'github:hyprwm/Hyprland/33a5c8ce325e1657ec5571b57e05c6378706f4cd' (2024-07-25)
• Added input 'hyprland/aquamarine':
    'github:hyprwm/aquamarine/353dc1b7299d43f08de44276b93ae32726ff9d70' (2024-07-24)
• Added input 'hyprland/aquamarine/hyprutils':
    follows 'hyprland/hyprutils'
• Added input 'hyprland/aquamarine/hyprwayland-scanner':
    follows 'hyprland/hyprwayland-scanner'
• Added input 'hyprland/aquamarine/nixpkgs':
    follows 'hyprland/nixpkgs'
• Added input 'hyprland/aquamarine/systems':
    follows 'hyprland/systems'
• Updated input 'hyprland/hyprcursor':
    'github:hyprwm/hyprcursor/a5c0d57325c5f0814c39110a70ca19c070ae9486' (2024-07-04)
  → 'github:hyprwm/hyprcursor/4493a972b48f9c3014befbbf381ed5fff91a65dc' (2024-07-18)
• Updated input 'hyprland/hyprlang':
    'github:hyprwm/hyprlang/5df0174fd09de4ac5475233d65ffc703e89b82eb' (2024-07-07)
  → 'github:hyprwm/hyprlang/adbefbf49664a6c2c8bf36b6487fd31e3eb68086' (2024-07-18)
• Updated input 'hyprland/hyprutils':
    'github:hyprwm/hyprutils/eb1ceff2b87f6820789249f63faa8e9dcb54d05f' (2024-07-15)
  → 'github:hyprwm/hyprutils/962582a090bc233c4de9d9897f46794280288989' (2024-07-18)
• Updated input 'hyprland/hyprwayland-scanner':
    'github:hyprwm/hyprwayland-scanner/d5fa094ca27e0039be5e94c0a80ae433145af8bb' (2024-07-05)
  → 'github:hyprwm/hyprwayland-scanner/a048a6cb015340bd82f97c1f40a4b595ca85cc30' (2024-07-18)
• Updated input 'hyprland/nixpkgs':
    'github:NixOS/nixpkgs/693bc46d169f5af9c992095736e82c3488bf7dbb' (2024-07-14)
  → 'github:NixOS/nixpkgs/1d9c2c9b3e71b9ee663d11c5d298727dace8d374' (2024-07-19)
• Updated input 'hyprland/xdph':
    'github:hyprwm/xdg-desktop-portal-hyprland/b9b97e5ba23fe7bd5fa4df54696102e8aa863cf6' (2024-07-05)
  → 'github:hyprwm/xdg-desktop-portal-hyprland/663be9cad424b170b28b9fa8a61042d721007f3b' (2024-07-22)
• Updated input 'nix-flatpak':
    'github:gmodena/nix-flatpak/45bf66f7068db79b552da864c0e87452be624d6c' (2024-04-01)
  → 'github:gmodena/nix-flatpak/dbce39ea8664820ba9037caaf1e2fad365ed6b4b' (2024-07-21)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/1d9c2c9b3e71b9ee663d11c5d298727dace8d374' (2024-07-19)
  → 'github:nixos/nixpkgs/5ad6a14c6bf098e98800b091668718c336effc95' (2024-07-25)
• Updated input 'stylix':
    'github:danth/stylix/6f36b27afd7b7ac8664bb62b7b27728540972c82' (2024-07-20)
  → 'github:danth/stylix/b9de20c76e8d5c13cf2304d23cf589803c311670' (2024-07-26)
warning: Git tree '/home/zonsopkomst/flake' is dirty
[sudo] password for zonsopkomst: 
warning: Git tree '/home/zonsopkomst/flake' is dirty
building the system configuration...
warning: Git tree '/home/zonsopkomst/flake' is dirty
[1/103/114 built, 322 copied (5875.8/5877.0 MiB), 1383.9 MiB DL] building qgis-unwrapped-3.38.1 (buildPhase): Skipping: zh-Hant <p> QGIS是根据GNU通用公共许可证许可的,用户友好的开源地理信息系统(GIS)。 QGIS是开源stopping the following units: accounts-daemon.service, colord.service, cups.service, cups.socket, lxd.service, lxd.socket, power-profiles-daemon.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, systemd-udevd.service, upower.service
NOT restarting the following changed units: display-manager.service
activating the configuration...
setting up /etc...
reloading user units for zonsopkomst...
restarting sysinit-reactivation.target
reloading the following units: dbus.service
restarting the following units: home-manager-zonsopkomst.service, polkit.service, usr-share-icons.mount
starting the following units: accounts-daemon.service, colord.service, cups.socket, lxd.socket, power-profiles-daemon.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, upower.service
the following new units were started: sysinit-reactivation.target, systemd-tmpfiles-resetup.service
warning: the following units failed: flatpak-managed-install.service

× flatpak-managed-install.service
     Loaded: loaded (/etc/systemd/system/flatpak-managed-install.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Fri 2024-07-26 14:46:42 CDT; 2s ago
    Process: 177372 ExecStart=/nix/store/845640x0x0pnb55h2caj46dpsjjh3vry-flatpak-managed-install (code=exited, status=1/FAILURE)
   Main PID: 177372 (code=exited, status=1/FAILURE)
         IP: 8.7K in, 1.5K out
        CPU: 87ms

Jul 26 14:46:41 weda systemd[1]: Starting flatpak-managed-install.service...
Jul 26 14:46:42 weda 845640x0x0pnb55h2caj46dpsjjh3vry-flatpak-managed-install[177535]: error: No installed refs found for ‘com.github.cassidyjames.clairvoyant’
Jul 26 14:46:42 weda systemd[1]: flatpak-managed-install.service: Main process exited, code=exited, status=1/FAILURE
Jul 26 14:46:42 weda systemd[1]: flatpak-managed-install.service: Failed with result 'exit-code'.
Jul 26 14:46:42 weda systemd[1]: Failed to start flatpak-managed-install.service.
Jul 26 14:46:42 weda systemd[1]: flatpak-managed-install.service: Consumed 87ms CPU time, received 8.6K IP traffic, sent 1.5K IP traffic.
warning: error(s) occurred while switching to the new configuration

zonsopkomst  …/flake   working !  ♥ 14:46  flatpak update 
Looking for updates…

Nothing to do.

zonsopkomst  …/flake   working !  ♥ 18:33  flatpak uninstall --unused 

These runtimes in installation 'system' are pinned and won't be removed; see flatpak-pin(1):
  runtime/org.gtk.Gtk3theme.adw-gtk3-dark/x86_64/3.22


        ID                                            Branch                Op
 1. [-] org.freedesktop.Platform.GL.default           23.08                 r
 2. [-] org.freedesktop.Platform.GL.default           23.08-extra           r
 3. [-] org.gnome.Platform                            46                    r
 4. [-] org.gnome.Platform.Locale                     46                    r
 5. [-] org.freedesktop.Platform.openh264             2.4.1                 r

Uninstall complete.

zonsopkomst  …/flake   working !  ♥ 18:33  

I also rebuilt a family member’s PC and it had a similar message, minus the clairvoyant portion. On this PC, it seems that flatpaks are being installed using nix-flatpak still.

coleman@tii

coleman  ~  ♥ 14:30  flkup 
warning: updating lock file '/home/coleman/flake/flake.lock':
• Updated input 'home-manager':
    'github:nix-community/home-manager/afd2021bedff2de92dfce0e257a3d03ae65c603d' (2024-07-16)
  → 'github:nix-community/home-manager/bc2b96acda50229bc99925dde5c8e561e90b0b00' (2024-07-26)
• Updated input 'hyprland':
    'github:hyprwm/Hyprland/f642fb97df5c69267a03452533de383ff8023570' (2024-07-20)
  → 'github:hyprwm/Hyprland/57371b93a058d17affb0ca92f13b8d40582b3ea0' (2024-07-26)
• Added input 'hyprland/aquamarine':
    'github:hyprwm/aquamarine/353dc1b7299d43f08de44276b93ae32726ff9d70' (2024-07-24)
• Added input 'hyprland/aquamarine/hyprutils':
    follows 'hyprland/hyprutils'
• Added input 'hyprland/aquamarine/hyprwayland-scanner':
    follows 'hyprland/hyprwayland-scanner'
• Added input 'hyprland/aquamarine/nixpkgs':
    follows 'hyprland/nixpkgs'
• Added input 'hyprland/aquamarine/systems':
    follows 'hyprland/systems'
• Updated input 'hyprland/hyprcursor':
    'github:hyprwm/hyprcursor/a5c0d57325c5f0814c39110a70ca19c070ae9486' (2024-07-04)
  → 'github:hyprwm/hyprcursor/4493a972b48f9c3014befbbf381ed5fff91a65dc' (2024-07-18)
• Updated input 'hyprland/hyprlang':
    'github:hyprwm/hyprlang/5df0174fd09de4ac5475233d65ffc703e89b82eb' (2024-07-07)
  → 'github:hyprwm/hyprlang/adbefbf49664a6c2c8bf36b6487fd31e3eb68086' (2024-07-18)
• Updated input 'hyprland/hyprutils':
    'github:hyprwm/hyprutils/eb1ceff2b87f6820789249f63faa8e9dcb54d05f' (2024-07-15)
  → 'github:hyprwm/hyprutils/962582a090bc233c4de9d9897f46794280288989' (2024-07-18)
• Updated input 'hyprland/hyprwayland-scanner':
    'github:hyprwm/hyprwayland-scanner/d5fa094ca27e0039be5e94c0a80ae433145af8bb' (2024-07-05)
  → 'github:hyprwm/hyprwayland-scanner/a048a6cb015340bd82f97c1f40a4b595ca85cc30' (2024-07-18)
• Updated input 'hyprland/nixpkgs':
    'github:NixOS/nixpkgs/693bc46d169f5af9c992095736e82c3488bf7dbb' (2024-07-14)
  → 'github:NixOS/nixpkgs/1d9c2c9b3e71b9ee663d11c5d298727dace8d374' (2024-07-19)
• Updated input 'hyprland/xdph':
    'github:hyprwm/xdg-desktop-portal-hyprland/b9b97e5ba23fe7bd5fa4df54696102e8aa863cf6' (2024-07-05)
  → 'github:hyprwm/xdg-desktop-portal-hyprland/663be9cad424b170b28b9fa8a61042d721007f3b' (2024-07-22)
• Updated input 'nix-flatpak':
    'github:gmodena/nix-flatpak/45bf66f7068db79b552da864c0e87452be624d6c' (2024-04-01)
  → 'github:gmodena/nix-flatpak/dbce39ea8664820ba9037caaf1e2fad365ed6b4b' (2024-07-21)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/1d9c2c9b3e71b9ee663d11c5d298727dace8d374' (2024-07-19)
  → 'github:nixos/nixpkgs/5ad6a14c6bf098e98800b091668718c336effc95' (2024-07-25)
• Updated input 'stylix':
    'github:danth/stylix/6f36b27afd7b7ac8664bb62b7b27728540972c82' (2024-07-20)
  → 'github:danth/stylix/b9de20c76e8d5c13cf2304d23cf589803c311670' (2024-07-26)
warning: Git tree '/home/coleman/flake' is dirty
warning: Git tree '/home/coleman/flake' is dirty
building the system configuration...
warning: Git tree '/home/coleman/flake' is dirty
stopping the following units: accounts-daemon.service, colord.service, cpufreq.service, cups.service, cups.socket, power-profiles-daemon.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, systemd-udevd.service, upower.service, wpa_supplicant.service
NOT restarting the following changed units: display-manager.service
activating the configuration...
setting up /etc...
error: Can't load uri https://dl.flathub.org/repo/flathub.flatpakrepo: While fetching https://dl.flathub.org/repo/flathub.flatpakrepo: [6] Couldn't resolve host name

Activation script snippet 'flathub' failed (1)
reloading user units for coleman...
restarting sysinit-reactivation.target
reloading the following units: dbus.service
restarting the following units: home-manager-coleman.service, nix-daemon.service, polkit.service, usr-share-icons.mount
starting the following units: accounts-daemon.service, colord.service, cpufreq.service, cups.socket, power-profiles-daemon.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, upower.service, wpa_supplicant.service
the following new units were started: NetworkManager-dispatcher.service, sysinit-reactivation.target, systemd-tmpfiles-resetup.service
warning: the following units failed: flatpak-managed-install.service

× flatpak-managed-install.service
     Loaded: loaded (/etc/systemd/system/flatpak-managed-install.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Fri 2024-07-26 14:41:52 CDT; 306ms ago
    Process: 170650 ExecStart=/nix/store/6jvwjjncmy44sqmdv8lnxmk50nddav0z-flatpak-managed-install (code=exited, status=1/FAILURE)
   Main PID: 170650 (code=exited, status=1/FAILURE)
         IP: 0B in, 0B out
        CPU: 32ms

Jul 26 14:41:52 tii systemd[1]: Starting flatpak-managed-install.service...
Jul 26 14:41:52 tii 6jvwjjncmy44sqmdv8lnxmk50nddav0z-flatpak-managed-install[170657]: error: Can't load uri https://dl.flathub.org/repo/flathub.flatpakrepo: While fetching https://dl.flathub.org/repo/flathub.flatpakrepo: [6] Couldn't resolve host name
Jul 26 14:41:52 tii systemd[1]: flatpak-managed-install.service: Main process exited, code=exited, status=1/FAILURE
Jul 26 14:41:52 tii systemd[1]: flatpak-managed-install.service: Failed with result 'exit-code'.
Jul 26 14:41:52 tii systemd[1]: Failed to start flatpak-managed-install.service.
warning: error(s) occurred while switching to the new configuration

coleman  …/flake   working !  ♥ 14:41  

All flatpaks on zonsopkomst@weda. I don’t even want clairvoyant installed. It was just a gag package I installed because it acts like a magic 8 ball. :slight_smile: But now I have no flatpaks being declared on my main laptop (zonsopkomst@weda or the first pasted terminal dump).

I think I am using the latest version as I am on unstable and using the following input. Please let me know if you need me to run a command for more info on that. My flake is located here and it manages all my systems.

zonsopkomst  ~  ♥ 18:57  flatpak remotes -d
Name    Title   URL                          Collection ID Subset Filter Priority Options … … Homepage             Icon
flathub Flathub https://dl.flathub.org/repo/ -             -      -      1        system  … … https://flathub.org/ https://dl.flathub.org/repo/logo.svg

leeuwarden@tyr

Edit: Just ran on leeuwarden@tyr and it worked perfectly. Still not sure why there is an error on the other two systems.


leeuwarden  ~  ♥ 20:42  flkup
[sudo] password for leeuwarden: 
building the system configuration...
stopping the following units: accounts-daemon.service, colord.service, power-profiles-daemon.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, systemd-udevd.service, upower.service
NOT restarting the following changed units: display-manager.service
activating the configuration...
setting up /etc...
reloading user units for leeuwarden...
restarting sysinit-reactivation.target
reloading the following units: dbus.service
restarting the following units: home-manager-leeuwarden.service, polkit.service, usr-share-icons.mount
starting the following units: accounts-daemon.service, colord.service, power-profiles-daemon.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, upower.service
the following new units were started: sysinit-reactivation.target, systemd-localed.service, systemd-tmpfiles-resetup.service
Looking for updates…

New com.heroicgameslauncher.hgl permissions:
    file access [1]

    [1] ~/.var/app/org.openwinecomponents.umu.umu-launcher/data/umu


        ID                                    Branch           Op          Remote           Download
 1. [✓] org.gnome.Platform.Locale             46               u           flathub          17.9 kB / 380.0 MB
 2. [✓] org.gnome.Platform                    46               u           flathub           4.0 MB / 347.5 MB
 3. [✓] org.localsend.localsend_app           stable           u           flathub           1.8 MB / 14.7 MB
 4. [✓] com.heroicgameslauncher.hgl           stable           u           flathub          10.9 MB / 199.5 MB

Updates complete.

^ this should not be necessary, flathub is added by default by nix-flatpak.

FYI: you can add / alter remotes by setting services.flatpkas.remotes.

Are you installing nix-flatpak as a nixos module on all the configs (working and not working), or do you (also) use home-manager ?

I wonder if you stumbled upon a bug whereby the flathub remote is not configured properly on activation (that unfortunately I could not replicate).

Should I remove this from my flake? Or use your FYI link instead? Is there a way I can “reset” and start from scratch with nix-package, like clearing out any configuration data that may be held in the background?

I think so, for example tyr should have it installed as a module, and all other PCs the same way. I declare the flatpak packages in the user’s file, but this should be PC specific, not user specific, for example: leeuwarden. Hopefully I am not mistaken.

I just updated this machine and nix-flatpak appears to continue to work, but I received the following error:

building the system configuration...
stopping the following units: NetworkManager-wait-online.service, NetworkManager.service, accounts-daemon.service, colord.service, docker.service, docker.socket, network-local-commands.service, network-setup.service, power-profiles-daemon.service, resolvconf.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, systemd-udevd.service, udisks2.service, upower.service
NOT restarting the following changed units: display-manager.service
activating the configuration...
setting up /etc...
error: Can't load uri https://dl.flathub.org/repo/flathub.flatpakrepo: While fetching https://dl.flathub.org/repo/flathub.flatpakrepo: [6] Couldn't resolve host name

Activation script snippet 'flathub' failed (1)
reloading user units for leeuwarden...
restarting sysinit-reactivation.target
reloading the following units: dbus.service
restarting the following units: home-manager-leeuwarden.service, nix-daemon.service, polkit.service, usr-share-icons.mount
starting the following units: NetworkManager.service, accounts-daemon.service, colord.service, docker.socket, network-local-commands.service, power-profiles-daemon.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, udisks2.service, upower.service
the following new units were started: NetworkManager-dispatcher.service, sysinit-reactivation.target, systemd-hostnamed.service, systemd-localed.service, systemd-networkd.service, systemd-networkd.socket, systemd-resolved.service, systemd-tmpfiles-resetup.service
warning: error(s) occurred while switching to the new configuration

I am also wondering if it is necessary when I update my systems to do the following command? I added the sleep portion to see if it would give a little time to reach flathub. Thought it might be worth a shot… but I realize I am reaching for solutions at this point.
cd flake && nix flake update && sudo nixos-rebuild switch --flake .# && sleep 10 && flatpak update && flatpak uninstall --unused

I also had installed some flatpak packages before I started using nix-flatpak and don’t recall if I removed them before installing nix-flatpak, but they did work up until recently…

Trying to cover all the bases for troubleshooting. Please let me know if I can provide any relevant information.

Thank you for your help!