GermanBread / declarative-flatpak

126 stars 4 forks source link

Do not update if there is nothing to update #17

Closed LDprg closed 1 year ago

LDprg commented 1 year ago

First of all thx for the creation of this package, great work!

However I did notice some Issues with using it:

I did collect all this issue in this one, because they kind of relate to each other. Feel free to clarify if I just did something wrong.

GermanBread commented 1 year ago

Hi! Thanks for using my module!


Every time I update my config (anything does not need to have to do with flatpaks) my apps get reinstalled, which cause a big use of internet bandwidth (which is quite a problem for me and my bad internet), even though nothing needs to be changed

I am working on this. Look at the dev branch.

Every time apps installs the module moves the link for flatpaks to another location which doesn't exist until the update is finished. In the mean time I am not able to use any flatpak related app (one of my biggest issue with this module).

This shouldn't happen. The symlinks are swapped at the last step. I will double-check this.

For me personally there is no need to store old flatpak repos between generations, so it would be nice to disable this feature and only uninstall/install Apps/Runtimes/Repos according to the config.

I wouldn't store old generations either, but as it turns out, flatpak apps like to crash when their files are suddenly deleted. I cannot detect which files are still in use, so this is my best attempt at fixing the issue.

GermanBread commented 1 year ago

screenshot

LDprg commented 1 year ago

@GermanBread thx for the fast reply

This shouldn't happen. The symlinks are swapped at the last step. I will double-check this.

Maybe the old directory gets deleted? I only use the homemanager module, didn't check if this also occurs with the nixos module.

I wouldn't store old generations either, but as it turns out, flatpak apps like to crash when their files are suddenly deleted. I cannot detect which files are still in use, so this is my best attempt at fixing the issue.

Oh, ok that makes sense.

GermanBread commented 1 year ago

Maybe the old directory gets deleted? I only use the homemanager module, didn't check if this also occurs with the nixos module.

Well, the same script is running for both hm and nixos. Are you using an impermanence setup?

LDprg commented 1 year ago

Maybe the old directory gets deleted? I only use the homemanager module, didn't check if this also occurs with the nixos module.

Well, the same script is running for both hm and nixos. Are you using an impermanence setup?

Nope no impermanence from my side.

Here the service log after a nixos-rebuild switch --flake:

Okt 16 18:28:18 LD-Laptop systemd[2208]: Started manage-user-flatpaks.service.
Okt 16 18:28:18 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[168483]: Cleaning old directories
Okt 16 18:28:23 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[168483]: Running with boot ID 76f55e60592649fdba867b4944a658a0
Okt 16 18:28:23 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[168483]: An installation will be created at "/home/ld/.local/state/flatpak-module/bo>
Okt 16 18:28:23 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[168483]: Adding remote flathub with URL https://flathub.org/repo/flathub.flatpakrepo
Okt 16 18:28:23 LD-Laptop flatpak[168556]: user: Added remote flathub to https://dl.flathub.org/repo/
Okt 16 18:28:24 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[168645]: grep: warning: stray \ before /
Okt 16 18:28:24 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[168645]: grep: warning: stray \ before /
Okt 16 18:28:24 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[168645]: grep: warning: stray \ before /
Okt 16 18:28:24 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[168648]: Installing runtime/org.freedesktop.Platform.GL.default/x86_64/22.08
Okt 16 18:29:28 LD-Laptop systemd[2208]: Stopping manage-user-flatpaks.service...
Okt 16 18:29:28 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[168648]: [6B blob data]
Okt 16 18:29:28 LD-Laptop systemd[2208]: Stopped manage-user-flatpaks.service.
Okt 16 18:29:40 LD-Laptop systemd[2208]: Started manage-user-flatpaks.service.
Okt 16 18:29:40 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[168964]: Cleaning old directories
Okt 16 18:29:40 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[168964]: Running with boot ID 76f55e60592649fdba867b4944a658a0
Okt 16 18:29:40 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[168964]: An installation will be created at "/home/ld/.local/state/flatpak-module/bo>
Okt 16 18:29:40 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[168964]: Adding remote flathub with URL https://flathub.org/repo/flathub.flatpakrepo
Okt 16 18:29:41 LD-Laptop flatpak[169004]: user: Added remote flathub to https://dl.flathub.org/repo/
Okt 16 18:29:43 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[169054]: grep: warning: stray \ before /
Okt 16 18:29:43 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[169054]: grep: warning: stray \ before /
Okt 16 18:29:43 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[169054]: grep: warning: stray \ before /
Okt 16 18:29:43 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[169057]: Installing runtime/org.freedesktop.Platform.GL.default/x86_64/22.08
Okt 16 18:31:48 LD-Laptop flatpak[169057]: libostree pull from 'flathub' for runtime/org.freedesktop.Platform.GL.default/x86_64/22.08 complete
                                           security: GPG: summary+commit 
                                           security: SIGN: disabled http: TLS
                                           delta: parts: 1 loose: 38
                                           transfer: secs: 124 size: 142,8 MB
Okt 16 18:31:48 LD-Laptop flatpak[169057]: user: Pulled runtime/org.freedesktop.Platform.GL.default/x86_64/22.08 from flathub
Okt 16 18:31:48 LD-Laptop flatpak[169057]: user: Installed runtime/org.freedesktop.Platform.GL.default/x86_64/22.08 from flathub
Okt 16 18:31:48 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[169057]: Installing runtime/org.freedesktop.Platform.GL.default/x86_64/22.08-extra
Okt 16 18:32:02 LD-Laptop flatpak[169057]: libostree pull from 'flathub' for runtime/org.freedesktop.Platform.GL.default/x86_64/22.08-extra complete
                                           security: GPG: summary+commit 
                                           security: SIGN: disabled http: TLS
                                           delta: parts: 1 loose: 21
                                           transfer: secs: 14 size: 16,3 MB
Okt 16 18:32:02 LD-Laptop flatpak[169057]: user: Pulled runtime/org.freedesktop.Platform.GL.default/x86_64/22.08-extra from flathub
Okt 16 18:32:02 LD-Laptop flatpak[169057]: user: Installed runtime/org.freedesktop.Platform.GL.default/x86_64/22.08-extra from flathub
Okt 16 18:32:02 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[169057]: Installing runtime/org.freedesktop.Platform.GL.nvidia-535-113-01/x86_64/1.4
Okt 16 18:32:03 LD-Laptop flatpak[169057]: libostree pull from 'flathub' for runtime/org.freedesktop.Platform.GL.nvidia-535-113-01/x86_64/1.4 complete
                                           security: GPG: summary+commit 
                                           security: SIGN: disabled http: TLS
                                           delta: parts: 1 loose: 15
                                           transfer: secs: 1 size: 846,7 kB
Okt 16 18:37:14 LD-Laptop flatpak[169057]: user: Pulled runtime/org.freedesktop.Platform.GL.nvidia-535-113-01/x86_64/1.4 from flathub
Okt 16 18:42:24 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[170836]: grep: warning: stray \ before /
Okt 16 18:42:24 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[170836]: grep: warning: stray \ before /
Okt 16 18:42:24 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[170836]: grep: warning: stray \ before /
Okt 16 18:42:24 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[170839]: Installing runtime/org.freedesktop.Platform.Locale/x86_64/22.08
Okt 16 18:42:25 LD-Laptop flatpak[170839]: libostree pull from 'flathub' for runtime/org.freedesktop.Platform.Locale/x86_64/22.08 complete
                                           security: GPG: summary+commit 
                                           security: SIGN: disabled http: TLS
                                           non-delta: meta: 8 content: 1
                                           transfer: secs: 0 size: 22,0 kB
Okt 16 18:42:25 LD-Laptop flatpak[170839]: user: Pulled runtime/org.freedesktop.Platform.Locale/x86_64/22.08 from flathub
Okt 16 18:42:25 LD-Laptop flatpak[170839]: user: Installed runtime/org.freedesktop.Platform.Locale/x86_64/22.08 from flathub
Okt 16 18:42:25 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[170839]: Installing runtime/org.freedesktop.Platform/x86_64/22.08
Okt 16 18:43:42 LD-Laptop flatpak[170839]: libostree pull from 'flathub' for runtime/org.freedesktop.Platform/x86_64/22.08 complete
                                           security: GPG: summary+commit 
                                           security: SIGN: disabled http: TLS
                                           delta: parts: 9 loose: 61
                                           transfer: secs: 77 size: 87,9 MB
Okt 16 18:43:42 LD-Laptop flatpak[170839]: user: Pulled runtime/org.freedesktop.Platform/x86_64/22.08 from flathub
Okt 16 18:43:43 LD-Laptop flatpak[170839]: user: Installed runtime/org.freedesktop.Platform/x86_64/22.08 from flathub
Okt 16 18:43:43 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[170839]: Installing app/com.spotify.Client/x86_64/stable
Okt 16 18:43:47 LD-Laptop flatpak[170839]: libostree pull from 'flathub' for app/com.spotify.Client/x86_64/stable complete
                                           security: GPG: summary+commit 
                                           security: SIGN: disabled http: TLS
                                           delta: parts: 1 loose: 46
                                           transfer: secs: 3 size: 3,8 MB
Okt 16 18:46:35 LD-Laptop flatpak[170839]: user: Pulled app/com.spotify.Client/x86_64/stable from flathub
Okt 16 18:46:36 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[171529]: grep: warning: stray \ before /
Okt 16 18:46:36 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[171529]: grep: warning: stray \ before /
Okt 16 18:46:36 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[171529]: grep: warning: stray \ before /
Okt 16 18:46:36 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[171532]: Installing runtime/org.freedesktop.Platform.GL.default/x86_64/23.08
Okt 16 18:49:07 LD-Laptop flatpak[171532]: libostree pull from 'flathub' for runtime/org.freedesktop.Platform.GL.default/x86_64/23.08 complete
                                           security: GPG: summary+commit 
                                           security: SIGN: disabled http: TLS
                                           delta: parts: 1 loose: 40
                                           transfer: secs: 151 size: 163,3 MB
Okt 16 18:49:07 LD-Laptop flatpak[171532]: user: Pulled runtime/org.freedesktop.Platform.GL.default/x86_64/23.08 from flathub
Okt 16 18:49:07 LD-Laptop flatpak[171532]: user: Installed runtime/org.freedesktop.Platform.GL.default/x86_64/23.08 from flathub
Okt 16 18:49:07 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[171532]: Installing runtime/org.freedesktop.Platform.GL.default/x86_64/23.08-extra
Okt 16 18:49:24 LD-Laptop flatpak[171532]: libostree pull from 'flathub' for runtime/org.freedesktop.Platform.GL.default/x86_64/23.08-extra complete
                                           security: GPG: summary+commit 
                                           security: SIGN: disabled http: TLS
                                           delta: parts: 1 loose: 21
                                           transfer: secs: 16 size: 17,8 MB
Okt 16 18:49:24 LD-Laptop flatpak[171532]: user: Pulled runtime/org.freedesktop.Platform.GL.default/x86_64/23.08-extra from flathub
Okt 16 18:49:24 LD-Laptop flatpak[171532]: user: Installed runtime/org.freedesktop.Platform.GL.default/x86_64/23.08-extra from flathub
Okt 16 18:49:24 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[171532]: Installing runtime/org.freedesktop.Sdk.Locale/x86_64/23.08
Okt 16 18:49:27 LD-Laptop flatpak[171532]: libostree pull from 'flathub' for runtime/org.freedesktop.Sdk.Locale/x86_64/23.08 complete
                                           security: GPG: summary+commit 
                                           security: SIGN: disabled http: TLS
                                           non-delta: meta: 31 content: 53
                                           transfer: secs: 2 size: 2,0 MB
Okt 16 18:49:27 LD-Laptop flatpak[171532]: user: Pulled runtime/org.freedesktop.Sdk.Locale/x86_64/23.08 from flathub
Okt 16 18:49:27 LD-Laptop flatpak[171532]: user: Installed runtime/org.freedesktop.Sdk.Locale/x86_64/23.08 from flathub
Okt 16 18:49:27 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[171532]: Installing runtime/org.freedesktop.Sdk/x86_64/23.08
Okt 16 18:56:59 LD-Laptop flatpak[171532]: libostree pull from 'flathub' for runtime/org.freedesktop.Sdk/x86_64/23.08 complete
                                           security: GPG: summary+commit 
                                           security: SIGN: disabled http: TLS
                                           delta: parts: 19 loose: 157
                                           transfer: secs: 452 size: 466,3 MB
Okt 16 18:57:00 LD-Laptop flatpak[171532]: user: Pulled runtime/org.freedesktop.Sdk/x86_64/23.08 from flathub
Okt 16 18:57:01 LD-Laptop flatpak[171532]: user: Installed runtime/org.freedesktop.Sdk/x86_64/23.08 from flathub
Okt 16 18:57:01 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[171532]: Installing app/com.axosoft.GitKraken/x86_64/stable
Okt 16 18:57:10 LD-Laptop flatpak[171532]: libostree pull from 'flathub' for app/com.axosoft.GitKraken/x86_64/stable complete
                                           security: GPG: summary+commit 
                                           security: SIGN: disabled http: TLS
                                           delta: parts: 1 loose: 92
                                           transfer: secs: 9 size: 8,3 MB
Okt 16 18:59:52 LD-Laptop flatpak[171532]: user: Pulled app/com.axosoft.GitKraken/x86_64/stable from flathub
Okt 16 18:59:54 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[174198]: grep: warning: stray \ before /
Okt 16 18:59:54 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[174198]: grep: warning: stray \ before /
Okt 16 18:59:54 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[174198]: grep: warning: stray \ before /
Okt 16 18:59:54 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[174201]: Info: org.freedesktop.Platform is end-of-life, with reason: org.freedesktop>
Okt 16 18:59:54 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[174201]: Info: org.freedesktop.Platform.ffmpeg-full is end-of-life, with reason: org>
Okt 16 18:59:54 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[174201]: Info: org.freedesktop.Platform.Locale is end-of-life, with reason: org.free>
Okt 16 18:59:54 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[174201]: Info: org.freedesktop.Platform.GL.default is end-of-life, with reason: org.>
Okt 16 18:59:54 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[174201]: Installing runtime/org.freedesktop.Platform.GL.default/x86_64/21.08
Okt 16 19:02:49 LD-Laptop flatpak[174201]: libostree pull from 'flathub' for runtime/org.freedesktop.Platform.GL.default/x86_64/21.08 complete
                                           security: GPG: summary+commit 
                                           security: SIGN: disabled http: TLS
                                           delta: parts: 1 loose: 36
                                           transfer: secs: 174 size: 129,6 MB
Okt 16 19:02:49 LD-Laptop flatpak[174201]: user: Pulled runtime/org.freedesktop.Platform.GL.default/x86_64/21.08 from flathub
Okt 16 19:02:49 LD-Laptop flatpak[174201]: user: Installed runtime/org.freedesktop.Platform.GL.default/x86_64/21.08 from flathub
Okt 16 19:02:49 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[174201]: Installing runtime/org.freedesktop.Platform.Locale/x86_64/21.08
Okt 16 19:02:51 LD-Laptop flatpak[174201]: libostree pull from 'flathub' for runtime/org.freedesktop.Platform.Locale/x86_64/21.08 complete
                                           security: GPG: summary+commit 
                                           security: SIGN: disabled http: TLS
                                           non-delta: meta: 28 content: 30
                                           transfer: secs: 1 size: 1,5 MB
Okt 16 19:02:51 LD-Laptop flatpak[174201]: user: Pulled runtime/org.freedesktop.Platform.Locale/x86_64/21.08 from flathub
Okt 16 19:02:51 LD-Laptop flatpak[174201]: user: Installed runtime/org.freedesktop.Platform.Locale/x86_64/21.08 from flathub
Okt 16 19:02:51 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[174201]: Installing runtime/org.freedesktop.Platform.ffmpeg-full/x86_64/21.08
Okt 16 19:02:55 LD-Laptop flatpak[174201]: libostree pull from 'flathub' for runtime/org.freedesktop.Platform.ffmpeg-full/x86_64/21.08 complete
                                           security: GPG: summary+commit 
                                           security: SIGN: disabled http: TLS
                                           delta: parts: 1 loose: 71
                                           transfer: secs: 4 size: 4,7 MB
Okt 16 19:02:55 LD-Laptop flatpak[174201]: user: Pulled runtime/org.freedesktop.Platform.ffmpeg-full/x86_64/21.08 from flathub
Okt 16 19:02:55 LD-Laptop flatpak[174201]: user: Installed runtime/org.freedesktop.Platform.ffmpeg-full/x86_64/21.08 from flathub
Okt 16 19:02:55 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[174201]: Installing runtime/org.freedesktop.Platform.openh264/x86_64/2.0
Okt 16 19:02:56 LD-Laptop flatpak[174201]: libostree pull from 'flathub' for runtime/org.freedesktop.Platform.openh264/x86_64/2.0 complete
                                           security: GPG: summary+commit 
                                           security: SIGN: disabled http: TLS
                                           delta: parts: 1 loose: 6
                                           transfer: secs: 0 size: 595,1 kB
Okt 16 19:02:57 LD-Laptop flatpak[174201]: user: Pulled runtime/org.freedesktop.Platform.openh264/x86_64/2.0 from flathub
Okt 16 19:02:57 LD-Laptop flatpak[174201]: user: Installed runtime/org.freedesktop.Platform.openh264/x86_64/2.0 from flathub
Okt 16 19:02:57 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[174201]: Installing runtime/org.freedesktop.Platform/x86_64/21.08
Okt 16 19:06:47 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[168964]: Installing out-of-tree refs
Okt 16 19:06:47 LD-Laptop wp243szwa4dgg23g5000vs44illhik46-setup-flatpaks[168964]: Installing files
Okt 16 19:06:47 LD-Laptop systemd[2208]: manage-user-flatpaks.service: Main process exited, code=exited, status=127/n/a
Okt 16 19:06:47 LD-Laptop systemd[2208]: manage-user-flatpaks.service: Failed with result 'exit-code'.
GermanBread commented 1 year ago

@LDprg Hi, I pushed an update to my module (dev branch) which adds an option called enable-debug. Can you enable it in your config and show me the output of that?

Rebuild your system, reboot and run journalctl --user -b0 -u manage-user-flatpaks >flatpaks.log after the module finished executing.

LDprg commented 1 year ago

I will do this in the next days.

LDprg commented 1 year ago

I just changed my system to the dev branch and the problem disappeared. Even if I switched back to stable. Seems like my flake.lock fixed the module on a broken commit.

I will close this, since all problems solved! Thx for your support.

GermanBread commented 1 year ago

I'm glad that your problem got resolved by pure magic.

Cheers