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

Make issues with trusted keys have clearer error messages #8479

Closed
yavko opened this issue Jun 8, 2023 · 8 comments · Fixed by #8766
Closed

Make issues with trusted keys have clearer error messages #8479

yavko opened this issue Jun 8, 2023 · 8 comments · Fixed by #8766
Labels

Comments

@yavko
Copy link

yavko commented Jun 8, 2023

Describe the bug

Whenever I run a nix command, (ex. nix run, nix profile, nixos-rebuild) it will fail like so

nix profile remove 0 2>&1 | wl-copy
removing 'github:nix-community/comma#packages.x86_64-linux.default'
removed 1 packages, kept 1 packages
error: invalid character in Base64 string: ''

with no extra info, just fails

Steps To Reproduce

  1. Run a nix command that it happens with
  2. See error

Expected behavior

nix command executes sucessfully

nix-env --version output

nix-env (Nix) 2.15.0

Additional context

I'm running NixOS

Priorities

Add 👍 to issues you find important.

@yavko yavko added the bug label Jun 8, 2023
@abathur
Copy link
Member

abathur commented Jun 9, 2023

Increasing the verbosity might help identify the culprit; can you try invoking with -vvvvv?

@yavko
Copy link
Author

yavko commented Jun 9, 2023

Increasing the verbosity might help identify the culprit; can you try invoking with -vvvvv?

Nope already tried that

@yavko
Copy link
Author

yavko commented Jun 9, 2023

Not being able to rebuild my system is really annoying, anyway here is an example of an erroring cmd with 9 -vs
nix run nixpkgs#neofetch -v -v -v -v -v -v -v -v -v 2>&1 | wl-copy:

