semantic-release-action icon indicating copy to clipboard operation
semantic-release-action copied to clipboard

Unable to authenticate, need: Basic realm="GitHub Package Registry"

Open yrshaikh opened this issue 2 years ago • 3 comments

Describe the bug Getting this error

image

Error: Command failed: npm ci --only=prod
npm ERR! code E401
npm ERR! Unable to authenticate, need: Basic realm="GitHub Package Registry"

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-08-23T10_41_00_344Z-debug.log

    at ChildProcess.exithandler (child_process.js:295:12)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) {
  killed: false,
  code: 1,
  signal: null,
  cmd: 'npm ci --only=prod',
  stdout: '',
  stderr: 'npm ERR! code E401\n' +
    'npm ERR! Unable to authenticate, need: Basic realm="GitHub Package Registry"\n' +
    '\n' +
    'npm ERR! A complete log of this run can be found in:\n' +
    'npm ERR!     /root/.npm/_logs/2021-08-23T10_41_00_344Z-debug.log\n'

Workflow

    semver:
        name: Semantic Versioning
        runs-on: [self-hosted, linux, x64]
        steps:
        - uses: actions/checkout@v2
        - name: Semantic Release
          id: semantic
          # https://github.com/cycjimmy/semantic-release-action
          uses: abc/semantic-release-action@master
          with:
            extra_plugins: |
              @semantic-release/exec
              @semantic-release/git
              @semantic-release/changelog
        outputs:
          new_release_published: ${{ steps.semantic.outputs.new_release_published }}
          new_release_version: ${{ steps.semantic.outputs.new_release_version }}

Expected behavior Not fail with this error.

yrshaikh avatar Aug 23 '21 10:08 yrshaikh

The complete error from log file

github@ghe-unix-05-0823-8126:~$ sudo cat /root/.npm/_logs/2021-08-23T09_07_07_447Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'ci', '--only=prod' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session c43c6d5de4bceee1
5 info prepare initializing installer
6 verbose prepare starting workers
7 verbose prepare installation prefix: /actions-runner/_work/_actions/abc/semantic-release-action/master
8 verbose prepare using package-lock.json
9 verbose checkLock verifying package-lock data
10 silly tree LogicalTree {
10 silly tree   name: '@cycjimmy/semantic-release-action',
10 silly tree   version: '2.5.3',
10 silly tree   address: '',
10 silly tree   optional: false,
10 silly tree   dev: false,
10 silly tree   bundled: false,
10 silly tree   resolved: undefined,
10 silly tree   integrity: undefined,
10 silly tree   dependencies: Map {
10 silly tree     '@actions/core' => LogicalTree {
10 silly tree       name: '@actions/core',
10 silly tree       version: '1.2.6',
10 silly tree       address: '@actions/core',
10 silly tree       optional: false,
10 silly tree       dev: false,
10 silly tree       bundled: false,
10 silly tree       resolved: 'https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz',
10 silly tree       integrity: 'sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA==',
10 silly tree       dependencies: Map {},
10 silly tree       requiredBy: [Set]
10 silly tree     },
10 silly tree     '@cycjimmy/awesome-js-funcs' => LogicalTree {
10 silly tree       name: '@cycjimmy/awesome-js-funcs',
10 silly tree       version: '2.4.0',
10 silly tree       address: '@cycjimmy/awesome-js-funcs',
10 silly tree       optional: false,
10 silly tree       dev: false,
10 silly tree       bundled: false,
10 silly tree       resolved: 'https://registry.npmjs.org/@cycjimmy/awesome-js-funcs/-/awesome-js-funcs-2.4.0.tgz',
10 silly tree       integrity: 'sha512-jRh5/h9owVt0ZWmbsWaAoZIgOJ38fBSEn/23Gph0Hlvb8Y8vspHx9Cqf4bfVdz23dEZUkiujr0zRB4BXlIJ3TQ==',
10 silly tree       dependencies: Map {},
10 silly tree       requiredBy: [Set]
10 silly tree     }
10 silly tree   },
10 silly tree   requiredBy: Set {}
10 silly tree }
11 info prepare Done in 0.019s
12 verbose extractTree extracting dependencies to node_modules/
13 silly extractTree @actions/[email protected] -> /actions-runner/_work/_actions/abc/semantic-release-action/master/node_modules/@actions/core
14 silly extractTree @cycjimmy/[email protected] -> /actions-runner/_work/_actions/abc/semantic-release-action/master/node_modules/@cycjimmy/awesome-js-funcs
15 silly tarball trying @actions/[email protected] by hash: sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA==
16 silly tarball trying @cycjimmy/[email protected] by hash: sha512-jRh5/h9owVt0ZWmbsWaAoZIgOJ38fBSEn/23Gph0Hlvb8Y8vspHx9Cqf4bfVdz23dEZUkiujr0zRB4BXlIJ3TQ==
17 silly tarball no local data for @actions/[email protected]. Extracting by manifest.
18 silly tarball no local data for @cycjimmy/[email protected]. Extracting by manifest.
19 http fetch GET 401 https://npm.pkg.github.com/@actions%2fcore 451ms
20 verbose teardown shutting down workers.
21 info teardown Done in 0s
22 verbose stack Error: Unable to authenticate, need: Basic realm="GitHub Package Registry"
22 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/npm-registry-fetch/check-response.js:107:17
22 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:97:5)
23 verbose statusCode 401
24 verbose pkgid @actions/[email protected]
25 verbose cwd /actions-runner/_work/_actions/abc/semantic-release-action/master
26 verbose Linux 5.4.0-1026-kvm
27 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "ci" "--only=prod"
28 verbose node v12.19.0
29 verbose npm  v6.14.8
30 error code E401
31 error Unable to authenticate, need: Basic realm="GitHub Package Registry"
32 verbose exit [ 1, true ]

yrshaikh avatar Aug 23 '21 12:08 yrshaikh

@cycjimmy can you help take a look at this error. I have also summarized the error here - https://stackoverflow.com/questions/68917546/github-action-in-github-enterprise-giving-401-and-404s-on-npm-packages

yrshaikh avatar Aug 25 '21 08:08 yrshaikh

@actions/core is not in the GPR list. You can change to npm to install it.

cycjimmy avatar Aug 26 '21 01:08 cycjimmy