verdaccio: Docker upgrade to 4.0.0 not working, missing all packages
Describe the bug Docker upgrade to 4.0.0 not working, missing all packages. The UI did not show any packages and also install a package did not work
To Reproduce Steps to reproduce the behavior:
- Go to Update the docker image to
verdaccio/verdaccio:4.0.0 - Open the website
- No packages available
Expected behavior See all NPM packages
Kubernetes (please complete the following information):
- Docker verdaccio tag: verdaccio/verdaccio:4.0.0
Configuration File (cat ~/.config/verdaccio/config.yaml)
$ cat /verdaccio/conf/config.yaml
storage: /verdaccio/storage/
max_body_size: 1000mb
auth:
htpasswd:
file: ./htpasswd
uplinks:
npmjs:
url: https://registry.npmjs.org/
packages:
'@*/*':
access: $all
publish: $authenticated
proxy:
storage: '/verdaccio/storage'
'**':
access: $all
publish: $authenticated
proxy:
storage: '/verdaccio/storage'
logs:
- {type: stdout, format: pretty, level: debug}
# - {type: stdout, format: pretty, level: http}
security:
token:
web: 24h # by default
api: never # by defaukt
algorithm: HS256 # by default
Additional context Spoke on Discord and got these links: https://verdaccio.org/blog/2019/02/24/migrating-verdaccio and https://verdaccio.org/blog/2019/05/13/the-new-docker-image-verdaccio-4
None where clear to me what the changes are, I use kubernetes with no ENV variables and separate volume mounts. What are the real breaking changes?
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: npm-registry
namespace: backoffice
name: npm-registry
spec:
# Stop old container before starting new one
strategy:
type: Recreate
rollingUpdate: null
selector:
matchLabels:
app: npm-registry
replicas: 1
template:
metadata:
labels:
app: npm-registry
spec:
containers:
- name: npm-registry
image: verdaccio/verdaccio:4.0.0
imagePullPolicy: Always
resources:
requests:
cpu: 300m
memory: 200Mi
limits:
cpu: 300m
memory: 250Mi
ports:
- containerPort: 4873
name: http
volumeMounts:
- mountPath: /verdaccio/storage
name: npmdata-rook-ceph-block
subPath: storage
- mountPath: /verdaccio/plugins
name: npmdata-rook-ceph-block
subPath: plugins
- mountPath: /verdaccio/conf
name: npmdata-rook-ceph-block
subPath: conf
readinessProbe:
httpGet:
path: /
port: 4873
initialDelaySeconds: 5
periodSeconds: 20
livenessProbe:
httpGet:
path: /
port: 4873
timeoutSeconds: 2
volumes:
- name: npmdata-rook-ceph-block
persistentVolumeClaim:
claimName: npmdata-rook-ceph-block
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 6
- Comments: 27 (6 by maintainers)
@johnruck Ok please try this:
Please test creating a named volume and copying the contents of your storage directory in the host to it. Then start your verdaccio referencing this volume.
PLEASE backup your storage directory before trying this, just in case, it shouldn’t break anything but you never know.
Work around did not work for me as well (I was also already doing 3 independent volume mounts. I have also just tried new mount directories with no effect. One thing I have noticed is that I think it might be permissions on the mount directories that is the problem (for point of reference, I let Docker create the new directories and then copied in the config.yaml file after it created them). Attaching the docker instance gets me the following output on the new directories on my first attempt to use the “new” server.
note this is with the “Latest” docker image. Verdaccio web ui says version 4.01.
Any suggestions? I have even tried turning off the caching and it still outputs these errors and fails.
In case it matters - this was on Ubuntu 18.04.2 LTS
command used:
I have it solved 🎉
In my config I had:
And now it works with:
And by removing the proxy and storage lines it worked. Followed the example
Also the chown was needed to fix the permissions as @ishowman suggested. It was a double issue with file permissions and config.
My complete config is now:
Also looked at issue #1481 for the authentication.
I’ve moved Verdaccio from 3.x to 4.3,and encountered the
permission deniedissue. In case someone need it, just use this to givestorageto userverdaccioin the container.For more info: https://medium.com/@mccode/understanding-how-uid-and-gid-work-in-docker-containers-c37a01d01cf
I using
docker exec -it <container ID> /bin/shto enter the running container, and input the command you offered, get message “/bin/sh: sudo: not found”.