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

[Bug]: flatpak update takes 6 minutes to exit when it has nothing to do #5716

Open
4 tasks done
matt32106 opened this issue Mar 7, 2024 · 10 comments
Open
4 tasks done
Labels

Comments

@matt32106
Copy link

Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.
  • If this is an issue with a particular app, I have tried filing it in the appropriate issue tracker for the app (e.g. under https://github.com/flathub/) and determined that it is an issue with Flatpak itself.
  • This issue is not a report of a security vulnerability (see here if you need to report a security issue).

Flatpak version

1.12.7

What Linux distribution are you using?

Ubuntu

Linux distribution version

22.04

What architecture are you using?

x86_64

How to reproduce

2024-03-07 19:07hippo@hippo-camp2:~$ time flatpak update
Looking for updates…
Nothing to do.

real	6m2,990s
user	0m0,144s
sys	0m0,030s
2024-03-07 19:13hippo@hippo-camp2:~$ time flatpak update
Looking for updates…
Nothing to do.

real	6m2,956s
user	0m0,131s
sys	0m0,058s
2024-03-07 19:25hippo@hippo-camp2:~$ 

Expected Behavior

Exit just after writiing "Nothing to do."

Actual Behavior

Takes more than 6 min to do so.

Additional Information

No response

@chrisawi
Copy link
Collaborator

chrisawi commented Mar 7, 2024

Please share the output with -vv:

flatpak update -vv &> flatpak.log

@matt32106
Copy link
Author

here you are:

F: No installations directory in /etc/flatpak/installations.d. Skipping
F: Opening system flatpak installation at path /var/lib/flatpak
F: Opening user flatpak installation at path /home/hippo/.local/share/flatpak
Looking for updates…
F: Fetching summary index file for remote ‘flathub’
F: Loading https://dl.flathub.org/repo/summary.idx using libsoup
F: Received 10001 bytes
F: Loaded indexed summary file 43438e791ec2e9f5331c04518a07a7e0a818fde2682c0ad48aebc2d190e8f3f4 from cache for remote ‘flathub’
F: Transaction: update flathub:app/com.calibre_ebook.calibre/x86_64/stable[*]
F: Transaction: update flathub:app/io.freetubeapp.FreeTube/x86_64/stable[*]
F: Transaction: update flathub:runtime/org.freedesktop.Platform.GL.default/x86_64/23.08[*]
F: Transaction: update flathub:runtime/org.freedesktop.Platform.GL.default/x86_64/23.08-extra[*]
F: Transaction: update flathub:runtime/org.freedesktop.Platform.GL.nvidia-535-161-07/x86_64/1.4[*]
F: Transaction: update flathub:runtime/org.freedesktop.Platform.Locale/x86_64/23.08[/en, /fr]
F: Transaction: update flathub:runtime/org.freedesktop.Platform.openh264/x86_64/2.2.0[*]
F: Transaction: update flathub:runtime/org.freedesktop.Platform/x86_64/23.08[*]
F: Transaction: update flathub:runtime/org.gtk.Gtk3theme.Yaru-dark/x86_64/3.22[*]
F: Transaction: update flathub:runtime/org.gtk.Gtk3theme.Yaru/x86_64/3.22[*]
F: Looking for remote metadata updates for flathub
F: marking op update:runtime/org.gtk.Gtk3theme.Yaru/x86_64/3.22 resolved to 4b1e043544efb4a6d0278a3a2deaede9f6ff61034589bdb380054121aa098952
F: marking op update:runtime/org.gtk.Gtk3theme.Yaru-dark/x86_64/3.22 resolved to d4b294293b4367fa158814d79eaf4fa2fb482f1cbf4c3e490acf5f42eb11b59f
F: marking op update:runtime/org.freedesktop.Platform/x86_64/23.08 resolved to 315f529f41050948b4e202d16193d539b6b7f499e7b435725be3987ea113e29c
F: marking op update:runtime/org.freedesktop.Platform.openh264/x86_64/2.2.0 resolved to bf24f23f3ba385f6e8c9215ed94d979db99814b0b614504a23a6d0751dc5f063
F: marking op update:runtime/org.freedesktop.Platform.Locale/x86_64/23.08 resolved to ddbe7b0c793a718ca16c27ef6fde04f8cd43f637e98f1faf82dcfbd5cdd865a7
F: marking op update:runtime/org.freedesktop.Platform.GL.nvidia-535-161-07/x86_64/1.4 resolved to 1754d056c6a8a3b1798a71e127fa6dac13e6bb4bb18275a9978088fd1ee39b4c
F: marking op update:runtime/org.freedesktop.Platform.GL.default/x86_64/23.08-extra resolved to bec59c350d6e8126c99da5c8c5979d8493878147e7831f78113f66c237154397
F: marking op update:runtime/org.freedesktop.Platform.GL.default/x86_64/23.08 resolved to 4b66ef1c8cde895ff24105cb34bdabb2896471318bbcb601399d4b8d60a5ae3d
F: marking op update:app/io.freetubeapp.FreeTube/x86_64/stable resolved to 7869a90dd4ae09be42c15e77e3bae5e689a021ee8029a37dbf2882a0f22df684
F: marking op update:app/com.calibre_ebook.calibre/x86_64/stable resolved to 810bbc60f573c90b67e7cd353fba056762b4bf91ca1d041d1efdf39eae674a7c
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.GL.default/x86_64/23.08[*]
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.GL.default/x86_64/23.08-extra[*]
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.GL.nvidia-535-161-07/x86_64/1.4[*]
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.Locale/x86_64/23.08[/en, /fr]
F: Transaction: install/update flathub:runtime/org.gtk.Gtk3theme.Yaru-dark/x86_64/3.22[*]
F: Transaction: install/update flathub:runtime/org.gtk.Gtk3theme.Yaru/x86_64/3.22[*]
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.openh264/x86_64/2.2.0[*]
Nothing to do.
F: flathub:x86_64 appstream age 15953 is less than ttl 86400
F: flathub:x86_64 appstream age 67798740 is greater than ttl 86400
F: Updating appstream data for user remote flathub
F: Fetching summary index file for remote ‘flathub’
F: Loading https://dl.flathub.org/repo/summary.idx using libsoup
F: Received 10001 bytes
F: Loading https://dl.flathub.org/repo/summaries/7ba4a074df07f93409501735aab2b47f2d0aaa7953c2405eb6c1b701ee003314.idx.sig using libsoup
F: Received 592 bytes
F: Fetching indexed summary delta d7a6e9a2638f06951888ed2e6ec161cea952713be4275ecaae381c3ce938d257-43438e791ec2e9f5331c04518a07a7e0a818fde2682c0ad48aebc2d190e8f3f4.delta for remote ‘flathub’
F: Loading https://dl.flathub.org/repo/summaries/d7a6e9a2638f06951888ed2e6ec161cea952713be4275ecaae381c3ce938d257-43438e791ec2e9f5331c04518a07a7e0a818fde2682c0ad48aebc2d190e8f3f4.delta using libsoup
F: Received 31276 bytes
F: flatpak_dir_pull: Using commit c0b66c143c01609e0a1e9da4ad4fe538316225001331fba3f1778bafeffc40b6 for pull of ref appstream2/x86_64 from remote flathub
F: Error updating: Opening content object 65de53b5263fba526878d527da8bb61bb293aae02c8ec539f2811b59ef881b86: fgetxattr(user.ostreemeta): No data available
F: gnome:x86_64 appstream age 18446744073709551615 is greater than ttl 86400
F: Updating appstream data for user remote gnome
F: Fetching summary index file for remote ‘gnome’
F: Loading http:https://sdk.gnome.org/repo/summary.idx using libsoup
F: Should retry request (remaining: 5 retries), due to transient error: Error resolving “sdk.gnome.org”: Name or service not known
F: Loading http:https://sdk.gnome.org/repo/summary.idx using libsoup
F: Should retry request (remaining: 4 retries), due to transient error: Error resolving “sdk.gnome.org”: Name or service not known
F: Loading http:https://sdk.gnome.org/repo/summary.idx using libsoup
F: Should retry request (remaining: 3 retries), due to transient error: Error resolving “sdk.gnome.org”: Name or service not known
F: Loading http:https://sdk.gnome.org/repo/summary.idx using libsoup
F: Should retry request (remaining: 2 retries), due to transient error: Error resolving “sdk.gnome.org”: Name or service not known
F: Loading http:https://sdk.gnome.org/repo/summary.idx using libsoup
F: Should retry request (remaining: 1 retries), due to transient error: Error resolving “sdk.gnome.org”: Name or service not known
F: Loading http:https://sdk.gnome.org/repo/summary.idx using libsoup
F: Failed to download optional summary index: Error resolving “sdk.gnome.org”: Name or service not known
F: Error updating: Error updating appstream2: No such ref 'appstream2/x86_64' in remote gnome; Error updating appstream: No such ref 'appstream/x86_64' in remote gnome
F: pitivi:x86_64 appstream age 18446744073709551615 is greater than ttl 86400
F: Updating appstream data for user remote pitivi
F: Fetching summary index file for remote ‘pitivi’
F: Loading http:https://flatpak.pitivi.org/summary.idx using libsoup
F: Should retry request (remaining: 5 retries), due to transient error: Could not connect: Socket I/O timed out
F: Loading http:https://flatpak.pitivi.org/summary.idx using libsoup
F: Should retry request (remaining: 4 retries), due to transient error: Could not connect: Socket I/O timed out
F: Loading http:https://flatpak.pitivi.org/summary.idx using libsoup
F: Should retry request (remaining: 3 retries), due to transient error: Could not connect: Socket I/O timed out
F: Loading http:https://flatpak.pitivi.org/summary.idx using libsoup
F: Should retry request (remaining: 2 retries), due to transient error: Could not connect: Socket I/O timed out
F: Loading http:https://flatpak.pitivi.org/summary.idx using libsoup
F: Should retry request (remaining: 1 retries), due to transient error: Could not connect: Socket I/O timed out
F: Loading http:https://flatpak.pitivi.org/summary.idx using libsoup
F: Failed to download optional summary index: Could not connect: Socket I/O timed out
F: Error updating: Error updating appstream2: No such ref 'appstream2/x86_64' in remote pitivi; Error updating appstream: No such ref 'appstream/x86_64' in remote pitivi

@chrisawi
Copy link
Collaborator

chrisawi commented Mar 8, 2024

You have the defunct gnome remote added. You can just delete it: flatpak remote-delete gnome.

I expect the long delay is the pitivi remote. I don't know if it's still active and temporarily offline or if it's abandoned. It's still referenced on their website.

Flatpak 1.15.6 behaves the same way. Maybe a shorter timeout than 30s would be appropriate. Flatpak probably should be more verbose here by default.

@matt32106
Copy link
Author

I get an error trying to remove the remote:

2024-03-08 01:11hippo@hippo-camp2:~$ flatpak remote-delete gnome
error: Listing refs: opendir(refs/heads): No such file or directory

@chrisawi
Copy link
Collaborator

chrisawi commented Mar 8, 2024

It looks like one of your flatpak installations is corrupted. You can try sudo flatpak repair and flatpak repair --user. If that doesn't help, please feel free to make a post on the Flathub Discourse.

@hfiguiere
Copy link
Collaborator

The action here would be to:

  1. probably not retry, and just skip
  2. to make the timeout error visible without -v

Also does flatpak remote-delete --force gnome work?

@hfiguiere hfiguiere added bug and removed needs triage labels Mar 8, 2024
@matt32106
Copy link
Author

--force gives the same error:

2024-03-08 09:31hippo@hippo-camp2:~$ flatpak remote-delete --force gnome
error: Listing refs: opendir(refs/heads): No such file or directory
2024-03-08 09:32hippo@hippo-camp2:~$ 

@matt32106
Copy link
Author

and the repairs fail too:

2024-03-08 09:35hippo@hippo-camp2:~$ flatpak repair --user -vv
F: Opening user flatpak installation at path /home/hippo/.local/share/flatpak
Working on the user installation at /home/hippo/.local/share/flatpak
error: Listing refs: opendir(refs/heads): No such file or directory
2024-03-08 09:35hippo@hippo-camp2:~$ sudo flatpak repair -vv
[sudo] password for hippo: 
F: Opening system flatpak installation at path /var/lib/flatpak
Working on the system installation at /var/lib/flatpak
[2/21] Verifying flathub:runtime/org.freedesktop.Platform.GL.default/x86_64/23.08-extra…
[3/21] Verifying flathub:runtime/org.gtk.Gtk3theme.Yaru-dark/x86_64/3.22…
[5/21] Verifying flathub:runtime/org.freedesktop.Platform.GL.nvidia-535-161-07/x86_64/1.4…
[11/21] Verifying flathub:runtime/org.freedesktop.Platform/x86_64/23.08…
[12/21] Verifying flathub:app/com.calibre_ebook.calibre/x86_64/stable…
[14/21] Verifying flathub:runtime/org.freedesktop.Platform.Locale/x86_64/23.08…
[15/21] Verifying flathub:runtime/org.gtk.Gtk3theme.Yaru/x86_64/3.22…
[16/21] Verifying flathub:runtime/org.freedesktop.Platform.openh264/x86_64/2.2.0…
[19/21] Verifying flathub:app/io.freetubeapp.FreeTube/x86_64/stable…
[21/21] Verifying flathub:runtime/org.freedesktop.Platform.GL.default/x86_64/23.08…
Checking remotes...
Pruning objects
F: Pruning repo
F: Pruned 19291/0 objects, size 0 bytes
Erasing .removed
F: No installations directory in /etc/flatpak/installations.d. Skipping
2024-03-08 09:36hippo@hippo-camp2:~$ flatpak repair --user -vv
F: Opening user flatpak installation at path /home/hippo/.local/share/flatpak
Working on the user installation at /home/hippo/.local/share/flatpak
error: Listing refs: opendir(refs/heads): No such file or directory

@matt32106
Copy link
Author

matt32106 commented Mar 8, 2024

As flatpak remote-delete was not working, I vi-removed gnome and pitivi from flatpak/repo/config and now it only takes a few seconds after writing (but still a few seconds not zero see point 2 below).
This solves my issue, however some problems remain:

1- flatpak remote-delete --force gnome` should not be stopped by a semi-borked configuration, IMO it should remove what it can and especially the lines in config file

2- I don't get the logic of printing to the user "Nothing to do." when flatpak update is run and then starting to do something else (check all the lines in -vv mode that occur after "Nothing to do."). This should be changed.

3- The verbosity of flatpak update should be modified to report Socket IO errors/retries if this code stays in flatpak update.

EDIT : sorrry for the formatting, the GUI is super buggy

@homersimpsons
Copy link

homersimpsons commented Apr 16, 2024

For the record, I also had this issue, but I ran a flatpak update today and it is really fast. I do not understand why as there were no flatpak upgrade:

$ flatpak --version
Flatpak 1.12.7

$ time flatpak update
Looking for updates…
Nothing to do.

real	0m0,645s
user	0m0,205s
sys	0m0,046s

Here is my most recent apt upgrade, I suspect one of this upgrade to give a speed boost to flatpak because IIRC yesterday flatpak was still slow (on my machine it was ~10s):

$ sudo apt upgrade
(Reading database ... 263445 files and directories currently installed.)
Preparing to unpack .../libgnutls-dane0_3.7.3-4ubuntu1.5_amd64.deb ...
Unpacking libgnutls-dane0:amd64 (3.7.3-4ubuntu1.5) over (3.7.3-4ubuntu1.4) ...
Preparing to unpack .../libgnutls30_3.7.3-4ubuntu1.5_amd64.deb ...
Unpacking libgnutls30:amd64 (3.7.3-4ubuntu1.5) over (3.7.3-4ubuntu1.4) ...
Setting up libgnutls30:amd64 (3.7.3-4ubuntu1.5) ...
(Reading database ... 263445 files and directories currently installed.)
Preparing to unpack .../gir1.2-webkit2-4.0_2.44.0-0ubuntu0.22.04.1_amd64.deb ...
Unpacking gir1.2-webkit2-4.0:amd64 (2.44.0-0ubuntu0.22.04.1) over (2.42.5-0ubuntu0.22.04.2) ...
Preparing to unpack .../gir1.2-javascriptcoregtk-4.0_2.44.0-0ubuntu0.22.04.1_amd64.deb ...
Unpacking gir1.2-javascriptcoregtk-4.0:amd64 (2.44.0-0ubuntu0.22.04.1) over (2.42.5-0ubuntu0.22.04.2) ...
Preparing to unpack .../libwebkit2gtk-4.0-37_2.44.0-0ubuntu0.22.04.1_amd64.deb ...
Unpacking libwebkit2gtk-4.0-37:amd64 (2.44.0-0ubuntu0.22.04.1) over (2.42.5-0ubuntu0.22.04.2) ...
Preparing to unpack .../libjavascriptcoregtk-4.0-18_2.44.0-0ubuntu0.22.04.1_amd64.deb ...
Unpacking libjavascriptcoregtk-4.0-18:amd64 (2.44.0-0ubuntu0.22.04.1) over (2.42.5-0ubuntu0.22.04.2) ...
Preparing to unpack .../gnutls-bin_3.7.3-4ubuntu1.5_amd64.deb ...
Unpacking gnutls-bin (3.7.3-4ubuntu1.5) over (3.7.3-4ubuntu1.4) ...
Setting up libgnutls-dane0:amd64 (3.7.3-4ubuntu1.5) ...
Setting up libjavascriptcoregtk-4.0-18:amd64 (2.44.0-0ubuntu0.22.04.1) ...
Setting up gir1.2-javascriptcoregtk-4.0:amd64 (2.44.0-0ubuntu0.22.04.1) ...
Setting up libwebkit2gtk-4.0-37:amd64 (2.44.0-0ubuntu0.22.04.1) ...
Setting up gnutls-bin (3.7.3-4ubuntu1.5) ...
Setting up gir1.2-webkit2-4.0:amd64 (2.44.0-0ubuntu0.22.04.1) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for libc-bin (2.35-0ubuntu3.6) ...

$ sudo apt autoremove --purge
(Reading database ... 263445 files and directories currently installed.)
Removing libwpebackend-fdo-1.0-1:amd64 (1.14.2-0ubuntu0.22.04.1) ...
Removing libwpe-1.0-1:amd64 (1.14.0-0ubuntu0.22.04.1) ...
Processing triggers for libc-bin (2.35-0ubuntu3.6) ...
Log ended: 2024-04-16  14:48:30

Edit: I'm not entirely sure about what happens. It looks like the first call of the day is slow while the next ones are fast.

In fact when I run flatpak update the first time it will be slow (seconds to completes) while running it a second time juste after will be fast (0.4s).

This is certainly due to the following line of log:

F: flathub:x86_64 appstream age 158 is less than ttl 86400

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

4 participants