Skip to content

error: unexpected end-of-file when cache is not found on https://cache.nixos.org #4903

Open
@happysalada

Description

@happysalada

Describe the bug

When running a nix command sometimes, nix tries to fetch a cache, when the url is 404, the error generated is just
error: unexpected end-of-file

Steps To Reproduce

running

> nix develop -vvv
querying info about '/nix/store/4yy83b75l7v3bcww26l1b05vp54y50k4-nix-shell-env' on 'https://cache.nixos.org'...
downloading 'https://cache.nixos.org/4yy83b75l7v3bcww26l1b05vp54y50k4.narinfo'...
error: unexpected end-of-file

When I try to curl the url, it gives me a 404

I don't know why nix is looking at that path specifically, but I get that error quite often recently.

Here is my flake.lock

{
  "nodes": {
    "nixpkgs": {
      "locked": {
        "lastModified": 1623154001,
        "narHash": "sha256-KxsIXg5ez5SveGayOKcW+MnofqVuLnwZHE5mZgtRAJo=",
        "owner": "nixos",
        "repo": "nixpkgs",
        "rev": "3bc8e5cd23b84b2e149e7aaad57117da16a19e6f",
        "type": "github"
      },
      "original": {
        "owner": "nixos",
        "ref": "nixpkgs-unstable",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "root": {
      "inputs": {
        "nixpkgs": "nixpkgs"
      }
    }
  },
  "root": "root",
  "version": 7
}

here is the

❯ nix --version
nix (Nix) 2.4pre20210601_5985b8b

Expected behavior

Is there a way when the cache returns a 404 to try to build the derivation?

I'm not sure what additional information might be needed.

nix-env --version output

❯ nix-env --version
nix-env (Nix) 2.4pre20210601_5985b8b

Additional context

I have those experimental-features enabled

      experimental-features = nix-command flakes ca-derivations ca-references

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions