ostreedev / ostree

Operating system and container binary deployment and upgrades
https://ostreedev.github.io/ostree/
Other
1.29k stars 296 forks source link

`flatpak update` produces ostree error with curl 8.10.0 (+ patch) #3299

Closed adamthiede closed 1 month ago

adamthiede commented 1 month ago

When running flatpak update on Alpine Linux edge, the following error message is produced:

OSTree:ERROR:src/libostree/ostree-fetcher-curl.c:534:sock_cb: code should not be reached
Bail out! OSTree:ERROR:src/libostree/ostree-fetcher-curl.c:534:sock_cb: code should not be reached
Aborted

This began when this patch was added to Alpine's curl package; the patch addresses this issue and is already in curl's master branch.

Let me know if I can provide any more info.

See here for more info. https://gitlab.alpinelinux.org/alpine/aports/-/issues/16444

cgwalters commented 1 month ago

Hmm fun, thanks for the report. This will require some analysis. If you happen to have the environment set up it'd be quite useful to know if this reproduces with make check in the ostree unit tests.

adamthiede commented 1 month ago

Sure thing.

For reference, here's how Alpine builds ostree: https://git.alpinelinux.org/aports/tree/community/ostree/APKBUILD

The "build" step has the configuration options in it. I've built it myself and confirmed that removing the '--with-curl' option does fix this, but I'm unaware of any downsides to that.

Attached is the output of make check after the configure and build step that's in that APKBUILD. (In this instance I did not remove '--with-curl'.) Which test am I looking for?

make_check.txt

adamthiede commented 1 month ago

In the error it mentions this line: https://github.com/ostreedev/ostree/blob/main/src/libostree/ostree-fetcher-curl.c#L534 I built ostree with that line commented out, and flatpak network operations (installing, etc) worked. I assume that's because it was falling back to libsoup though?

vixalien commented 1 month ago

The issue has been "fixed" in alpine linux: https://gitlab.alpinelinux.org/alpine/aports/-/issues/16444

All you need to do is downgrade libcurl by doing an apk upgrade -a

adamthiede commented 1 month ago

Yes, it's working again, but unless this bug is fixed in curl, then it'll likely be relevant again soon.

ThatOneCalculator commented 1 month ago

It's now relevant in Arch Linux.

adamthiede commented 1 month ago

I assume "resolving" this in Arch would be similar to Alpine; remove curl as a build dependency in ostree, bump pkgrel, and rebuild: https://gitlab.archlinux.org/archlinux/packaging/packages/ostree/-/blob/main/PKGBUILD?ref_type=heads#L93

Understandable that that's not a "real" solution.

musicfunfan commented 1 month ago

I have the same problem on archlinux. So i will wait for a fix. This seems to be new problem if this persist i will. Try to remove curl from dependencys But i do not like this solution very much to be honest.

adamthiede commented 1 month ago

Arch Linux IRC members say this is known and being investigated, so hopefully a fix/workaround is forthcoming.

ThatOneCalculator commented 1 month ago

For now, I've published the ostree-nocurl AUR package which solves the issue.

musicfunfan commented 1 month ago

If i this take a lot of time get fix. I will use the AUR package. Thank you very much. @ThatOneCalculator

Antiz96 commented 1 month ago

I just pushed a new release of the ostree package to the Arch [extra] repository built without curl support as a temporary workaround. Updating to ostree 2024.7-3 should fix the issue for Arch users.

@ThatOneCalculator I'm removing your AUR package, it shouldn't be necessary anymore :wink:

arnav4o4 commented 1 month ago

For now, I've published the ostree-nocurl AUR package which solves the issue.

looking for conflicting packages... :: ostree-nocurl-2024.7-2 and ostree-2024.7-2 are in conflict. Remove ostree? [y/N] y
error: failed to prepare transaction (could not satisfy dependencies) :: removing ostree breaks dependency 'ostree' required by flatpak -> error installing: [/home/USER/.cache/yay/ostree-nocurl/ostree-nocurl-2024.7-2-x86_64.pkg.tar.zst] - exit status 1

musicfunfan commented 1 month ago

You need to remove flatpak and re install. After installing ostree ? Just an idea not tested.

ThatOneCalculator commented 1 month ago

@ThatOneCalculator I'm removing your AUR package, it shouldn't be necessary anymore 😉

Ty! My shortest-lived patch package yet :smile:

Antiz96 commented 1 month ago

For now, I've published the ostree-nocurl AUR package which solves the issue.

looking for conflicting packages... :: ostree-nocurl-2024.7-2 and ostree-2024.7-2 are in conflict. Remove ostree? [y/N] y error: failed to prepare transaction (could not satisfy dependencies) :: removing ostree breaks dependency 'ostree' required by flatpak -> error installing: [/home/USER/.cache/yay/ostree-nocurl/ostree-nocurl-2024.7-2-x86_64.pkg.tar.zst] - exit status 1

See my comment above, no need to install that AUR package (which has been removed now), you can just update your system as usual to get ostree 2024.7-3 which should fix the issue :)

arrwdodger commented 1 month ago

my system won't update to 7-3, it only sees 7-2 no matter how many times i sync.

Antiz96 commented 1 month ago

my system won't update to 7-3, it only sees 7-2 no matter how many times i sync.

You might point to an outdated mirror, you can try to update your mirrorlist.

arrwdodger commented 1 month ago

i updated the mirror list and nothing changed.

edit: apparently i don't know how anything works. i fixed the issue by actually updating the mirrorlist properly.

ThatOneCalculator commented 1 month ago

Worst-case scenario you could download the .tar.zst archive and pacman -U it, but this sounds like a mirrorlist issue

arrwdodger commented 1 month ago

maybe i updated the mirrorlist incorrectly. i had not heard of the mirrorlist until i asked this forum.

smcv commented 1 month ago

It would probably be best to keep Arch-specific discussion of mirrors, packages and workarounds to an Arch forum or issue tracker of some sort, to avoid creating noise for the developers who might be able to debug and fix this. The important part of what Arch has done, from an upstream point of view, is: compiling libostree to use libsoup instead of libcurl is a workaround for this.

arrwdodger commented 1 month ago

apologies, i didn't mean for this to get off track.

smcv commented 1 month ago

If you happen to have the environment set up it'd be quite useful to know if this reproduces with make check in the ostree unit tests.

I get the same error message with the libcurl 8.10.1 in Debian testing/unstable (the actual library that my libostree is linked to is libcurl-gnutls.so.4).

Unfortunately, libostree's own make check doesn't reproduce this - presumably downloading from a real Flatpak server takes us onto a different code path?

I'm trying the Flatpak test suite to see whether that reproduces the same error message.

smcv commented 1 month ago

Sorry, the Flatpak test suite doesn't reproduce this either...

dbnicholson commented 1 month ago

Both test suites use a fake-ish HTTP 1 servers (ostree uses SoupServer while flatpak uses Python's http.server IIRC). Perhaps you need an HTTP 2 server to induce this. Could be possible to spin up NGINX and throw some fake content into it.

cgwalters commented 1 month ago

I put up https://github.com/ostreedev/ostree/pull/3306 - it'd be quite useful if someone who is hitting this problem can try running with that patch; again it won't fix the problem but I'm hoping that if that assertion trips we're more likely to get a stack trace that hints at the problem.

dbnicholson commented 1 month ago

That said, if someone affected could get a backtrace that might help a bit.

adamthiede commented 1 month ago

I put up #3306 - it'd be quite useful if someone who is hitting this problem can try running with that patch; again it won't fix the problem but I'm hoping that if that assertion trips we're more likely to get a stack trace that hints at the problem.

Built with the patch, and an attempted install:

$ sudo flatpak install adwaita-dark
Looking for matches…
Found ref ‘runtime/org.gtk.Gtk3theme.Adwaita-dark/aarch64/3.22’ in remote ‘flathub’ (system).
Use this ref? [Y/n]: y

        ID                               Branch  Op  Remote   Download
 1. [|] org.gtk.Gtk3theme.Adwaita-dark   3.22    i   flathub  < 1.5 kB

Installing…**
OSTree:ERROR:src/libostree/ostree-fetcher-curl.c:521:addsock: assertion failed (rc == CURLM_OK): (1 == 0)
Bail out! OSTree:ERROR:src/libostree/ostree-fetcher-curl.c:521:addsock: assertion failed (rc == CURLM_OK): (1 == 0)
Aborted

how would I generate a trace for this?

cgwalters commented 1 month ago

I also just put up https://github.com/ostreedev/ostree/pull/3307 which might fix the problem, so if folks could test that too that'd be great

cgwalters commented 1 month ago

Nice! That's helpful.

how would I generate a trace for this?

Does your system have a core dump collector enabled like systemd's? See https://www.freedesktop.org/software/systemd/man/latest/systemd-coredump.html If so you'll find it via coredumpctl e.g.

adamthiede commented 1 month ago

With both patches applied:

...
Installing…**
OSTree:ERROR:src/libostree/ostree-fetcher-curl.c:525:addsock: assertion failed (rc == CURLM_OK): (1 == 0)
Bail out! OSTree:ERROR:src/libostree/ostree-fetcher-curl.c:525:addsock: assertion failed (rc == CURLM_OK): (1 == 0)
Aborted

Alpine uses OpenRC; systemd is not present unfortunately. Is there some sort of env variable I can set?

smcv commented 1 month ago

Alpine uses OpenRC; systemd is not present unfortunately. Is there some sort of env variable I can set?

Please consult your OS's documentation for how to get a useful backtrace from a crash. (It is OS-specific and is not as simple as merely setting an environment variable.)

fallingcats commented 1 month ago

That said, if someone affected could get a backtrace that might help a bit.

I've got this backtrace on arch, if that helps:

Thread 6 (Thread 0x7f2ea90006c0 (LWP 60562)):
#0  0x00007f2eae01063d in __GI___poll (fds=0x7f2e98000b90, nfds=3, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f2eaebfce0d in g_main_context_poll_unlocked (priority=2147483647, context=0x559821880290, timeout=<optimized out>, fds=0x7f2e98000b90, n_fds=3) at ../glib/glib/gmain.c:4521
#2  g_main_context_iterate_unlocked.isra.0 (context=0x559821880290, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4212
#3  0x00007f2eaeb9afa7 in g_main_loop_run (loop=0x559821880390) at ../glib/glib/gmain.c:4419
#4  0x00007f2eaea81d04 in gdbus_shared_thread_func (user_data=0x559821878070) at ../glib/gio/gdbusprivate.c:284
#5  0x00007f2eaebca1b6 in g_thread_proxy (data=0x5598218803b0) at ../glib/glib/gthread.c:835
#6  0x00007f2eadf9939d in start_thread (arg=<optimized out>) at pthread_create.c:447
#7  0x00007f2eae01e49c in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Thread 5 (Thread 0x7f2ea3e006c0 (LWP 60563)):
#0  0x00007f2eae01063d in __GI___poll (fds=0x7f2e900014a0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f2eaebfce0d in g_main_context_poll_unlocked (priority=2147483647, context=0x7f2e90000b70, timeout=<optimized out>, fds=0x7f2e900014a0, n_fds=1) at ../glib/glib/gmain.c:4521
#2  g_main_context_iterate_unlocked.isra.0 (context=0x7f2e90000b70, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4212
#3  0x00007f2eaeb9afa7 in g_main_loop_run (loop=0x7f2e90000d90) at ../glib/glib/gmain.c:4419
#4  0x00007f2eae5dd604 in server_thread_func (user_data=0x55982188d0f0) at ../polkit/src/polkitagent/polkitagentlistener.c:357
#5  0x00007f2eaebca1b6 in g_thread_proxy (data=0x559821888840) at ../glib/glib/gthread.c:835
#6  0x00007f2eadf9939d in start_thread (arg=<optimized out>) at pthread_create.c:447
#7  0x00007f2eae01e49c in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Thread 4 (Thread 0x7f2ea9a006c0 (LWP 60561)):
#0  0x00007f2eae01063d in __GI___poll (fds=0x559821874650, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f2eaebfce0d in g_main_context_poll_unlocked (priority=2147483647, context=0x5598218743d0, timeout=<optimized out>, fds=0x559821874650, n_fds=1) at ../glib/glib/gmain.c:4521
#2  g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x5598218743d0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4212
#3  0x00007f2eaeb99795 in g_main_context_iteration (context=0x5598218743d0, may_block=may_block@entry=1) at ../glib/glib/gmain.c:4282
#4  0x00007f2eaeb997f2 in glib_worker_main (data=<optimized out>) at ../glib/glib/gmain.c:6442
#5  0x00007f2eaebca1b6 in g_thread_proxy (data=0x5598218745f0) at ../glib/glib/gthread.c:835
#6  0x00007f2eadf9939d in start_thread (arg=<optimized out>) at pthread_create.c:447
#7  0x00007f2eae01e49c in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Thread 3 (Thread 0x7f2ea34006c0 (LWP 60587)):
#0  0x00007f2eae01063d in __GI___poll (fds=0x7f2e8c003b90, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f2eaebfce0d in g_main_context_poll_unlocked (priority=2147483647, context=0x559821a32a80, timeout=<optimized out>, fds=0x7f2e8c003b90, n_fds=1) at ../glib/glib/gmain.c:4521
#2  g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x559821a32a80, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4212
#3  0x00007f2eaeb99795 in g_main_context_iteration (context=context@entry=0x559821a32a80, may_block=may_block@entry=1) at ../glib/glib/gmain.c:4282
#4  0x00007f2eacbcb1ee in dconf_gdbus_worker_thread (user_data=0x559821a32a80) at ../dconf/gdbus/dconf-gdbus-thread.c:82
#5  0x00007f2eaebca1b6 in g_thread_proxy (data=0x559821a5a170) at ../glib/glib/gthread.c:835
#6  0x00007f2eadf9939d in start_thread (arg=<optimized out>) at pthread_create.c:447
#7  0x00007f2eae01e49c in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Thread 2 (Thread 0x7f2eaa4006c0 (LWP 60560)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007f2eaebf5eb0 in g_cond_wait (cond=0x559821870098, mutex=0x559821870090) at ../glib/glib/gthread-posix.c:1552
#2  0x00007f2eaeb6295c in g_async_queue_pop_intern_unlocked (queue=0x559821870090, wait=1, end_time=-1) at ../glib/glib/gasyncqueue.c:375
#3  0x00007f2eaebcf7f7 in g_thread_pool_spawn_thread (data=<optimized out>) at ../glib/glib/gthreadpool.c:297
#4  0x00007f2eaebca1b6 in g_thread_proxy (data=0x55982186dd70) at ../glib/glib/gthread.c:835
#5  0x00007f2eadf9939d in start_thread (arg=<optimized out>) at pthread_create.c:447
#6  0x00007f2eae01e49c in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Thread 1 (Thread 0x7f2eacc49680 (LWP 60559)):
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007f2eadf9b463 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:78
#2  0x00007f2eadf42120 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007f2eadf294c3 in __GI_abort () at abort.c:79
#4  0x00007f2eaeb5b11b in g_assertion_message (domain=domain@entry=0x7f2eae7ea052 "OSTree", file=file@entry=0x7f2eae7f2ae8 "src/libostree/ostree-fetcher-curl.c", line=line@entry=534, func=func@entry=0x7f2eae7fd738 <__func__.6.lto_priv.11> "sock_cb", message=message@entry=0x559821beca40 "code should not be reached") at ../glib/glib/gtestutils.c:3331
#5  0x00007f2eaebc6d79 in g_assertion_message_expr (domain=domain@entry=0x7f2eae7ea052 "OSTree", file=file@entry=0x7f2eae7f2ae8 "src/libostree/ostree-fetcher-curl.c", line=line@entry=534, func=func@entry=0x7f2eae7fd738 <__func__.6.lto_priv.11> "sock_cb", expr=expr@entry=0x0) at ../glib/glib/gtestutils.c:3357
#6  0x00007f2eae7bf9f3 in sock_cb (easy=<optimized out>, s=<optimized out>, what=<optimized out>, cbp=<optimized out>, sockp=<optimized out>) at src/libostree/ostree-fetcher-curl.c:534
#7  sock_cb (easy=<optimized out>, s=<optimized out>, what=<optimized out>, cbp=0x559821bf4fd0, sockp=0x0) at src/libostree/ostree-fetcher-curl.c:526
#8  0x00007f2eae4198f6 in Curl_multi_closed (data=0x559821bf5720, s=139) at /usr/src/debug/curl/curl/lib/multi.c:3035
#9  0x00007f2eae4645bd in socket_close.isra.0 (data=0x559821bf5720, conn=0x559821be3b10, use_callback=<optimized out>, sock=139) at /usr/src/debug/curl/curl/lib/cf-socket.c:424
#10 0x00007f2eae3d3c47 in cf_socket_close (cf=0x5598218c5c80, data=<optimized out>) at /usr/src/debug/curl/curl/lib/cf-socket.c:1005
#11 0x00007f2eae3dde56 in cf_he_close (cf=0x5598218c5c50, data=0x559821bf5720) at /usr/src/debug/curl/curl/lib/connect.c:1004
#12 0x00007f2eae451ef4 in ssl_cf_close (cf=0x559821a33f30, data=0x559821bf5720) at /usr/src/debug/curl/curl/lib/vtls/vtls.c:1666
#13 0x00007f2eae3ddf0e in cf_setup_close (cf=0x559821a3b1d0, data=0x559821bf5720) at /usr/src/debug/curl/curl/lib/connect.c:1359
#14 0x00007f2eae3d26e2 in cf_hc_close (cf=0x559821bc1520, data=0x559821bf5720) at /usr/src/debug/curl/curl/lib/cf-https-connect.c:496
#15 0x00007f2eae3ddf7e in Curl_conn_close (data=data@entry=0x559821bf5720, index=index@entry=0) at /usr/src/debug/curl/curl/lib/cfilters.c:180
#16 0x00007f2eae3df00d in cpool_close_and_destroy (cpool=<optimized out>, conn=0x559821be3b10, data=0x559821bf5720, do_shutdown=false) at /usr/src/debug/curl/curl/lib/conncache.c:1063
#17 0x00007f2eae3e0806 in cpool_shutdown_discard_all (cpool=<optimized out>) at /usr/src/debug/curl/curl/lib/conncache.c:641
#18 cpool_shutdown_all (timeout_ms=0, cpool=0x559821bfd4f8, data=<optimized out>) at /usr/src/debug/curl/curl/lib/conncache.c:1195
#19 cpool_close_and_destroy_all (cpool=0x559821bfd4f8) at /usr/src/debug/curl/curl/lib/conncache.c:679
#20 0x00007f2eae4190ab in Curl_cpool_destroy (cpool=0x559821bfd4f8) at /usr/src/debug/curl/curl/lib/conncache.c:189
#21 curl_multi_cleanup (multi=0x559821bfd370) at /usr/src/debug/curl/curl/lib/multi.c:2758
#22 0x00007f2eae7bf1ff in _ostree_fetcher_finalize (object=0x559821bf4fd0) at src/libostree/ostree-fetcher-curl.c:183
#23 0x00007f2eae931065 in g_object_unref (_object=0x559821bf4fd0) at ../glib/gobject/gobject.c:4484
#24 0x00007f2eae77422f in reinitialize_fetcher (pull_data=0x7ffe4425b930, remote_name=0x5598218c7040 "flathub", error=0x7ffe4425c0a0) at src/libostree/ostree-repo-pull.c:3235
#25 ostree_repo_pull_with_options (self=self@entry=0x55982189a960, remote_name_or_baseurl=0x5598218c7040 "flathub", options=options@entry=0x5598218c5bb0, progress=progress@entry=0x559821bb4e30, cancellable=cancellable@entry=0x0, error=error@entry=0x7ffe4425c0a0) at src/libostree/ostree-repo-pull.c:4655
#26 0x0000559804175ed3 in repo_pull (flags=OSTREE_REPO_PULL_FLAGS_BAREUSERONLY_FILES, self=0x55982189a960, state=0x5598218a06e0, dirs_to_pull=<optimized out>, ref_to_fetch=0x559821912040 "app/com.google.Chrome/x86_64/stable", rev_to_fetch=<optimized out>, sideload_repo=<optimized out>, token=<optimized out>, flatpak_flags=FLATPAK_PULL_FLAGS_DOWNLOAD_EXTRA_DATA, progress=0x559821bd1cb0, cancellable=0x0, error=0x7ffe4425c0a0) at ../flatpak/common/flatpak-dir.c:5529
#27 flatpak_dir_pull.constprop.0 (self=0x55982189a6c0, state=0x5598218a06e0, ref=0x559821912040 "app/com.google.Chrome/x86_64/stable", opt_rev=<optimized out>, subpaths=<optimized out>, sideload_repo=<optimized out>, require_metadata=0x559821b8e370, token=0x0, repo=0x55982189a960, flatpak_flags=FLATPAK_PULL_FLAGS_DOWNLOAD_EXTRA_DATA, progress=0x559821bd1cb0, cancellable=0x0, error=0x7ffe4425c0a0, flags=OSTREE_REPO_PULL_FLAGS_NONE) at ../flatpak/common/flatpak-dir.c:6127
#28 0x0000559804154203 in flatpak_dir_update (self=0x55982189a6c0, no_pull=0, no_deploy=0, no_static_deltas=<optimized out>, allow_downgrade=0, app_hint=1, install_hint=0, state=0x559821912270, ref=0x559821912020, commit=0x559821b8f830 "d5bddfa15769f135a0900fafbc43ca49433603a58e8d8d96b4e50832a40ab90c", opt_subpaths=<optimized out>, opt_previous_ids=0x0, sideload_repo=0x0, require_metadata=0x559821b8e370, token=0x0, progress=0x559821bd1cb0, cancellable=0x0, error=0x7ffe4425c0a0) at ../flatpak/common/flatpak-dir.c:10709
#29 _run_op_kind (self=self@entry=0x55982189a290, op=op@entry=0x559821912270, remote_state=remote_state@entry=0x5598218a06e0, out_needs_prune=out_needs_prune@entry=0x7ffe4425c270, out_needs_triggers=out_needs_triggers@entry=0x7ffe4425c26c, out_needs_cache_drop=out_needs_cache_drop@entry=0x7ffe4425c268, cancellable=0x0, error=0x7ffe4425c2a0) at ../flatpak/common/flatpak-transaction.c:4842
#30 0x000055980415926c in flatpak_transaction_real_run (self=0x55982189a290, cancellable=0x0, error=0x7ffe4425c568) at ../flatpak/common/flatpak-transaction.c:5277
#31 0x00005598040e7d13 in flatpak_cli_transaction_run (transaction=0x55982189a290, cancellable=<optimized out>, error=0x7ffe4425c568) at ../flatpak/app/flatpak-cli-transaction.c:1625
#32 0x00005598040e150c in flatpak_transaction_run (transaction=0x55982189a290, cancellable=0x0, error=0x7ffe4425c568) at ../flatpak/common/flatpak-transaction.c:4738
#33 flatpak_builtin_update (argc=<optimized out>, argv=<optimized out>, cancellable=0x0, error=0x7ffe4425c568) at ../flatpak/app/flatpak-builtins-update.c:259
#34 0x000055980409b36a in flatpak_run (argc=<optimized out>, argv=<optimized out>, res_error=0x7ffe4425c558) at ../flatpak/app/flatpak-main.c:857
#35 main (argc=<optimized out>, argv=<optimized out>) at ../flatpak/app/flatpak-main.c:962
cgwalters commented 1 month ago

It does! So it's as I suspected it's in the teardown path. Also sorry for being slow at this but now that I've pulled down the updated curl in my environment it's clearly trivially reproducible with that same stack. And at least for me, https://github.com/ostreedev/ostree/pull/3307 fixes it.

Can someone else confirm that?

cgwalters commented 1 month ago

Edit sorry...ugh, I may have built with libsoup accidentally when testing the first time; anyways, I have a reproducer environment.

cgwalters commented 1 month ago

https://github.com/ostreedev/ostree/pull/3307 is updated and fixes this for me.

adamthiede commented 1 month ago

I've tested and it fixes it for me too. Awesome!

I'm building 2024.7 with #3307 and that seems fine. Should I add this patch to the package, or does this warrant a whole release?

cgwalters commented 1 month ago

We'll be doing an ostree release very soon including this patch, but again to highlight here I think the change is quite safe to cherry-pick.

lee2sman commented 1 month ago

I believe this is the same issue when updating flatpak on Void linux as well (also with curl and libcurl 8.10.1)

OSTree:ERROR:src/libostree/ostree-fetcher-curl.c:534:sock_cb: code should not be reached
Bail out! OSTree:ERROR:src/libostree/ostree-fetcher-curl.c:534:sock_cb: code should not be reached
dbnicholson commented 1 month ago

It seems like this should be fixed by #3307. Nice work @cgwalters!

cgwalters commented 1 month ago

Released in https://github.com/ostreedev/ostree/releases/tag/v2024.8

marathone commented 2 weeks ago

Same issue on Debian Stable (Bookworm) for the past week or so FWIW.

smcv commented 2 weeks ago

Same issue on Debian Stable (Bookworm) for the past week or so FWIW.

This should only affect Debian 12 if you are using a newer version of libcurl (upgrading core libraries like this somewhat defeats the purpose of using a stable release). It is a known issue for users of the libcurl 8.10.x in bookworm-backports. The workaround would be to revert to the libcurl 7.88.x shipped in Debian 12.

I've uploaded a fixed libostree for Debian 12, but it needs approval by the stable release managers before it will be made available in stable-proposed-updates.

sascha-wi commented 1 week ago

This issue is affecting Debian SID as well, I presume?

Updating 1/14…**
OSTree:ERROR:src/libostree/ostree-fetcher-curl.c:534:sock_cb: code should not be reached
Bail out! OSTree:ERROR:src/libostree/ostree-fetcher-curl.c:534:sock_cb: code should not be reached
fish: Job 1, 'flatpak update' terminated by signal SIGABRT (Abort)
phlibi commented 1 week ago

Same issue on Debian Stable (Bookworm) for the past week or so FWIW.

This should only affect Debian 12 if you are using a newer version of libcurl (upgrading core libraries like this somewhat defeats the purpose of using a stable release). It is a known issue for users of the libcurl 8.10.x in bookworm-backports. The workaround would be to revert to the libcurl 7.88.x shipped in Debian 12.

I've uploaded a fixed libostree for Debian 12, but it needs approval by the stable release managers before it will be made available in stable-proposed-updates.

I'm seeing the same issue, but worse, I can't fix it by simply downgrading curl-related packages. I actually upgraded libcurl4 to the backports release a few weeks ago due to an issue with another package, but only found out now that flatpak isn't working anymore. So I downgraded the packages again to 7.88.1, but to no avail:

$ sudo apt install curl=7.88.1-10+deb12u7 libcurl4=7.88.1-10+deb12u7 libcurl4-openssl-dev=7.88.1-10+deb12u7
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libnghttp2-dev libpsl-dev libzstd-dev
Use 'sudo apt autoremove' to remove them.
Suggested packages:
  libcurl4-doc libidn-dev libkrb5-dev libldap2-dev
The following packages will be DOWNGRADED:
  curl libcurl4 libcurl4-openssl-dev
0 upgraded, 0 newly installed, 3 downgraded, 0 to remove and 0 not upgraded.
Need to get 1’196 kB of archives.
After this operation, 245 kB disk space will be freed.
Do you want to continue? [Y/n] 
Get:1 http://deb.debian.org/debian bookworm/main amd64 libcurl4-openssl-dev amd64 7.88.1-10+deb12u7 [491 kB]
Get:2 http://deb.debian.org/debian bookworm/main amd64 libcurl4 amd64 7.88.1-10+deb12u7 [390 kB]
Get:3 http://deb.debian.org/debian bookworm/main amd64 curl amd64 7.88.1-10+deb12u7 [315 kB]
Fetched 1’196 kB in 0s (17.6 MB/s)
dpkg: warning: downgrading libcurl4-openssl-dev:amd64 from 8.10.1-1~bpo12+1 to 7.88.1-10+deb12u7
(Reading database ... 306739 files and directories currently installed.)
Preparing to unpack .../libcurl4-openssl-dev_7.88.1-10+deb12u7_amd64.deb ...
Unpacking libcurl4-openssl-dev:amd64 (7.88.1-10+deb12u7) over (8.10.1-1~bpo12+1) ...
dpkg: warning: downgrading libcurl4:amd64 from 8.10.1-1~bpo12+1 to 7.88.1-10+deb12u7
Preparing to unpack .../libcurl4_7.88.1-10+deb12u7_amd64.deb ...
Unpacking libcurl4:amd64 (7.88.1-10+deb12u7) over (8.10.1-1~bpo12+1) ...
dpkg: warning: downgrading curl from 8.10.1-1~bpo12+1 to 7.88.1-10+deb12u7
Preparing to unpack .../curl_7.88.1-10+deb12u7_amd64.deb ...
Unpacking curl (7.88.1-10+deb12u7) over (8.10.1-1~bpo12+1) ...
Setting up libcurl4:amd64 (7.88.1-10+deb12u7) ...
Setting up curl (7.88.1-10+deb12u7) ...
Setting up libcurl4-openssl-dev:amd64 (7.88.1-10+deb12u7) ...
Processing triggers for man-db (2.11.2-2) ...
Processing triggers for libc-bin (2.36-9+deb12u8) ...

$ apt search curl | grep installed
curl/stable,now 7.88.1-10+deb12u7 amd64 [installed]
libcurl4/stable,now 7.88.1-10+deb12u7 amd64 [installed]
libcurl4-openssl-dev/stable,now 7.88.1-10+deb12u7 amd64 [installed]
libhttp-cookies-perl/stable,stable,now 6.10-1 all [installed,automatic]

$ apt search ostree | grep installed
libostree-1-1/stable,now 2022.7-2 amd64 [installed,automatic]

$ flatpak update
Looking for updates…

        ID                                             Branch                Op            Remote             Download
 1. [|] org.freedesktop.Platform.GL.default            24.08                 u             flathub            < 146.7 MB
 2. [ ] org.freedesktop.Platform.GL.default            24.08extra            u             flathub            < 146.7 MB
 3. [ ] org.freedesktop.Platform.Locale                24.08                 u             flathub            < 379.7 MB (partial)
 4. [ ] org.gtk.Gtk3theme.Breeze                       3.22                  u             flathub            < 192.5 kB
 5. [ ] org.freedesktop.Platform                       24.08                 u             flathub            < 261.2 MB

Updating 1/5…**
OSTree:ERROR:src/libostree/ostree-fetcher-curl.c:526:sock_cb: code should not be reached
Bail out! OSTree:ERROR:src/libostree/ostree-fetcher-curl.c:526:sock_cb: code should not be reached
Aborted (core dumped)

Is there another package that I need to downgrade to make this work again?

smcv commented 1 week ago

Please take any Debian-specific discussion to the Debian bug for this crash, https://bugs.debian.org/1082121, to avoid creating extra noise for the upstream libostree maintainers.

I've marked some Debian-specific comments here as off-topic to keep them off upstream's radar, but I will reply to them in the Debian bug.