-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publishing existing package overrides existing package to 0 bytes file #1191
Comments
I've seen this issue on one of our Windows VMs as well (with our own packages, not using @pavels555's demo files. Sometimes it creates an empty file and sometimes it deletes the file. |
One thing I wanted to note is the server where we don't see this issue is running Windows Server 2008 R2. The one with the issue uses Windows Server 2016. Poking around the code, it looks like Verdaccio moves the existing tarball out of the way, then tries to put it back on error (I'm not 100% sure, I'm having a hard time following the code, and can't find a way to attach a debugger running through IIS). My best guess is that this code is what corrupts the file:
My error file is identical to @pavels555 - including the Write After End message. |
thanks @pavels555 for diving into it, effectively the issue is the following. If there is an error on So, my solution (or what I have on mind) is don't create tmp file and stop the execution there if the file does not exist. Source of the issue #892 |
I found a solution, it seems at #892 we forgot something essential, the issue is at the local storage plugin. If the resource exists we should not open a file create the stream, it just does not make sense. I'll publish here a patched version, I'd like you guys to try it in your side, if works fine, I'll merge the patch. |
|
Publishing existing package overrides existing package to 0 bytes file
I installed the patch and it looks like the bug is fixed - thank you!!! |
Perfect ! I will release it ! Thanks for the quick test |
fix: overrides existing package to zero bytes file #1191
🤖This thread has been automatically locked 🔒 since there has not been any recent activity after it was closed. |
Describe the bug
When trying to publish a package that already exists it says "npm ERR! publish fail Cannot publish over existing version."
But at the same time, something fails at the server and the existing file turns into a 0 bytes size file.
It doesn't happen all the time, but it happens.
To Reproduce
Steps to reproduce the behavior:
It will show you all tgz files under 1 byte.
Expected behavior
Expected the package to not get overwritten.
Screenshots

Found files that are 0 bytes.
Let's look at the
debug
package.Found in the logs a error that appers only on package that have been destroyed. It is marked

Docker || Kubernetes (please complete the following information):
Configuration File (cat ~/.config/verdaccio/config.yaml)
Debugging output
Logs at the pictures.
Additional context
adding a file with some packages for you to try.
packages-demo.zip
The text was updated successfully, but these errors were encountered: