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

Observing a "does not appear to be a binary cache" problem with Nix 2.10 #418

Closed
Technius opened this issue Jul 12, 2022 · 12 comments
Closed

Comments

@Technius
Copy link

Technius commented Jul 12, 2022

I work on a project that uses cachix-action and a private binary cache for CI, and it has been working really well. Today, I observed some problems where the cache was not being picked up, specifically the "warning: XXX does not appear to be a binary cache" message. After some debugging, I noticed that install-nix-action was installing Nix 2.10 -- which was really unexpected because I didn't know it came out today just a few hours ago! The problem went away after the nix version was pinned to 2.9.2.

I'm not sure whether this is a problem with Nix, cachix, or cachix-action, so I'd be happy to post this issue in a more appropriate place.

For reference, here is a version of the workflow file modified to remove any sensitive information:

name: My workflow
on:
  push:
    branches: [ main ]

jobs:
  build-expensive-dependency:
    runs-on: ubuntu-latest
    timeout-minutes: 300
    steps:
      - uses: actions/checkout@v2.4.0
      - uses: cachix/install-nix-action@v17
        # the following two lines are used to workaround the problem
        with:
          install_url: https://releases.nixos.org/nix/nix-2.9.2/install
      - uses: cachix/cachix-action@v10
        with:
          name: my-private-cache-name
          authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
      - name: "Build and cache a dependency that is expensive to build"
        run: |
          nix build --print-build-logs .#my-expensive-dependency
@lorenzo
Copy link

lorenzo commented Jul 12, 2022

We experienced the same issue after upgrading to nix 2.10.0

@jerbaroo
Copy link

jerbaroo commented Jul 12, 2022

Builds suddenly started taking hours for us, starting yesterday, I also see this message in GitHub Action logs:

warning: 'https://****.cachix.org/' does not appear to be a binary cache

Here's a snippet of our workflow file:

    steps:
    - uses: actions/checkout@v2.3.4
    - name: Install Cachix
      uses: cachix/install-nix-action@v13
      with:
        nix_path: nixpkgs=channel:nixos-unstable
    - name: Authenticate Cachix
      uses: cachix/cachix-action@v10
      with:
        name: ****
        authToken: '${{ secrets.CACHIX_READ_WRITE_TOKEN }}'
    - name: check-format.sh
      run: |
        cachix watch-store **** &
        nix-shell brittany.nix --run "./scripts/check-format.sh"

@chessai
Copy link

chessai commented Jul 12, 2022

I just started experiencing this as well.

@centromere
Copy link
Contributor

I ran in to this myself. Check your netrc file. It probably says:

machine foo.cachix.org password <token>

If you change it to:

machine foo.cachix.org login "" password <token>

it may start working. I think this is related to curl/curl#8908, but I am uncertain.

@centromere
Copy link
Contributor

Related: curl/curl#9148

@domenkozar
Copy link
Member

domenkozar commented Jul 13, 2022

I've pushed a fix to https://hydra.nixos.org/eval/1771392#tabs-unfinished, hopefully @edolstra will make a new Nix release tomorrow.

Workaround is to pin Nix: domenkozar/homelab@c7ab335

PS: it's better to report such issues to support@cachix.org for quicker turnaround.

@domenkozar
Copy link
Member

That fix was not enough, I created NixOS/nix#6807

@domenkozar
Copy link
Member

It should be fixed, can you confirm?

@centromere
Copy link
Contributor

It is now working for me.

@zmrocze
Copy link

zmrocze commented Apr 17, 2024

I'm experiencing this with nix (Nix) 2.18.1 on nixos-23.11.

Eventhough:

❯ nix store ping --store https://sth.cachix.org
Store URL: https://sth.cachix.org

@zmrocze
Copy link

zmrocze commented Jul 3, 2024

@domenkozar Hey, I still see this message always. Is it to be expected? Does it mean that the cache is not used?

@domenkozar
Copy link
Member

Is the cache public? Can you contact support, there's quite a few variables in play here.

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

No branches or pull requests

7 participants