lix crash when running nix flake update #753

Closed
opened 2025-03-21 03:31:48 +00:00 by just1602 · 2 comments
Member

Describe the bug

I ran nix flake update on my system config, and lix crash with the following message:

Exception: nlohmann::json_abi_v3_11_3::detail::parse_error: [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - invalid literal; last read: '<U+001F>'
Stack trace:
 0# nix::getStackTrace[abi:cxx11]() in /nix/store/0z44c1bg3s7f2rw7z8b2ryvzncz3bqv3-lix-2.93.0-dev-pre20250319-2491b7c/lib/liblixutil.so
 1# 0x00007FCA933E8853 in /nix/store/0z44c1bg3s7f2rw7z8b2ryvzncz3bqv3-lix-2.93.0-dev-pre20250319-2491b7c/lib/liblixmain.so
 2# 0x00007FCA91CBF20A in /nix/store/6kbrc4ca98srlfpgyaayl2q9zpg1gys6-gcc-14-20241116-lib/lib/libstdc++.so.6
 3# std::unexpected() in /nix/store/6kbrc4ca98srlfpgyaayl2q9zpg1gys6-gcc-14-20241116-lib/lib/libstdc++.so.6
 4# 0x00007FCA91CBF1FE in /nix/store/6kbrc4ca98srlfpgyaayl2q9zpg1gys6-gcc-14-20241116-lib/lib/libstdc++.so.6
 5# void boost::outcome_v2::policy::exception_ptr_rethrow<std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, std::__exception_ptr::exception_ptr, void>::wide_value_check<boost::outcome_v2::detail::basic_result_value_observers<boost::outcome_v2::detail::basic_result_storage<std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, std::__exception_ptr::exception_ptr, boost::outcome_v2::policy::exception_ptr_rethrow<std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, std::__exception_ptr::exception_ptr, void> >, std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, boost::outcome_v2::policy::exception_ptr_rethrow<std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, std::__exception_ptr::exception_ptr, void> > >(boost::outcome_v2::detail::basic_result_value_observers<boost::outcome_v2::detail::basic_result_storage<std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, std::__exception_ptr::exception_ptr, boost::outcome_v2::policy::exception_ptr_rethrow<std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, std::__exception_ptr::exception_ptr, void> >, std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, boost::outcome_v2::policy::exception_ptr_rethrow<std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, std::__exception_ptr::exception_ptr, void> >&&) in /nix/store/0z44c1bg3s7f2rw7z8b2ryvzncz3bqv3-lix-2.93.0-dev-pre20250319-2491b7c/lib/liblixexpr.so
 6# std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef> nix::detail::runAsyncUnwrap<std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef> >(boost::outcome_v2::basic_result<std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, std::__exception_ptr::exception_ptr, std::conditional<false, boost::outcome_v2::policy::terminate, std::conditional<false, boost::outcome_v2::policy::error_code_throw_as_system_error<std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, std::__exception_ptr::exception_ptr, void>, std::conditional<true, boost::outcome_v2::policy::exception_ptr_rethrow<std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, std::__exception_ptr::exception_ptr, void>, boost::outcome_v2::policy::fail_to_compile_observers>::type>::type>::type>) in /nix/store/0z44c1bg3s7f2rw7z8b2ryvzncz3bqv3-lix-2.93.0-dev-pre20250319-2491b7c/lib/liblixexpr.so
 7# 0x00007FCA9242F8E9 in /nix/store/0z44c1bg3s7f2rw7z8b2ryvzncz3bqv3-lix-2.93.0-dev-pre20250319-2491b7c/lib/liblixexpr.so
 8# 0x00007FCA9243E2F5 in /nix/store/0z44c1bg3s7f2rw7z8b2ryvzncz3bqv3-lix-2.93.0-dev-pre20250319-2491b7c/lib/liblixexpr.so
 9# 0x00007FCA9243B9FF in /nix/store/0z44c1bg3s7f2rw7z8b2ryvzncz3bqv3-lix-2.93.0-dev-pre20250319-2491b7c/lib/liblixexpr.so
10# nix::flake::lockFlake(nix::EvalState&, nix::FlakeRef const&, nix::flake::LockFlags const&) in /nix/store/0z44c1bg3s7f2rw7z8b2ryvzncz3bqv3-lix-2.93.0-dev-pre20250319-2491b7c/lib/liblixexpr.so
11# 0x0000558F92A25581 in nix
12# nix::StoreCommand::run() in /nix/store/0z44c1bg3s7f2rw7z8b2ryvzncz3bqv3-lix-2.93.0-dev-pre20250319-2491b7c/lib/liblixcmd.so
13# 0x0000558F92A23F0A in nix
14# 0x0000558F92A61B50 in nix
15# 0x0000558F92A644DD in nix
16# nix::handleExceptions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void ()>) in /nix/store/0z44c1bg3s7f2rw7z8b2ryvzncz3bqv3-lix-2.93.0-dev-pre20250319-2491b7c/lib/liblixmain.so
17# 0x0000558F92A63F9B in nix
18# 0x00007FCA9182A1FE in /nix/store/cmpyglinc9xl9pr4ymx8akl286ygl64x-glibc-2.40-66/lib/libc.so.6
19# __libc_start_main in /nix/store/cmpyglinc9xl9pr4ymx8akl286ygl64x-glibc-2.40-66/lib/libc.so.6
20# 0x0000558F9298F6A5 in nix

fish: Job 1, 'nix flake update' terminated by signal SIGABRT (Abort)

Steps To Reproduce

I don't know if you need my flake.nix or something else I should provide here?

Expected behavior

My inputs should be updated. without crash 😄

nix --version output

❯ nix --version
nix (Lix, like Nix) 2.93.0-dev-pre20250319-2491b7c
System type: x86_64-linux
Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux, x86_64-v4-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/goldman/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/goldman/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/goldman/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/goldman/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/0z44c1bg3s7f2rw7z8b2ryvzncz3bqv3-lix-2.93.0-dev-pre20250319-2491b7c/share

EDIT: running the command a second time didn't crashed and seem to work properly.

## Describe the bug I ran `nix flake update` on my system config, and lix crash with the following message: ``` Exception: nlohmann::json_abi_v3_11_3::detail::parse_error: [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - invalid literal; last read: '<U+001F>' Stack trace: 0# nix::getStackTrace[abi:cxx11]() in /nix/store/0z44c1bg3s7f2rw7z8b2ryvzncz3bqv3-lix-2.93.0-dev-pre20250319-2491b7c/lib/liblixutil.so 1# 0x00007FCA933E8853 in /nix/store/0z44c1bg3s7f2rw7z8b2ryvzncz3bqv3-lix-2.93.0-dev-pre20250319-2491b7c/lib/liblixmain.so 2# 0x00007FCA91CBF20A in /nix/store/6kbrc4ca98srlfpgyaayl2q9zpg1gys6-gcc-14-20241116-lib/lib/libstdc++.so.6 3# std::unexpected() in /nix/store/6kbrc4ca98srlfpgyaayl2q9zpg1gys6-gcc-14-20241116-lib/lib/libstdc++.so.6 4# 0x00007FCA91CBF1FE in /nix/store/6kbrc4ca98srlfpgyaayl2q9zpg1gys6-gcc-14-20241116-lib/lib/libstdc++.so.6 5# void boost::outcome_v2::policy::exception_ptr_rethrow<std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, std::__exception_ptr::exception_ptr, void>::wide_value_check<boost::outcome_v2::detail::basic_result_value_observers<boost::outcome_v2::detail::basic_result_storage<std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, std::__exception_ptr::exception_ptr, boost::outcome_v2::policy::exception_ptr_rethrow<std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, std::__exception_ptr::exception_ptr, void> >, std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, boost::outcome_v2::policy::exception_ptr_rethrow<std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, std::__exception_ptr::exception_ptr, void> > >(boost::outcome_v2::detail::basic_result_value_observers<boost::outcome_v2::detail::basic_result_storage<std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, std::__exception_ptr::exception_ptr, boost::outcome_v2::policy::exception_ptr_rethrow<std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, std::__exception_ptr::exception_ptr, void> >, std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, boost::outcome_v2::policy::exception_ptr_rethrow<std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, std::__exception_ptr::exception_ptr, void> >&&) in /nix/store/0z44c1bg3s7f2rw7z8b2ryvzncz3bqv3-lix-2.93.0-dev-pre20250319-2491b7c/lib/liblixexpr.so 6# std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef> nix::detail::runAsyncUnwrap<std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef> >(boost::outcome_v2::basic_result<std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, std::__exception_ptr::exception_ptr, std::conditional<false, boost::outcome_v2::policy::terminate, std::conditional<false, boost::outcome_v2::policy::error_code_throw_as_system_error<std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, std::__exception_ptr::exception_ptr, void>, std::conditional<true, boost::outcome_v2::policy::exception_ptr_rethrow<std::tuple<nix::fetchers::Tree, nix::FlakeRef, nix::FlakeRef>, std::__exception_ptr::exception_ptr, void>, boost::outcome_v2::policy::fail_to_compile_observers>::type>::type>::type>) in /nix/store/0z44c1bg3s7f2rw7z8b2ryvzncz3bqv3-lix-2.93.0-dev-pre20250319-2491b7c/lib/liblixexpr.so 7# 0x00007FCA9242F8E9 in /nix/store/0z44c1bg3s7f2rw7z8b2ryvzncz3bqv3-lix-2.93.0-dev-pre20250319-2491b7c/lib/liblixexpr.so 8# 0x00007FCA9243E2F5 in /nix/store/0z44c1bg3s7f2rw7z8b2ryvzncz3bqv3-lix-2.93.0-dev-pre20250319-2491b7c/lib/liblixexpr.so 9# 0x00007FCA9243B9FF in /nix/store/0z44c1bg3s7f2rw7z8b2ryvzncz3bqv3-lix-2.93.0-dev-pre20250319-2491b7c/lib/liblixexpr.so 10# nix::flake::lockFlake(nix::EvalState&, nix::FlakeRef const&, nix::flake::LockFlags const&) in /nix/store/0z44c1bg3s7f2rw7z8b2ryvzncz3bqv3-lix-2.93.0-dev-pre20250319-2491b7c/lib/liblixexpr.so 11# 0x0000558F92A25581 in nix 12# nix::StoreCommand::run() in /nix/store/0z44c1bg3s7f2rw7z8b2ryvzncz3bqv3-lix-2.93.0-dev-pre20250319-2491b7c/lib/liblixcmd.so 13# 0x0000558F92A23F0A in nix 14# 0x0000558F92A61B50 in nix 15# 0x0000558F92A644DD in nix 16# nix::handleExceptions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void ()>) in /nix/store/0z44c1bg3s7f2rw7z8b2ryvzncz3bqv3-lix-2.93.0-dev-pre20250319-2491b7c/lib/liblixmain.so 17# 0x0000558F92A63F9B in nix 18# 0x00007FCA9182A1FE in /nix/store/cmpyglinc9xl9pr4ymx8akl286ygl64x-glibc-2.40-66/lib/libc.so.6 19# __libc_start_main in /nix/store/cmpyglinc9xl9pr4ymx8akl286ygl64x-glibc-2.40-66/lib/libc.so.6 20# 0x0000558F9298F6A5 in nix fish: Job 1, 'nix flake update' terminated by signal SIGABRT (Abort) ``` ## Steps To Reproduce I don't know if you need my flake.nix or something else I should provide here? ## Expected behavior My inputs should be updated. without crash 😄 ## `nix --version` output ``` ❯ nix --version nix (Lix, like Nix) 2.93.0-dev-pre20250319-2491b7c System type: x86_64-linux Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux, x86_64-v4-linux Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /home/goldman/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/goldman/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/goldman/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/goldman/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/0z44c1bg3s7f2rw7z8b2ryvzncz3bqv3-lix-2.93.0-dev-pre20250319-2491b7c/share ``` --- EDIT: running the command a second time didn't crashed and seem to work properly.
Owner

guessing it's somewhere in some fetcher, if the api returns bogus json the error isn't properly caught. anyway. tagging this flakes + error handling.

guessing it's somewhere in some fetcher, if the api returns bogus json the error isn't properly caught. anyway. tagging this flakes + error handling.
jade added this to the Error reporting project 2025-03-21 04:03:37 +00:00
Member

This issue was mentioned on Gerrit on the following CLs:

  • commit message in cl/2907 ("treewide: handle JSON parse errors")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/2907", "number": 2907, "kind": "commit message"}], "cl_meta": {"2907": {"change_title": "treewide: handle JSON parse errors"}}} --> This issue was mentioned on Gerrit on the following CLs: * commit message in [cl/2907](https://gerrit.lix.systems/c/lix/+/2907) ("treewide: handle JSON parse errors")
Sign in to join this conversation.
No milestone
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#753
No description provided.