question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

413 on NPM Publish

See original GitHub issue

Describe the bug

Getting a 413 when trying to publish. I have an npmignore set up to only include dist/*. I have replaced my module name, urls, and usernames in the output.

Note that I did try the ‘max_body_size’ change, to no avail. My build is ~5.6mb unpacked, which should be perfectly fine.

C:\dev\<module> [master ≡]> npm publish
npm notice
npm notice package: <module>
npm notice === Tarball Contents ===
npm notice 3.0MB   dist/components.js
npm notice 2.0MB   dist/icons.js
npm notice 558.8kB dist/services.js
npm notice 2.6kB   package.json
npm notice === Tarball Details ===
npm notice name:          <module>
npm notice version:       0.0.4
npm notice package size:  1.2 MB
npm notice unpacked size: 5.6 MB
npm notice shasum:        ca4b78a9c9b77d43e0f4633fdf3883457c199997
npm notice integrity:     sha512-rK6gZP6ScyAWi[...]+wgw9HBuY2hVQ==
npm notice total files:   4
npm notice
npm ERR! code E413
npm ERR! 413 Request Entity Too Large - PUT http://<verdaccio>/<module>

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\<user>\AppData\Roaming\npm-cache\_logs\2019-09-11T19_23_46_569Z-debug.log

To Reproduce

I have a project outputting files to dist via webpack. It does not matter the amount of files, but simply the filesize.

Steps to reproduce the behavior:
1. Set up package.json / npmrc / npmignore
2. Build project that outputs to dist
3. Run 'npm publish'
4. See error

Expected behavior

I would expect a successful release or a more relevant error message.

Screenshots If applicable, add screenshots to help explain your problem. N/A

Docker || Kubernetes (please complete the following information):

Kubernetes with 4.2 image from dockerhub.

Configuration File (cat ~/.config/verdaccio/config.yaml)

auth:
  htpasswd:
    file: /verdaccio/storage/htpasswd
logs:
  -
    format: pretty
    level: http
    type: stdout
max_body_size: 1000mb
middlewares:
  audit:
    enabled: true
notify:
  content: "{\"color\":\"green\",\"message\":\"New package published: * {{ name }}*. Publisher name: * {{ publisher.name }} *.\",\"notify\":true,\"message_format\":\"text\"}"
  endpoint: "<removed>"
  headers:
    -
      Content-Type: application/json
  method: POST
packages:
  ? "**"
  :
    access: $all
    proxy: npmjs
    publish: $authenticated
    unpublish: $authenticated
  ? "@*/*"
  :
    access: $all
    proxy: npmjs
    publish: $authenticated
    unpublish: $authenticated
plugins: /verdaccio/plugins
security:
  api:
    jwt:
      sign:
        expiresIn: 60d
        notBefore: 1
  web:
    sign:
      expiresIn: 7d
      notBefore: 1
storage: /verdaccio/storage/data
uplinks:
  npmjs:
    url: "https://registry.npmjs.org/"
web:
  enable: true
  title: "Verdaccio"

Environment information

bin/verdaccio --info

Environment Info:

  System:
    OS: Linux 4.15 Alpine Linux undefined
    CPU: (80) x64 Intel(R) Xeon(R) Gold 6138 CPU @ 2.00GHz
  Binaries:
    Node: 10.16.3 - /usr/local/bin/node
    Yarn: 1.17.3 - /usr/local/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ccswiftcommented, Sep 12, 2019

Update, turns out it was unrelated to Verdaccio altogether. It was the Nginx proxy.

nginx.ingress.kubernetes.io/proxy-body-size: 512m

0reactions
lock[bot]commented, Dec 12, 2019

🤖This thread has been automatically locked 🔒 since there has not been any recent activity after it was closed. We lock tickets after 90 days with the idea to encourage you to open a ticket with new fresh data and to provide you better feedback 🤝and better visibility 👀. If you consider, you can attach this ticket 📨 to the new one as a reference for better context. Thanks for being a part of the Verdaccio community! 💘

Read more comments on GitHub >

github_iconTop Results From Across the Web

PUT 413 error on publishing package · Issue #277 - GitHub
My reason: When trying to publish my package, I receive 413 entity too large error $ npm publish npm ERR! publish Failed PUT...
Read more >
verdaccio Error: 413 Payload Too Large - PUT request entity ...
i was use Verdaccio which is a lightweight private npm proxy registry built in Node.js. when i publish my ...
Read more >
What Is a 413 Request Entity Too Large Error & How to Fix It
A 413 HTTP error code occurs when the size of a client's request exceeds the server's file size limit. This typically happens when...
Read more >
How to Solve the "413 Request Entity Too Large" Error - Kinsta
“413”: This is one of the 4xx error codes, which mean there's a problem between the server and browser. “Request Entity”: The “entity”...
Read more >
Fixing 413 Request Entity Too Large Errors - KeyCDN Support
A 413 Request Entity Too Large error occurs when a request made from a client is too large to be processed by the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found