404 error while pushing tar.gz file to Nexus

1,298 views
Skip to first unread message

gotvi...@gmail.com

unread,
Sep 13, 2018, 1:30:57 PM9/13/18
to Nexus Users
I'm trying to push a tar.gz file to Nexus by two methods.  Both the methods are giving me 404 error.  But, the same file am able to upload through the UI.

1) I'm trying to upload through Jenkins as part of a build job.

The error am getting in Jenkins is

Started by user XXXXXX
[Office365connector] No webhooks to notify
Building remotely on XXXXXXXXX in workspace /USER/jenkins/workspace/PROJECT/JOB
Uploading artifact abcd.tgz started....
GroupId: abcd-01
ArtifactId: abcd-0.0.9
Classifier: 
Type: tgz
Version: 1.1.1
File: abcd-0.0.9.tgz
Repository:REPONAME-npm-hosted
Uploading: $URL/repository/REPONAME-npm-hosted/abcd-01/abcd-0.0.9/1.1.1/abcd-0.0.9-1.1.1.tgz
10 % completed (193 kB / 1.9 MB).
20 % completed (385 kB / 1.9 MB).
30 % completed (578 kB / 1.9 MB).
Failed to deploy artifacts: Could not transfer artifact abcd-01:abcd-0.0.9:tgz:1.1.1 from/to REPONAME-npm-hosted ($URL/repository/REPONAME-npm-hosted): Broken pipe (Write failed)
ERROR: Uploading file abcd-0.0.9.tgz failed.
[Office365connector] No webhooks to notify
Finished: FAILURE

2) Trying to publish from Mac command line.

The error am getting here is

* Trying X.X.X.X...
* TCP_NODELAY set
* Connected to $URL (X.X.X.X) port 0000 (#0)
* Server auth using Basic with user 'XXXXX'
> PUT /repository/REPONAME-npm-hosted/abcd-0.0.9.tgz HTTP/1.1
> Host: $URL
> Authorization: Basic *********************************
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Length: 8552
> Expect: 100-continue
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
< HTTP/1.1 400 Bad Request
< Date: Wed, 12 Sep 2018 15:45:08 GMT
< Server: Nexus/3.12.0-01 (OSS)
< X-Content-Type-Options: nosniff
< Content-Security-Policy: sandbox allow-forms allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation
< Content-Type: application/json
< Content-Length: 46
* Connection #0 to host $URL left intact
{"success":false,"error":"Invalid JSON input"}

The Repo type I'm trying to push this Artifact to is npm-hosted repo.

Note : The same file, I'm able to push to a raw-hosted repo without any issue.


Please suggest.

gotvi...@gmail.com

unread,
Sep 13, 2018, 2:58:04 PM9/13/18
to Nexus Users
Nexus version is - Nexus/3.12.0-01

Rich Seddon

unread,
Sep 13, 2018, 3:06:11 PM9/13/18
to Nexus Users
You can't publish to an npm repository using a maven uploader, that's not how the npm repository protocol works.  Use the "npm publish" command:


gotvi...@gmail.com

unread,
Sep 19, 2018, 2:55:37 PM9/19/18
to Nexus Users
Thanks a lot Rich.  This works.
Reply all
Reply to author
Forward
0 new messages