looked up 'flake:nixpkgs' -> 'path:/nix/store/12b8sml63980nacpjvh0rlf0w5fg7g8l-source?lastModified=1684049129&narHash=sha256-7WB9LpnPNAS8oI7hMoHeKLNhRX7k3CI9uWBRSfmOCCE%3D&rev=0470f36b02ef01d4f43c641bbf07020bcab71bf1'
using substituted/cached input 'path:/nix/store/12b8sml63980nacpjvh0rlf0w5fg7g8l-source?lastModified=1684049129&narHash=sha256-7WB9LpnPNAS8oI7hMoHeKLNhRX7k3CI9uWBRSfmOCCE%3D&rev=0470f36b02ef01d4f43c641bbf07020bcab71bf1' in '/nix/store/12b8sml63980nacpjvh0rlf0w5fg7g8l-source'
got tree '/nix/store/12b8sml63980nacpjvh0rlf0w5fg7g8l-source' from 'path:/nix/store/12b8sml63980nacpjvh0rlf0w5fg7g8l-source?lastModified=1684049129&narHash=sha256-7WB9LpnPNAS8oI7hMoHeKLNhRX7k3CI9uWBRSfmOCCE%3D&rev=0470f36b02ef01d4f43c641bbf07020bcab71bf1'
checking access to '/nix/store/12b8sml63980nacpjvh0rlf0w5fg7g8l-source/flake.nix'
evaluating file '/nix/store/12b8sml63980nacpjvh0rlf0w5fg7g8l-source/flake.nix'
old lock file: {
  "nodes": {
    "root": {}
  },
  "root": "root",
  "version": 7
}
computing lock file node ''
new lock file: {
  "nodes": {
    "root": {}
  },
  "root": "root",
  "version": 7
}
trying flake output attribute 'apps.x86_64-linux.neofetch'
using cached attrset attribute ''
trying flake output attribute 'packages.x86_64-linux.neofetch'
using cached attrset attribute ''
trying flake output attribute 'legacyPackages.x86_64-linux.neofetch'
trying flake output attribute 'neofetch'
using cached attrset attribute ''
using cached string attribute 'legacyPackages.x86_64-linux.neofetch.type'
using cached string attribute 'legacyPackages.x86_64-linux.neofetch.drvPath'
using cached string attribute 'legacyPackages.x86_64-linux.neofetch.outPath'
using cached string attribute 'legacyPackages.x86_64-linux.neofetch.outputName'
using cached string attribute 'legacyPackages.x86_64-linux.neofetch.name'
using cached string attribute 'legacyPackages.x86_64-linux.neofetch.meta.mainProgram'
querying info about missing paths...
starting pool of 3 threads
checking substituter 'https://cache.ngi0.nixos.org' for path '/nix/store/h3b58mc7b1d4sy073gz8rmbdv3xvchdq-neofetch-unstable-2021-12-10'
checking substituter 'https://cache.privatevoid.net' for path '/nix/store/h3b58mc7b1d4sy073gz8rmbdv3xvchdq-neofetch-unstable-2021-12-10'
checking substituter 'https://cache.nixos.org' for path '/nix/store/h3b58mc7b1d4sy073gz8rmbdv3xvchdq-neofetch-unstable-2021-12-10'
checking substituter 'https://cache.ngi0.nixos.org' for path '/nix/store/h3b58mc7b1d4sy073gz8rmbdv3xvchdq-neofetch-unstable-2021-12-10'
checking substituter 'https://cache.privatevoid.net' for path '/nix/store/h3b58mc7b1d4sy073gz8rmbdv3xvchdq-neofetch-unstable-2021-12-10'
checking substituter 'https://cache.nixos.org' for path '/nix/store/h3b58mc7b1d4sy073gz8rmbdv3xvchdq-neofetch-unstable-2021-12-10'
checking substituter 'https://cache.ngi0.nixos.org' for path '/nix/store/iqixndzb3161p6c21xzbm0lng5lxia9p-python3.10-ueberzug-18.1.9'
checking substituter 'https://cache.privatevoid.net' for path '/nix/store/iqixndzb3161p6c21xzbm0lng5lxia9p-python3.10-ueberzug-18.1.9'
checking substituter 'https://cache.nixos.org' for path '/nix/store/iqixndzb3161p6c21xzbm0lng5lxia9p-python3.10-ueberzug-18.1.9'
checking substituter 'https://cache.ngi0.nixos.org' for path '/nix/store/z67mf580w9j9spbbg4z16sv4j7v6gb8a-python3.10-docopt-0.6.2'
checking substituter 'https://cache.ngi0.nixos.org' for path '/nix/store/zp4bgng87x2b1nypddzq6ci1p8dwj3yl-python3.10-xlib-0.33'
checking substituter 'https://cache.privatevoid.net' for path '/nix/store/z67mf580w9j9spbbg4z16sv4j7v6gb8a-python3.10-docopt-0.6.2'
checking substituter 'https://cache.privatevoid.net' for path '/nix/store/zp4bgng87x2b1nypddzq6ci1p8dwj3yl-python3.10-xlib-0.33'
checking substituter 'https://cache.nixos.org' for path '/nix/store/zp4bgng87x2b1nypddzq6ci1p8dwj3yl-python3.10-xlib-0.33'
checking substituter 'https://cache.nixos.org' for path '/nix/store/z67mf580w9j9spbbg4z16sv4j7v6gb8a-python3.10-docopt-0.6.2'
reaping 3 worker threads
these 4 paths will be fetched (0.36 MiB download, 1.80 MiB unpacked):
  /nix/store/h3b58mc7b1d4sy073gz8rmbdv3xvchdq-neofetch-unstable-2021-12-10
  /nix/store/z67mf580w9j9spbbg4z16sv4j7v6gb8a-python3.10-docopt-0.6.2
  /nix/store/iqixndzb3161p6c21xzbm0lng5lxia9p-python3.10-ueberzug-18.1.9
  /nix/store/zp4bgng87x2b1nypddzq6ci1p8dwj3yl-python3.10-xlib-0.33
