Cannot publish nor unpublish package after partial unpublish
Describe the bug Per https://github.com/verdaccio/verdaccio/blob/5.x/src/api/endpoint/api/publish.ts#L48 there's a chance that due some network errors package version is removed from the metadata, but the tarball remains. If one try to republish the package, verdaccio refuses it. Also it is not possible to unpublish it once more because metadata is missed.
To Reproduce To reproduce network error on the unpublish step you can commit this line: https://github.com/verdaccio/verdaccio/blob/5.x/src/api/endpoint/api/publish.ts#L92
npm publish test-1.0.0.tgz npm publish test-2.0.0.tgz npm unpublish [email protected] npm publish test-2.0.0.tgz
npm ERR! code E400
npm ERR! 400 Bad Request - PUT http://127.0.0.1:4873/test - unsupported registry callExpected behavior Verdaccio should remove the tarball if it is not present in the metadata and allow one to publish the package.
Configuration File (cat ~/.config/verdaccio/config.yaml)
storage: ./storage
plugins: ./plugins
auth:
htpasswd:
file: ./htpasswd
packages:
'**':
access: $all
publish: $all
max_body_size: 150mb
middlewares:
audit:
enabled: true
logs:
- { type: file, path: verdaccio.log, level: debug }Environment information
Environment Info:
System:
OS: Windows 10 10.0.18363
CPU: (4) ia32 AMD Ryzen 5 3600 6-Core Processor
Binaries:
Node: 14.13.1 - F:\tmp\nodejs\app\node.EXE
npm: 6.14.8 - F:\tmp\nodejs\app\npm.CMD
Browsers:
Edge: 44.18362.449.0Debugging output [email protected]
{"name":"verdaccio","hostname":"win10","pid":41500,"sub":"in","level":35,"request":{"method":"PUT","url":"/test"},"user":null,"remoteIP":"127.0.0.1","status":400,"error":"unsupported registry call","bytes":{"in":2277682,"out":43},"msg":"400, user: null(127.0.0.1), req: 'PUT /test', error: unsupported registry call","time":"2020-10-15T14:01:24.726Z","v":0}
Source: verdaccio/verdaccio