DeterminateSystems / magic-nix-cache-action

Save 30-50%+ of CI time without any effort or cost. Use Magic Nix Cache, a totally free and zero-configuration binary cache for Nix on GitHub Actions.
MIT License
388 stars 15 forks source link

404 Not Found error #22

Closed dzmitry-lahoda closed 12 months ago

dzmitry-lahoda commented 1 year ago

Some human workds: I though to improve performance of our CI ARM dedicated machine with Nix 2.15+ version running. Added cache action as per docs and it got error. I was not able to found root cause nor additional config.

https://github.com/ComposableFi/composable/actions/runs/5799130289/job/15718439792?pr=4039 https://github.com/ComposableFi/composable/pull/4039/commits/db13464745e43dd82c1c1eb23602a1f5ecf5ccdc

2s
Current runner version: '2.307.[1](https://github.com/ComposableFi/composable/actions/runs/5799130289/job/15718439792?pr=4039#step:1:1)'
Runner name: 'hetzner-rx170-[2](https://github.com/ComposableFi/composable/actions/runs/5799130289/job/15718439792?pr=4039#step:1:2)'
Runner group name: 'Default'
Machine name: 'Ubuntu-2204-jammy-arm64-base'
GITHUB_TOKEN Permissions
Secret source: Actions
Prepare workflow directory
Prepare all required actions
Getting action download info
Download action repository 'DeterminateSystems/magic-nix-cache-action@v2' (SHA:8a218f9e264e9c[3](https://github.com/ComposableFi/composable/actions/runs/5799130289/job/15718439792?pr=4039#step:1:3)803c9a1ee1c30d8e[4](https://github.com/ComposableFi/composable/actions/runs/5799130289/job/15718439792?pr=4039#step:1:4)ab[5](https://github.com/ComposableFi/composable/actions/runs/5799130289/job/15718439792?pr=4039#step:1:5)5be63)
Download action repository 'cachix/cachix-action@5[8](https://github.com/ComposableFi/composable/actions/runs/5799130289/job/15718439792?pr=4039#step:1:9)6bf2804[9](https://github.com/ComposableFi/composable/actions/runs/5799130289/job/15718439792?pr=4039#step:1:10)5080c5a6d4868237ad28a860e4b309' (SHA:586bf280495080c5a6d4868237ad28a860e4b309)
Download action repository 'actions/checkout@v3' (SHA:c85c95e3d725[11](https://github.com/ComposableFi/composable/actions/runs/5799130289/job/15718439792?pr=4039#step:1:12)35ab7dc9ce3241c5835cc595a9)
Uses: ComposableFi/composable/.github/workflows/pr-workflow.yml@refs/pull/4039/merge (e69f91fb47fe0bb02d89b74f94e28544e757867c)
 Inputs
    github_event_name: pull_request
    github_event_pull_request_head_repo_id: 383289760
    github_workflow: pr-workflow-check
    github_event_pull_request_head_sha: 515b051e454ad7d4d5966606b453fc2631c63166
    flow: pr_from_branch
    sha_to_check: 515b051e454ad7d4d5966606b453fc2631c63166
Complete job name: pr-workflow-check / build-devnet-xc
0s
Run DeterminateSystems/magic-nix-cache-action@v2
  with:
    listen: [12](https://github.com/ComposableFi/composable/actions/runs/5799130289/job/15718439792?pr=4039#step:1:13)7.0.0.1:375[15](https://github.com/ComposableFi/composable/actions/runs/5799130289/job/15718439792?pr=4039#step:1:16)
    upstream-cache: https://cache.nixos.org/
    source-branch: main
    diagnostic-endpoint: https://install.determinate.systems/magic-nix-cache/perf
got an exception:
HTTPError: Response code 404 (Not Found)
Error: Response code 404 (Not Found)
node:internal/process/esm_loader:94
    internalBinding('errors').triggerUncaughtException(
                              ^

HTTPError: Response code 404 (Not Found)
    at Request._onResponseBase (file:///home/actions-runner/_work/_actions/DeterminateSystems/magic-nix-cache-action/v2/dist/index.js:11324:31)
    at Request._onResponse (file:///home/actions-runner/_work/_actions/DeterminateSystems/magic-nix-cache-action/v2/dist/index.js:113[8](https://github.com/ComposableFi/composable/actions/runs/5799130289/job/15718439792?pr=4039#step:2:9)3:24)
    at ClientRequest.<anonymous> (file:///home/actions-runner/_work/_actions/DeterminateSystems/magic-nix-cache-action/v2/dist/index.js:11401:23)
    at Object.onceWrapper (node:events:642:26)
    at ClientRequest.emit (node:events:53[9](https://github.com/ComposableFi/composable/actions/runs/5799130289/job/15718439792?pr=4039#step:2:10):35)
    at HTTPParser.parserOnIncomingClient (node:_http_client:631:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
    at TLSSocket.socketOnData (node:_http_client:494:22)
    at TLSSocket.emit (node:events:527:28)
    at addChunk (node:internal/streams/readable:315:12) {
  input: undefined,
  code: 'ERR_NON_2XX_3XX_RESPONSE',
  timings: {
    start: 1691510687579,
    socket: 1691510687579,
    lookup: 1691510687598,
    connect: 1691510687706,
    secureConnect: 1691510687926,
    upload: 1691510687926,
    response: 1691510688050,
    end: 1691510688057,
    error: undefined,
    abort: undefined,
    phases: {
      wait: 0,
      dns: 19,
      tcp: 108,
      tls: 220,
      request: 0,
      firstByte: 124,
      download: 7,
      total: 478
    }
  },
  options: Options {
    _unixOptions: undefined,
    _internals: {
      request: undefined,
      agent: { http: undefined, https: undefined, http2: undefined },
      h2session: undefined,
      decompress: true,
      timeout: {
        connect: undefined,
        lookup: undefined,
        read: undefined,
        request: undefined,
        response: undefined,
        secureConnect: undefined,
        send: undefined,
        socket: undefined
      },
      prefixUrl: '',
      body: undefined,
      form: undefined,
      json: undefined,
      cookieJar: undefined,
      ignoreInvalidCookies: false,
      searchParams: undefined,
      dnsLookup: undefined,
      dnsCache: undefined,
      context: {},
      hooks: {
        init: [],
        beforeRequest: [],
        beforeError: [],
        beforeRedirect: [],
        beforeRetry: [ [Function (anonymous)] ],
        afterResponse: []
      },
      followRedirect: true,
      maxRedirects: [10](https://github.com/ComposableFi/composable/actions/runs/5799130289/job/15718439792?pr=4039#step:2:11),
      cache: undefined,
      throwHttpErrors: true,
      username: '',
      password: '',
      http2: false,
      allowGetBody: false,
      headers: {
        'user-agent': 'got (https://github.com/sindresorhus/got)',
        'accept-encoding': 'gzip, deflate, br'
      },
      methodRewriting: false,
      dnsLookupIpVersion: undefined,
      parseJson: [Function: parse],
      stringifyJson: [Function: stringify],
      retry: {
        limit: 5,
        methods: [
          'POST',   'GET',
          'PUT',    'HEAD',
          'DELETE', 'OPTIONS',
          'TRACE'
        ],
        statusCodes: [
          408, 4[13](https://github.com/ComposableFi/composable/actions/runs/5799130289/job/15718439792?pr=4039#step:2:14), 429, 500,
          502, 503, 504, 521,
          522, 524
        ],
        errorCodes: [
          'ETIMEDOUT',
          'ECONNRESET',
          'EADDRINUSE',
          'ECONNREFUSED',
          'EPIPE',
          'ENOTFOUND',
          'ENETUNREACH',
          'EAI_AGAIN'
        ],
        maxRetryAfter: undefined,
        calculateDelay: [Function: calculateDelay],
        backoffLimit: Infinity,
        noise: 100
      },
      localAddress: undefined,
      method: 'GET',
      createConnection: undefined,
      cacheOptions: {
        shared: undefined,
        cacheHeuristic: undefined,
        immutableMinTimeToLive: undefined,
        ignoreCargoCult: undefined
      },
      https: {
        alpnProtocols: undefined,
        rejectUnauthorized: undefined,
        checkServerIdentity: undefined,
        certificateAuthority: undefined,
        key: undefined,
        certificate: undefined,
        passphrase: undefined,
        pfx: undefined,
        ciphers: undefined,
        honorCipherOrder: undefined,
        minVersion: undefined,
        maxVersion: undefined,
        signatureAlgorithms: undefined,
        tlsSessionLifetime: undefined,
        dhparam: undefined,
        ecdhCurve: undefined,
        certificateRevocationLists: undefined
      },
      encoding: undefined,
      resolveBodyOnly: false,
      isStream: true,
      responseType: 'text',
      url: <ref *1> URL {
        [Symbol(context)]: URLContext {
          flags: 400,
          scheme: 'https:',
          username: '',
          password: '',
          host: 'magic-nix-cache[20](https://github.com/ComposableFi/composable/actions/runs/5799130289/job/15718439792?pr=4039#step:2:21)[23](https://github.com/ComposableFi/composable/actions/runs/5799130289/job/15718439792?pr=4039#step:2:24)0623203105[25](https://github.com/ComposableFi/composable/actions/runs/5799130289/job/15718439792?pr=4039#step:2:26)5200000001.s3.amazonaws.com',
          port: null,
          path: [ 'branch_main', 'magic-nix-cache-ARM64-Linux' ],
          query: null,
          fragment: null
        },
        [Symbol(query)]: URLSearchParams {
          [Symbol(query)]: [],
          [Symbol(context)]: [Circular *1]
        }
      },
      pagination: {
        transform: [Function: transform],
        paginate: [Function: paginate],
        filter: [Function: filter],
        shouldContinue: [Function: shouldContinue],
        countLimit: Infinity,
        backoff: 0,
        requestLimit: 10000,
        stackAllItems: false
      },
      setHost: true,
      maxHeaderSize: undefined,
      signal: undefined,
      enableUnixSockets: true
    },
    _merging: false,
    _init: [
      {
        retry: {
          limit: 5,
          methods: [
            'POST',   'GET',
            'PUT',    'HEAD',
            'DELETE', 'OPTIONS',
            'TRACE'
          ]
        },
        hooks: { beforeRetry: [ [Function (anonymous)] ] }
      },
      { isStream: true }
    ]
  }
}
dzmitry-lahoda commented 1 year ago

our CI config https://github.com/ComposableFi/composable/blob/main/flake/ci.md#sudo

dzmitry-lahoda commented 1 year ago

so it works only in docker, but not when CI uses host nix and not isolated (isolated by nix only)

elopez commented 1 year ago

I'm seeing this same error on the new macOS ARM (M1) runners (macos-latest-xlarge). Could it be some issue related to the ARM architecture? I see your log also shows you were using an ARM machine (Machine name: 'Ubuntu-2204-jammy-arm64-base')

elopez commented 1 year ago

After a bit more investigation (and enabling debug logging) this is what I found out:

##[debug]Fetching the Magic Nix Cache from https://install.determinate.systems/magic-nix-cache/branch/main/ARM64-macOS
got an exception:
HTTPError: Response code 404 (Not Found)
Error: Response code 404 (Not Found)
node:internal/process/esm_loader:97
    internalBinding('errors').triggerUncaughtException(
                              ^

From what I can tell, only x86_64 Linux and macOS have binaries available: https://github.com/DeterminateSystems/magic-nix-cache/blob/main/.github/workflows/build.yaml

Can we get ARM64 macOS and Linux supported? M1 Macs are now available on GitHub Actions officially: https://github.blog/2023-10-02-introducing-the-new-apple-silicon-powered-m1-macos-larger-runner-for-github-actions/