building of '/nix/store/nc0sc8qg2cialm73bkch2g2lzl8k3fln-neofetch-unstable-2021-12-10.drv!out' from .drv file: created
building of '/nix/store/nc0sc8qg2cialm73bkch2g2lzl8k3fln-neofetch-unstable-2021-12-10.drv!out' from .drv file: woken up
querying info about missing paths...
starting pool of 3 threads
checking substituter 'https://cache.ngi0.nixos.org' for path '/nix/store/h3b58mc7b1d4sy073gz8rmbdv3xvchdq-neofetch-unstable-2021-12-10'
checking substituter 'https://cache.privatevoid.net' for path '/nix/store/h3b58mc7b1d4sy073gz8rmbdv3xvchdq-neofetch-unstable-2021-12-10'
checking substituter 'https://cache.nixos.org' for path '/nix/store/h3b58mc7b1d4sy073gz8rmbdv3xvchdq-neofetch-unstable-2021-12-10'
checking substituter 'https://cache.ngi0.nixos.org' for path '/nix/store/h3b58mc7b1d4sy073gz8rmbdv3xvchdq-neofetch-unstable-2021-12-10'
checking substituter 'https://cache.privatevoid.net' for path '/nix/store/h3b58mc7b1d4sy073gz8rmbdv3xvchdq-neofetch-unstable-2021-12-10'
checking substituter 'https://cache.nixos.org' for path '/nix/store/h3b58mc7b1d4sy073gz8rmbdv3xvchdq-neofetch-unstable-2021-12-10'
checking substituter 'https://cache.ngi0.nixos.org' for path '/nix/store/iqixndzb3161p6c21xzbm0lng5lxia9p-python3.10-ueberzug-18.1.9'
checking substituter 'https://cache.privatevoid.net' for path '/nix/store/iqixndzb3161p6c21xzbm0lng5lxia9p-python3.10-ueberzug-18.1.9'
checking substituter 'https://cache.nixos.org' for path '/nix/store/iqixndzb3161p6c21xzbm0lng5lxia9p-python3.10-ueberzug-18.1.9'
checking substituter 'https://cache.ngi0.nixos.org' for path '/nix/store/z67mf580w9j9spbbg4z16sv4j7v6gb8a-python3.10-docopt-0.6.2'
checking substituter 'https://cache.ngi0.nixos.org' for path '/nix/store/zp4bgng87x2b1nypddzq6ci1p8dwj3yl-python3.10-xlib-0.33'
checking substituter 'https://cache.privatevoid.net' for path '/nix/store/z67mf580w9j9spbbg4z16sv4j7v6gb8a-python3.10-docopt-0.6.2'
checking substituter 'https://cache.privatevoid.net' for path '/nix/store/zp4bgng87x2b1nypddzq6ci1p8dwj3yl-python3.10-xlib-0.33'
checking substituter 'https://cache.nixos.org' for path '/nix/store/z67mf580w9j9spbbg4z16sv4j7v6gb8a-python3.10-docopt-0.6.2'
checking substituter 'https://cache.nixos.org' for path '/nix/store/zp4bgng87x2b1nypddzq6ci1p8dwj3yl-python3.10-xlib-0.33'
reaping 3 worker threads
entered goal loop
building of '/nix/store/nc0sc8qg2cialm73bkch2g2lzl8k3fln-neofetch-unstable-2021-12-10.drv!out' from .drv file: init
building of '/nix/store/nc0sc8qg2cialm73bkch2g2lzl8k3fln-neofetch-unstable-2021-12-10.drv!out' from .drv file: loading derivation
acquiring write lock on '/nix/var/nix/temproots/383416'
building of '/nix/store/nc0sc8qg2cialm73bkch2g2lzl8k3fln-neofetch-unstable-2021-12-10.drv!out' from .drv file: have derivation
substitution of '/nix/store/h3b58mc7b1d4sy073gz8rmbdv3xvchdq-neofetch-unstable-2021-12-10': created
substitution of '/nix/store/h3b58mc7b1d4sy073gz8rmbdv3xvchdq-neofetch-unstable-2021-12-10': woken up
substitution of '/nix/store/h3b58mc7b1d4sy073gz8rmbdv3xvchdq-neofetch-unstable-2021-12-10': init
substitution of '/nix/store/h3b58mc7b1d4sy073gz8rmbdv3xvchdq-neofetch-unstable-2021-12-10': trying next substituter
substitution of '/nix/store/h3b58mc7b1d4sy073gz8rmbdv3xvchdq-neofetch-unstable-2021-12-10': trying next substituter
substitution of '/nix/store/h3b58mc7b1d4sy073gz8rmbdv3xvchdq-neofetch-unstable-2021-12-10': trying next substituter
building of '/nix/store/nc0sc8qg2cialm73bkch2g2lzl8k3fln-neofetch-unstable-2021-12-10.drv!out' from .drv file: goal destroyed
substitution of '/nix/store/h3b58mc7b1d4sy073gz8rmbdv3xvchdq-neofetch-unstable-2021-12-10': goal destroyed
error: invalid character in Base64 string: ''

@gruhn
Copy link

gruhn commented Jul 10, 2023

Had the same issue. Completely uninstalling and reinstalling Nix worked for me.

@yavko
Copy link
Author

yavko commented Jul 10, 2023

Had the same issue. Completely uninstalling and reinstalling Nix worked for me.

Oof, well I recently found the fix. It happened to be a impropperly formatted trusted key. I think the error needs to be made clearer

@yavko yavko changed the title Almost every nix command fails with invalid character in Base64 string Make issues with trusted keys have clearer error messages Jul 10, 2023
brianmcgee added a commit to brianmcgee/nix that referenced this issue Jul 31, 2023
…cted

Output the offending string in its entirety to provide context.

Closes NixOS#8479
@brianmcgee
Copy link
Contributor

brianmcgee commented Jul 31, 2023

I got burned by this on Friday and spent a couple of hours trying to read the tea leaves. In the end, patching nix was the only way to determine I had a copy-paste error in one of the public keys for a binary cache.

brianmcgee added a commit to brianmcgee/nix that referenced this issue Aug 1, 2023
…cted

Output the offending string in its entirety to provide context.

Closes NixOS#8479
@ParetoOptimalDev
Copy link

ParetoOptimalDev commented Aug 29, 2023

Somewhat related and might imply there are other causes of this:

I even get the error building your fork (while trying to debug my own instance of this) using:

/tmp/nix $ nix build --option substituters "https://cache.nixos.org"
error: invalid character in Base64 string: '

I can build it with no substitutions using this though it looks like:

/tmp/nix $ nix build --option substituters '[]'
warning: don't know how to open Nix store '[]'
[1/0/598 built] building gettext-0.21 (configurePhase): checkin

@ParetoOptimalDev
Copy link

Nevermind, I was inspecting /etc/nix/nix.conf but I also had a ~/.config/nix/nix.conf and the later was the one causing issues.

mergify bot pushed a commit that referenced this issue Sep 17, 2024
…cted

Output the offending string in its entirety to provide context.

Closes #8479

(cherry picked from commit dc3ccf0)
mergify bot pushed a commit that referenced this issue Sep 17, 2024
…cted

Output the offending string in its entirety to provide context.

Closes #8479

(cherry picked from commit dc3ccf0)
mergify bot pushed a commit that referenced this issue Sep 17, 2024
…cted

Output the offending string in its entirety to provide context.

Closes #8479

(cherry picked from commit dc3ccf0)
mergify bot pushed a commit that referenced this issue Sep 17, 2024
…cted

Output the offending string in its entirety to provide context.

Closes #8479

(cherry picked from commit dc3ccf0)
mergify bot pushed a commit that referenced this issue Sep 17, 2024
…cted

Output the offending string in its entirety to provide context.

Closes #8479

(cherry picked from commit dc3ccf0)
mergify bot pushed a commit that referenced this issue Sep 17, 2024
…cted

Output the offending string in its entirety to provide context.

Closes #8479

(cherry picked from commit dc3ccf0)
mergify bot pushed a commit that referenced this issue Sep 17, 2024
…cted

Output the offending string in its entirety to provide context.

Closes #8479

(cherry picked from commit dc3ccf0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants