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

nix-shell -p: unsafeDiscardStringContext missing error #119739

Closed
fkarg opened this issue Apr 17, 2021 · 3 comments
Closed

nix-shell -p: unsafeDiscardStringContext missing error #119739

fkarg opened this issue Apr 17, 2021 · 3 comments

Comments

@fkarg
Copy link

fkarg commented Apr 17, 2021

Describe the bug
Whatever I'm trying to do right now (with nix-shell -p or nix-env -iA), I encounter the following error:

error: attribute 'unsafeDiscardStringContext' missing, at /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/lib/strings.nix:429:13
(use '--show-trace' to show detailed location information)

To Reproduce
Honestly, no idea. But I now have it when using nix on my laptop (NixOS) as well as on my other laptop (Ubuntu with nix). So ... I don't think this is isolated.

I was experimenting with a number of things on my NixOS at first, so I thought it was because I was doing something wrong - but the same error without experimenting with only nix installed? Something weird is going on.

Expected behavior
No Error Message when using nix-shell -p or other stuff.

Additional Context

I tried nix-channel --update to no avail.
nix-env -iA nixpkgs.XXX throws the same error.

Installing packages with the path provided from NixDB works (?), if I wouldn't interrupt it after downloading dozens of GB in two hours (and no, it should not have done this for that package).

Metadata

$ nix-shell -p nix-info --run "nix-info -m" --show-trace
error: while evaluating anonymous function at /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/pkgs/top-level/impure.nix:15:1, called from (string):1:6:
while evaluating anonymous function at /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/pkgs/top-level/default.nix:19:1, called from /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/pkgs/top-level/impure.nix:83:1:
while evaluating anonymous function at /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/pkgs/stdenv/booter.nix:42:1, called from /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/pkgs/top-level/default.nix:122:10:
while evaluating 'dfold' at /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/pkgs/stdenv/booter.nix:60:27, called from /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/pkgs/stdenv/booter.nix:136:4:
while evaluating 'go' at /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/pkgs/stdenv/booter.nix:63:18, called from /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/pkgs/stdenv/booter.nix:72:13:
while evaluating 'imap1' at /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/lib/lists.nix:116:14, called from /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/pkgs/stdenv/booter.nix:78:30:
while evaluating 'reverseList' at /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/lib/lists.nix:393:17, called from /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/pkgs/stdenv/booter.nix:85:6:
while evaluating anonymous function at /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/pkgs/stdenv/default.nix:7:1, called from /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/pkgs/top-level/default.nix:118:12:
while evaluating 'elaborate' at /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/lib/systems/default.nix:18:15, called from /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/pkgs/top-level/default.nix:52:17:
while evaluating 'foldl' at /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/lib/lists.nix:80:20, called from /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/lib/systems/default.nix:149:13:
while evaluating 'foldl'' at /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/lib/lists.nix:82:16, called from /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/lib/lists.nix:86:8:
while evaluating the attribute 'parsed.abi.assertions' at /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/lib/systems/default.nix:23:7:
while evaluating 'mkSystemFromString' at /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/lib/systems/parse.nix:453:24, called from /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/lib/systems/default.nix:23:16:
while evaluating 'mkSkeletonFromList' at /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/lib/systems/parse.nix:374:24, called from /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/lib/systems/parse.nix:453:49:
while evaluating 'splitString' at /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/lib/strings.nix:427:23, called from /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/lib/systems/parse.nix:453:69:
attribute 'unsafeDiscardStringContext' missing, at /nix/store/ncj4504zgiabs2dm7ya60k83cpc59vlz-nixpkgs-21.05pre282987.294d1925af6/nixpkgs/lib/strings.nix:429:13

Well. I'll happily provide any other information.

@fkarg fkarg changed the title nix-shell -p: UnsafeDiscardStringContext missing error nix-shell -p: unsafeDiscardStringContext missing error Apr 17, 2021
@SFrijters
Copy link
Member

This looks like it might be (related to) #118481 ?

@sternenseemann
Copy link
Member

Usually this happens when the running nix-daemon and the nix-shell you are running go out of sync in a significant way. This is often triggered by a nix-env -u which hits the mentioned issue. A rollback of your environment should resolve this issue.

What does readlink $(type -p nix-shell) print? Have you tried restarting your nix-daemon?

@fkarg
Copy link
Author

fkarg commented Apr 30, 2021

Thanks for the help! The in #118481 mentioned nix-env --rollback and restarting nix-daemon somehow did the trick, and everything is working properly now.

@fkarg fkarg closed this as completed Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants