Invalid Lock File Crashes Lix #743

Closed
opened 2025-03-17 17:34:51 +00:00 by blitz · 1 comment

Describe the bug

I have a flake with conflict markers in it. When I execute nix -L flake update nixpkgs --commit-lock-file I get:

Lix crashed. This is a bug. We would appreciate if you report it along with what caused it at https://git.lix.systems/lix-project/lix/issues with the following information included:

Exception: nlohmann::json_abi_v3_11_3::detail::parse_error: [json.exception.parse_error.101] parse error at line 572, column 1: syntax error while parsing object key - invalid literal; last read: '"locked": {<U+000A><'; expected string literal
Stack trace:
 0# nix::printStackTrace() in /nix/store/vyfqgaip2hbylhhm1lci1zfvxv6a5g28-lix-2.92.0/lib/liblixutil.so
 1# 0x00007F1505910766 in /nix/store/vyfqgaip2hbylhhm1lci1zfvxv6a5g28-lix-2.92.0/lib/liblixmain.so
 2# 0x00007F15046BC20A in /nix/store/mhd0rk497xm0xnip7262xdw9bylvzh99-gcc-13.3.0-lib/lib/libstdc++.so.6
 3# 0x00007F15046BC275 in /nix/store/mhd0rk497xm0xnip7262xdw9bylvzh99-gcc-13.3.0-lib/lib/libstdc++.so.6
 4# nix::handleExceptions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void ()>) in /nix/store/vyfqgaip2hbylhhm1lci1zfvxv6a5g28-lix-2.92.0/lib/liblixmain.so
 5# 0x000055C15FC9929B in nix
 6# 0x00007F150443227E in /nix/store/maxa3xhmxggrc5v2vc0c3pjb79hjlkp9-glibc-2.40-66/lib/libc.so.6
 7# __libc_start_main in /nix/store/maxa3xhmxggrc5v2vc0c3pjb79hjlkp9-glibc-2.40-66/lib/libc.so.6
 8# 0x000055C15FBEDD15 in nix

[1]    1089672 IOT instruction (core dumped)  nix -L flake update nixpkgs --commit-lock-file

Steps To Reproduce

  1. Enter the directory (see attached file)
  2. nix -L flake update nixpkgs --commit-lock-file

Expected behavior

Lix shows an actionable error message instead of crashing with a backtrace.

A clear and concise description of what you expected to happen.

nix --version output

nix (Lix, like Nix) 2.92.0
System type: x86_64-linux
Additional system types: aarch64-linux, i686-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/julian/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/julian/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/julian/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/julian/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf:/nix/store/ys1zqxjyiczkny9bfi1f7i6clm1z39cd-gnome-settings-daemon-47.2/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/vyfqgaip2hbylhhm1lci1zfvxv6a5g28-lix-2.92.0/share
## Describe the bug I have a flake with conflict markers in it. When I execute `nix -L flake update nixpkgs --commit-lock-file` I get: ``` Lix crashed. This is a bug. We would appreciate if you report it along with what caused it at https://git.lix.systems/lix-project/lix/issues with the following information included: Exception: nlohmann::json_abi_v3_11_3::detail::parse_error: [json.exception.parse_error.101] parse error at line 572, column 1: syntax error while parsing object key - invalid literal; last read: '"locked": {<U+000A><'; expected string literal Stack trace: 0# nix::printStackTrace() in /nix/store/vyfqgaip2hbylhhm1lci1zfvxv6a5g28-lix-2.92.0/lib/liblixutil.so 1# 0x00007F1505910766 in /nix/store/vyfqgaip2hbylhhm1lci1zfvxv6a5g28-lix-2.92.0/lib/liblixmain.so 2# 0x00007F15046BC20A in /nix/store/mhd0rk497xm0xnip7262xdw9bylvzh99-gcc-13.3.0-lib/lib/libstdc++.so.6 3# 0x00007F15046BC275 in /nix/store/mhd0rk497xm0xnip7262xdw9bylvzh99-gcc-13.3.0-lib/lib/libstdc++.so.6 4# nix::handleExceptions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void ()>) in /nix/store/vyfqgaip2hbylhhm1lci1zfvxv6a5g28-lix-2.92.0/lib/liblixmain.so 5# 0x000055C15FC9929B in nix 6# 0x00007F150443227E in /nix/store/maxa3xhmxggrc5v2vc0c3pjb79hjlkp9-glibc-2.40-66/lib/libc.so.6 7# __libc_start_main in /nix/store/maxa3xhmxggrc5v2vc0c3pjb79hjlkp9-glibc-2.40-66/lib/libc.so.6 8# 0x000055C15FBEDD15 in nix [1] 1089672 IOT instruction (core dumped) nix -L flake update nixpkgs --commit-lock-file ``` ## Steps To Reproduce 1. Enter the directory (see attached file) 2. `nix -L flake update nixpkgs --commit-lock-file` ## Expected behavior Lix shows an actionable error message instead of crashing with a backtrace. A clear and concise description of what you expected to happen. ## `nix --version` output ``` nix (Lix, like Nix) 2.92.0 System type: x86_64-linux Additional system types: aarch64-linux, i686-linux Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /home/julian/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/julian/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/julian/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/julian/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf:/nix/store/ys1zqxjyiczkny9bfi1f7i6clm1z39cd-gnome-settings-daemon-47.2/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/vyfqgaip2hbylhhm1lci1zfvxv6a5g28-lix-2.92.0/share ```
Owner

that's a known bug, see #559. the next release of 2.92 should include a fix :)

that's a known bug, see #559. the next release of 2.92 should include a fix :)
Sign in to join this conversation.
No milestone
No project
No assignees
2 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#743
No description provided.