[FOLIO-1016] Status 401 attempting to publish to FOLIO NPM repository Created: 04/Jan/18  Updated: 12/Nov/18  Resolved: 01/May/18

Status: Closed
Project: FOLIO
Components: None
Affects versions: None
Fix versions: None

Type: Bug Priority: P3
Reporter: John Malconian Assignee: John Malconian
Resolution: Cannot Reproduce Votes: 0
Labels: ci
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Sprint:

 Description   

Baroquem reported a 401 status code while attempting to publish to the folio-npm repository with the proper permissions and credentials.



 Comments   
Comment by John Malconian [ 04/Jan/18 ]

NPM Environment:

; cli configs
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/5.6.0 node/v9.3.0 darwin x64"

; userconfig /Users/matt/.npmrc
//repository.folio.org/repository/npm-folio/:always-auth = false
//repository.folio.org/repository/npm-folio/:email = "xxx@xxxx"
//repository.folio.org/repository/npm-folio/:username = "xxx"
@folio:registry = "https://repository.folio.org/repository/npm-folio/"

; builtin config undefined
prefix = "/usr/local"

; node bin location = /usr/local/Cellar/node/9.3.0_1/bin/node
; cwd = /Users/matt/code/folio/ui-requests
; HOME = /Users/matt
; "npm config ls -l" to show all defaults.

NPM debug log:

http request PUT https://repository.folio.org/repository/npm-folio/@folio%2frequests
24 http 401 https://repository.folio.org/repository/npm-folio/@folio%2frequests
25 verbose headers { server: 'nginx/1.12.1',
25 verbose headers   date: 'Thu, 04 Jan 2018 15:46:06 GMT',
25 verbose headers   'content-length': '0',
25 verbose headers   connection: 'keep-alive',
25 verbose headers   'x-frame-options': 'SAMEORIGIN',
25 verbose headers   'x-content-type-options': 'nosniff',
25 verbose headers   'set-cookie':
25 verbose headers    [ 'NXREMEMBERME=deleteMe; Path=/; Max-Age=0; Expires=Wed, 03-Jan-2018 15:46:06 GMT' ],
25 verbose headers   'www-authenticate': 'BASIC realm="Sonatype Nexus Repository Manager"' }
26 error publish Failed PUT 401
27 verbose stack Error: 401 Unauthorized
27 verbose stack     at makeError (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:314:12)
27 verbose stack     at RegClient.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:259:9)
27 verbose stack     at Request._callback (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:216:14)
27 verbose stack     at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:186:22)
27 verbose stack     at Request.emit (events.js:159:13)
27 verbose stack     at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1163:10)
27 verbose stack     at Request.emit (events.js:159:13)
27 verbose stack     at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1085:12)
27 verbose stack     at Object.onceWrapper (events.js:254:19)
27 verbose stack     at IncomingMessage.emit (events.js:164:20)
27 verbose stack     at endReadableNT (_stream_readable.js:1062:12)
27 verbose stack     at process._tickCallback (internal/process/next_tick.js:152:19)
28 verbose statusCode 401
29 verbose cwd /Users/matt/code/folio/ui-requests
30 verbose Darwin 17.3.0
31 verbose argv "/usr/local/Cellar/node/9.3.0_1/bin/node" "/usr/local/bin/npm" "publish"
32 verbose node v9.3.0
33 verbose npm  v5.6.0
34 error code E401
35 error 404 401 Unauthorized
36 verbose exit [ 1, true ]
Comment by John Malconian [ 04/Jan/18 ]

I am able to publish the package (ui-requests v1.1.0) in question with the same permissions and the following environment:

cli configs
user-agent = “npm/3.10.10 node/v6.12.0 linux x64”

; userconfig /home/jenkins/.npmrc
@folio:registry = “https://repository.folio.org/repository/npm-folio/”

; node bin location = /usr/bin/node
; cwd = /home/jenkins/ui-requests
; HOME = /home/jenkins
; “npm config ls -l” to show all defaults.

There could potentially be an incompatibility with the version of NPM used in the failed request.

Generated at Thu Feb 08 23:10:12 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.