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

Getting error: attribute 'unsafeDiscardStringContext' missing while full update on Linux #4704

Closed
x80486 opened this issue Apr 10, 2021 · 8 comments
Labels

Comments

@x80486
Copy link

x80486 commented Apr 10, 2021

Describe the bug

I usually do nix-channel --update and nix-env --prebuilt-only --upgrade to upgrade Nix and the installed dependencies. I started getting this error around 4/5 days ago:

unpacking channels...
warning: don't know how to open Nix store 'https://cache.nixos.org/'
created 1 symlinks in user environment
error: attribute 'unsafeDiscardStringContext' missing, at /nix/store/ff8fzv31yydp2qkbvqykjm15zkfs8f3n-nixpkgs-21.05pre281594.6fc2b7ecc2a/nixpkgs/lib/strings.nix:429:13
(use '--show-trace' to show detailed location information)

Steps To Reproduce

  1. Install Nix under Arch Linux
  2. Update

Expected behavior

To be able to update without error(s).

nix-env --version output

[x80486@uplink:~]$ nix-env --version 
nix-env (Nix) 2.3.10
[x80486@uplink:~]$ uname -a 
Linux uplink 5.10.27-1-lts #1 SMP Tue, 30 Mar 2021 13:22:29 +0000 x86_64 GNU/Linux
@x80486 x80486 added the bug label Apr 10, 2021
@shyim
Copy link
Member

shyim commented Apr 10, 2021

Ran into now also 😅

Also nix-env (Nix) 2.3.10
But running Nix inside an Debian docker container

// Edit:

Run now again curl -L https://nixos.org/nix/install | sh and stayed on stable channel

@b0o
Copy link

b0o commented Apr 11, 2021

nix-env --upgrade has been failing with this error for me as well these past few days.

$ nix-env --upgrade --show-trace
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixpkgs' does not exist, ignoring
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
error: while evaluating anonymous function at /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/pkgs/top-level/impure.nix:15:1, called from /nix/store/0rl36g1wxzf89866h2ic1rwjlc0m8vc9-home-manager/home-manager/default.nix:1:10:
while evaluating anonymous function at /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/pkgs/top-level/default.nix:19:1, called from /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/pkgs/top-level/impure.nix:83:1:
while evaluating anonymous function at /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/pkgs/stdenv/booter.nix:42:1, called from /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/pkgs/top-level/default.nix:122:10:
while evaluating 'dfold' at /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/pkgs/stdenv/booter.nix:60:27, called from /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/pkgs/stdenv/booter.nix:136:4:
while evaluating 'go' at /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/pkgs/stdenv/booter.nix:63:18, called from /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/pkgs/stdenv/booter.nix:72:13:
while evaluating 'imap1' at /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/lib/lists.nix:116:14, called from /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/pkgs/stdenv/booter.nix:78:30:
while evaluating 'reverseList' at /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/lib/lists.nix:393:17, called from /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/pkgs/stdenv/booter.nix:85:6:
while evaluating anonymous function at /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/pkgs/stdenv/default.nix:7:1, called from /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/pkgs/top-level/default.nix:118:12:
while evaluating 'elaborate' at /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/lib/systems/default.nix:18:15, called from /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/pkgs/top-level/default.nix:52:17:
while evaluating 'foldl' at /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/lib/lists.nix:80:20, called from /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/lib/systems/default.nix:149:13:
while evaluating 'foldl'' at /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/lib/lists.nix:82:16, called from /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/lib/lists.nix:86:8:
while evaluating the attribute 'parsed.abi.assertions' at /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/lib/systems/default.nix:23:7:
while evaluating 'mkSystemFromString' at /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/lib/systems/parse.nix:462:24, called from /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/lib/systems/default.nix:23:16:
while evaluating 'mkSkeletonFromList' at /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/lib/systems/parse.nix:382:24, called from /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/lib/systems/parse.nix:462:49:
while evaluating 'splitString' at /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/lib/strings.nix:427:23, called from /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/lib/systems/parse.nix:462:69:
attribute 'unsafeDiscardStringContext' missing, at /nix/store/jpb8f98zm13bcwwycpbr8vclxrdd0l2b-nixpkgs-21.05pre281670.842f900e73c/nixpkgs/lib/strings.nix:429:13

$ nix-env --version
nix-env (Nix) 2.3.10

$ uname -srmov
Linux 5.11.12-1-ck-zen #1 SMP PREEMPT Thu, 08 Apr 2021 11:25:39 +0000 x86_64 GNU/Linux

$ lsb_release -idr
Distributor ID:	Arch
Description:	Arch Linux
Release:	rolling

@leon-barrett
Copy link

I believe this is caused by NixOS/nixpkgs#118481 , where nix is being replaced by an "upgrade" to a broken statically-linked nix. While the bug is already closed, the PR hasn't yet rolled out to nixpkgs-unstable. https://nixpk.gs/pr-tracker.html?pr=119317

@adworacz
Copy link

So, once this bug is fixed, how to we update to the latest version if the update mechanism is broken? Or perhaps I'm misunderstanding the ramifications of this issue.

@arsfeld
Copy link

arsfeld commented Apr 14, 2021

@adworacz you can rollback with nix-env --rollback, you might have to go a few versions back (at least I had to).

@adworacz
Copy link

Excellent, @arsfeld, that's exactly what I needed.

@domenkozar
Copy link
Member

If you update nixpkgs-unstable this should be fixed now.

@adworacz
Copy link

Confirmed - this is working just fine for me after upgrading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants