Bug 1811060 - flatpak update hangs forever, spins CPU at 100%
Summary: flatpak update hangs forever, spins CPU at 100%
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: flatpak
Version: 32
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: David King
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-06 14:20 UTC by Kamil Páral
Modified: 2020-12-21 16:48 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-09 15:34:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
output of `OSTREE_DEBUG_HTTP=1 flatpak update -vv --ostree-verbose` (20.25 KB, text/plain)
2020-03-06 15:06 UTC, Kamil Páral
no flags Details

Description Kamil Páral 2020-03-06 14:20:39 UTC
Description of problem:
Ever since I upgraded to Fedora 32, I can't run "flatpak update" successfully. It says "Nothing to do" and then consumes 100% CPU forever (I waited 15 minutes). Running in verbose mode says this:

$ flatpak update -vvv
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/kparal/.local/share/flatpak
Looking for updates…
F: Fetching summary file for remote ‘flathub’
F: Transaction: update flathub:app/com.github.junrrein.PDFSlicer/x86_64/stable[$old]
F: Transaction: update flathub:app/com.github.tchx84.Flatseal/x86_64/stable[$old]
F: Transaction: update flathub:app/com.uploadedlobster.peek/x86_64/stable[$old]
F: Transaction: update flathub:app/net.danigm.timetrack/x86_64/stable[$old]
F: Transaction: update flathub:app/org.freefilesync.FreeFileSync/x86_64/stable[$old]
F: Transaction: update flathub:runtime/com.github.junrrein.PDFSlicer.Locale/x86_64/stable[$old]
F: Transaction: update flathub:runtime/com.uploadedlobster.peek.Locale/x86_64/stable[$old]
F: Transaction: update flathub:runtime/net.danigm.timetrack.Locale/x86_64/stable[$old]
F: Transaction: update flathub:runtime/org.freedesktop.Platform.GL.default/x86_64/19.08[$old]
F: Transaction: update flathub:runtime/org.freedesktop.Platform.Locale/x86_64/19.08[$old]
F: Transaction: update flathub:runtime/org.freedesktop.Platform.VAAPI.Intel/x86_64/18.08[$old]
F: Transaction: update flathub:runtime/org.freedesktop.Platform.VAAPI.Intel/x86_64/19.08[$old]
F: Transaction: update flathub:runtime/org.freedesktop.Platform.ffmpeg-full/x86_64/19.08[$old]
F: Transaction: update flathub:runtime/org.freedesktop.Platform.html5-codecs/x86_64/18.08[$old]
F: Transaction: update flathub:runtime/org.freedesktop.Platform.openh264/x86_64/19.08[$old]
F: Transaction: update flathub:runtime/org.freedesktop.Platform/x86_64/19.08[$old]
F: Transaction: update flathub:runtime/org.freedesktop.Sdk.Locale/x86_64/19.08[$old]
F: Transaction: update flathub:runtime/org.freedesktop.Sdk/x86_64/19.08[$old]
F: Transaction: update flathub:runtime/org.freefilesync.FreeFileSync.Locale/x86_64/stable[$old]
F: Transaction: update flathub:runtime/org.gnome.Platform.Locale/x86_64/3.32[$old]
F: Transaction: update flathub:runtime/org.gnome.Platform.Locale/x86_64/3.34[$old]
F: Transaction: update flathub:runtime/org.gnome.Platform/x86_64/3.32[$old]
F: Transaction: update flathub:runtime/org.gnome.Platform/x86_64/3.34[$old]
F: Looking for remote metadata updates for flathub
F: marking op update:runtime/org.gnome.Platform/x86_64/3.34 resolved to c71932cf654ccc23abc0e84068daafadec78eb471e524c8469b6d8739cbba024
F: marking op update:runtime/org.gnome.Platform/x86_64/3.32 resolved to 887f56bfcc50872acd83185f8fc0da57ed79a380698ef2d2b41bf95c5ddfc858
F: marking op update:runtime/org.gnome.Platform.Locale/x86_64/3.34 resolved to 3ad128812141a68dfb3baefd16398bd26e8bb14bff4252c13a527623846a8384
F: marking op update:runtime/org.gnome.Platform.Locale/x86_64/3.32 resolved to ac6fbfeb7cfe30ad7d63709cab97e36e48b32dc7cc118c518805e9ccc459cf93
F: marking op update:runtime/org.freefilesync.FreeFileSync.Locale/x86_64/stable resolved to 1bd5f357211f9b4823dacfd81cf2df17d161bd133c10d53ce5f112a54b95440e
F: marking op update:runtime/org.freedesktop.Sdk/x86_64/19.08 resolved to 6515b94c0ab4462041b0814a8031f4f187e967152110e3483fec13241d35a7ab
F: marking op update:runtime/org.freedesktop.Sdk.Locale/x86_64/19.08 resolved to a9c13cb4a62692b6fcfea7cecd19d1285fe6825ef2673985c85a7e9da3ce5022
F: marking op update:runtime/org.freedesktop.Platform/x86_64/19.08 resolved to 54f40ee188c413880a613602b75988de9c8a5704f22648d0c18916b9c78d54d2
F: marking op update:runtime/org.freedesktop.Platform.openh264/x86_64/19.08 resolved to 416c864f49cf6fa10bfdec8946cd509e8508131d6f53a9e5c6684f06ddfa9913
F: marking op update:runtime/org.freedesktop.Platform.html5-codecs/x86_64/18.08 resolved to b7006caaf6a7705c4e899520794e1f58cbe5d62c5a70423195dde2f740743a8c
F: marking op update:runtime/org.freedesktop.Platform.ffmpeg-full/x86_64/19.08 resolved to 83c229e3d2cc608e61acab45aee0c41c1a39d1f4d3d002f750dcbdbf3ac6100c
F: marking op update:runtime/org.freedesktop.Platform.VAAPI.Intel/x86_64/19.08 resolved to b1cb12e166dd972b59212f4a5ff7521c28496e2f689c481341e1a72f27c10197
F: marking op update:runtime/org.freedesktop.Platform.VAAPI.Intel/x86_64/18.08 resolved to 227f1293370974b792336527a54f4df45bac40a67c962a528374c41445e79f1b
F: marking op update:runtime/org.freedesktop.Platform.Locale/x86_64/19.08 resolved to 6db30f252d42aaba303e4431f84347f744f744596221ec604324a87a01972b49
F: marking op update:runtime/org.freedesktop.Platform.GL.default/x86_64/19.08 resolved to 4adebcd41eb62089b558fb9e7d863720f14d707265fe8e8f350b71b5ba77f2dc
F: marking op update:runtime/net.danigm.timetrack.Locale/x86_64/stable resolved to 80c5770d3a363b1219f00454ed64967cee71c955dfcd0ffdaf897ca17ef2d580
F: marking op update:runtime/com.uploadedlobster.peek.Locale/x86_64/stable resolved to d655e816727a2e40b689681c22a5946a55c61f11952e82f5fa3d129e2afc8e3e
F: marking op update:runtime/com.github.junrrein.PDFSlicer.Locale/x86_64/stable resolved to ee423b89447b6df17f6fb35bf67a7f95508ed457081a2902c3080b1dda1d6e94
F: marking op update:app/org.freefilesync.FreeFileSync/x86_64/stable resolved to fb67de118aa907eb3274c043e15bb7e3daf9d533a34ba8749c668d5db27f70ed
F: marking op update:app/net.danigm.timetrack/x86_64/stable resolved to d75411502103b413f8533550923c72aa9e40376de28645d52546b39f986ee333
F: marking op update:app/com.uploadedlobster.peek/x86_64/stable resolved to 3866e1d9e0243a5e3b806664c8904ec4dd1711dad9a2942b05566ba908473012
F: marking op update:app/com.github.tchx84.Flatseal/x86_64/stable resolved to 545b5d6d90432e81b47d3afe8a3aa3dedbc1f050302a4e58477be7bf9ee3682d
F: marking op update:app/com.github.junrrein.PDFSlicer/x86_64/stable resolved to 54f968c05138ec50bdef3247589916b52529eaf052143fe18cd59ca1c26e6559
F: Transaction: install/update flathub:runtime/org.gnome.Platform.Locale/x86_64/3.34[/en]
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.GL.default/x86_64/19.08[*]
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.VAAPI.Intel/x86_64/19.08[*]
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.openh264/x86_64/19.08[*]
F: Transaction: install/update flathub:runtime/org.gnome.Platform.Locale/x86_64/3.32[/cs, /en]
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.VAAPI.Intel/x86_64/18.08[*]
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.html5-codecs/x86_64/18.08[*]
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.GL.default/x86_64/19.08[*]
F: Transaction: install/update flathub:runtime/org.freedesktop.Sdk.Locale/x86_64/19.08[/en]
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.openh264/x86_64/19.08[*]
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.VAAPI.Intel/x86_64/19.08[*]
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.GL.default/x86_64/19.08[*]
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.Locale/x86_64/19.08[/en]
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.VAAPI.Intel/x86_64/19.08[*]
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.openh264/x86_64/19.08[*]
F: Transaction: install/update flathub:runtime/org.freefilesync.FreeFileSync.Locale/x86_64/stable[/cs, /en]
F: Transaction: install/update flathub:runtime/net.danigm.timetrack.Locale/x86_64/stable[/en]
F: Transaction: install/update flathub:runtime/com.uploadedlobster.peek.Locale/x86_64/stable[/cs, /en]
F: Transaction: install/update flathub:runtime/com.github.junrrein.PDFSlicer.Locale/x86_64/stable[/cs, /en]
Nothing to do.
F: fedora:x86_64 appstream age 5880 is less than ttl 86400
F: fedora-testing:x86_64 appstream age 18446744073709551615 is greater than ttl 86400
F: flathub:x86_64 appstream age 170023 is greater than ttl 86400
F: Updating appstream data for remote flathub
F: Fetching summary file for remote ‘flathub’
F: flatpak_dir_pull: Using commit 833061f2c4af612603fed6a0e9a4d7fb63a177e34dd963c1d84eab0dc0141d3c for pull of ref appstream2/x86_64 from remote flathub

Here I need to kill it with Ctrl+C. When I run gstack on the process, this is the output:

$ sudo gstack 14973
Thread 5 (Thread 0x7fcbb5831700 (LWP 14999)):
#0  0x00007fcbc55bd9cf in poll () from /lib64/libc.so.6
#1  0x00007fcbc5722a8d in g_main_context_iterate.constprop () from /lib64/libglib-2.0.so.0
#2  0x00007fcbc5722bc3 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#3  0x00007fcbc605201d in dconf_gdbus_worker_thread () from /usr/lib64/gio/modules/libdconfsettings.so
#4  0x00007fcbc574c652 in g_thread_proxy () from /lib64/libglib-2.0.so.0
#5  0x00007fcbc569c432 in start_thread () from /lib64/libpthread.so.0
#6  0x00007fcbc55c8833 in clone () from /lib64/libc.so.6
Thread 4 (Thread 0x7fcbb6032700 (LWP 14976)):
#0  0x00007fcbc55bd9cf in poll () from /lib64/libc.so.6
#1  0x00007fcbc5722a8d in g_main_context_iterate.constprop () from /lib64/libglib-2.0.so.0
#2  0x00007fcbc5722e0b in g_main_loop_run () from /lib64/libglib-2.0.so.0
#3  0x00007fcbc5d2ea07 in server_thread_func () from /lib64/libpolkit-agent-1.so.0
#4  0x00007fcbc574c652 in g_thread_proxy () from /lib64/libglib-2.0.so.0
#5  0x00007fcbc569c432 in start_thread () from /lib64/libpthread.so.0
#6  0x00007fcbc55c8833 in clone () from /lib64/libc.so.6
Thread 3 (Thread 0x7fcbb6833700 (LWP 14975)):
#0  0x00007fcbc55bd9cf in poll () from /lib64/libc.so.6
#1  0x00007fcbc5722a8d in g_main_context_iterate.constprop () from /lib64/libglib-2.0.so.0
#2  0x00007fcbc5722e0b in g_main_loop_run () from /lib64/libglib-2.0.so.0
#3  0x00007fcbc597578a in gdbus_shared_thread_func () from /lib64/libgio-2.0.so.0
#4  0x00007fcbc574c652 in g_thread_proxy () from /lib64/libglib-2.0.so.0
#5  0x00007fcbc569c432 in start_thread () from /lib64/libpthread.so.0
#6  0x00007fcbc55c8833 in clone () from /lib64/libc.so.6
Thread 2 (Thread 0x7fcbb7034700 (LWP 14974)):
#0  0x00007fcbc55bd9cf in poll () from /lib64/libc.so.6
#1  0x00007fcbc5722a8d in g_main_context_iterate.constprop () from /lib64/libglib-2.0.so.0
#2  0x00007fcbc5722bc3 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#3  0x00007fcbc5722c11 in glib_worker_main () from /lib64/libglib-2.0.so.0
#4  0x00007fcbc574c652 in g_thread_proxy () from /lib64/libglib-2.0.so.0
#5  0x00007fcbc569c432 in start_thread () from /lib64/libpthread.so.0
#6  0x00007fcbc55c8833 in clone () from /lib64/libc.so.6
Thread 1 (Thread 0x7fcbc40a5980 (LWP 14973)):
#0  0x00007fcbc56a7b66 in __libc_sigaction () from /lib64/libpthread.so.0
#1  0x00007fcbc4f14715 in sigpipe_ignore.part () from /lib64/libcurl.so.4
#2  0x00007fcbc4f17eda in multi_socket () from /lib64/libcurl.so.4
#3  0x00007fcbc4f17fd8 in curl_multi_socket_action () from /lib64/libcurl.so.4
#4  0x00007fcbc5dcf47a in event_cb () from /lib64/libostree-1.so.1
#5  0x00007fcbc572276f in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#6  0x00007fcbc5722af8 in g_main_context_iterate.constprop () from /lib64/libglib-2.0.so.0
#7  0x00007fcbc5722bc3 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#8  0x00007fcbc5d937a7 in ostree_repo_pull_with_options () from /lib64/libostree-1.so.1
#9  0x00005562d1c2f2bc in repo_pull ()
#10 0x00005562d1c485f5 in flatpak_dir_pull ()
#11 0x00005562d1c4d4a9 in flatpak_dir_update_appstream ()
#12 0x00005562d1c20aa4 in update_appstream ()
#13 0x00005562d1be8b37 in flatpak_builtin_update ()
#14 0x00005562d1bdcef8 in main ()


Here is my flatpak configuration:

$ flatpak remotes
Name          Options
fedora        system,oci
flathub       system
gnome-nightly system
flathub       user

$ flatpak list
Name                                       Application ID                          Version   Branch   Installation
PDF Slicer                                 com.github.junrrein.PDFSlicer           1.8.2     stable   system
Flatseal                                   com.github.tchx84.Flatseal              1.4.2     stable   system
Peek                                       com.uploadedlobster.peek                1.5.1     stable   system
Timetrack                                  net.danigm.timetrack                    1.2.2     stable   system
Freedesktop Platform                       org.freedesktop.Platform                19.08.8   19.08    system
default                                    org.freedesktop.Platform.GL.default               19.08    system
Intel                                      org.freedesktop.Platform.VAAPI.Intel              18.08    system
Intel                                      org.freedesktop.Platform.VAAPI.Intel              19.08    system
ffmpeg-full                                org.freedesktop.Platform.ffmpeg-full              19.08    system
html5-codecs                               org.freedesktop.Platform.html5-codecs             18.08    system
openh264                                   org.freedesktop.Platform.openh264                 19.08    system
Freedesktop SDK                            org.freedesktop.Sdk                     19.08.8   19.08    system
FreeFileSync                               org.freefilesync.FreeFileSync           10.20     stable   system
GNOME Application Platform version 3.32    org.gnome.Platform                                3.32     system
GNOME Application Platform version 3.34    org.gnome.Platform                                3.34     system



Version-Release number of selected component (if applicable):
flatpak-1.6.2-1.fc32.x86_64
ostree-2020.2-2.fc32.x86_64


How reproducible:
always on my PC

Steps to Reproduce:
1. flatpak update (hangs)

Additional info:
I tried to reproduce the problem on a clean Fedora 32 installation, and I didn't see the problem. But I upgraded one VM from Fedora 31 to Fedora 32 and I believe I saw the same problem (update hanging), but only once. On subsequent "flatpak update" it worked. I think this must be related to the ostree state on my PC or something. In Fedora 31 everything worked fine just a couple of days back.

Comment 1 Alexander Larsson 2020-03-06 14:57:19 UTC
Same as https://bugzilla.redhat.com/show_bug.cgi?id=1810989
export OSTREE_DEBUG_HTTP=1 seems to show that basically all http requests just hang.

Comment 2 Kamil Páral 2020-03-06 15:06:25 UTC
Created attachment 1668132 [details]
output of `OSTREE_DEBUG_HTTP=1 flatpak update -vv --ostree-verbose`

Comment 3 Alexander Larsson 2020-03-06 15:39:40 UTC
Hey colin, this seems to be an issue in ostree pull, it just stops downloading stuff during a pull operation.

Comment 4 Colin Walters 2020-03-06 18:43:44 UTC
We haven't changed the libostree code here much - this seems likely to be a regression in curl.

Man, ugh at curl constantly hitting the SIGPIPE handler rather than using the socket option and/or noticing that glib already globally set SIGPIPE to SIG_IGN anyways.

Comment 5 Jan Grulich 2020-03-09 08:43:55 UTC
See https://bugzilla.redhat.com/show_bug.cgi?id=1810989#c4. It indeed is an issue in curl.

Comment 6 Kamil Páral 2020-03-09 15:34:14 UTC
Yes, it looks to be curl-related. I initially downgraded curl and that didn't help, but I didn't realize there's also libcurl (d'oh!). Now I went from libcurl-7.69.0-1.fc32.x86_64 to libcurl-7.68.0-2.fc32.x86_64 and flatpak commands started working. Because the broken update was unpushed, I believe I can close this.


Note You need to log in before you can comment on or make changes to this bug.