-
Notifications
You must be signed in to change notification settings - Fork 475
How to recover portus deleted image tags #2005
Comments
So the thing is that blobs weren't deleted (and you haven't run the garbage collector that you can find inside of the docker registry, right?). In this case, then the only thing you are missing is the manifest that Portus deleted. You could just push the images up again, and it should already re-use the blobs you had uploaded before the delete. This is the way to go imho.
I'd need logs and the configuration to give you a better response 😅 |
I have the same problem. Portus automatically deletes image tags without any user interaction. It happens from time to time. I'm running a clean installation of Portus 2.4 wih docker-compose. The portus background logs that the job is now deleting a image and I see the delete call in the registry logs but no user submitted it. On the dashboard inside the web UI there is only a message "portus deleted fooo/bar:test-201812-27" Log from Portus background container
Deployment informationConfiguration: version: "2"
services:
portus:
image: opensuse/portus:2.4
environment:
- PORTUS_MACHINE_FQDN_VALUE=${MACHINE_FQDN}
# DB. The password for the database should definitely not be here. You are
# probably better off with Docker Swarm secrets.
- PORTUS_DB_HOST=db
- PORTUS_DB_DATABASE=portus_production
- PORTUS_DB_PASSWORD=${DATABASE_PASSWORD}
- PORTUS_DB_POOL=5
# Secrets. It can possibly be handled better with Swarm's secrets.
- PORTUS_SECRET_KEY_BASE=${SECRET_KEY_BASE}
- PORTUS_KEY_PATH=/certificates/portus.key
- PORTUS_PASSWORD=${PORTUS_PASSWORD}
# SSL
- PORTUS_PUMA_TLS_KEY=/certificates/portus.key
- PORTUS_PUMA_TLS_CERT=/certificates/portus.crt
- PORTUS_CHECK_SSL_USAGE_ENABLED=false
# NGinx is serving the assets instead of Puma. If you want to change this,
# uncomment this line.
- RAILS_SERVE_STATIC_FILES='true'
ports:
- 3000:3000
links:
- db
volumes:
- ./secrets:/certificates:ro
- static:/srv/Portus/public
restart: unless-stopped
background:
image: opensuse/portus:2.4
depends_on:
- portus
- db
environment:
# Theoretically not needed, but cconfig's been buggy on this...
- CCONFIG_PREFIX=PORTUS
- PORTUS_MACHINE_FQDN_VALUE=${MACHINE_FQDN}
# DB. The password for the database should definitely not be here. You are
# probably better off with Docker Swarm secrets.
- PORTUS_DB_HOST=db
- PORTUS_DB_DATABASE=portus_production
- PORTUS_DB_PASSWORD=${DATABASE_PASSWORD}
- PORTUS_DB_POOL=5
# Secrets. It can possibly be handled better with Swarm's secrets.
- PORTUS_SECRET_KEY_BASE=${SECRET_KEY_BASE}
- PORTUS_KEY_PATH=/certificates/portus.key
- PORTUS_PASSWORD=${PORTUS_PASSWORD}
- PORTUS_BACKGROUND=true
- PORTUS_BACKGROUND_SYNC_ENABLED=false
links:
- db
volumes:
- ./secrets:/certificates:ro
restart: unless-stopped
db:
image: library/mariadb:10.0.23
command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci --init-connect='SET NAMES UTF8;' --innodb-flush-log-at-trx-commit=0
environment:
- MYSQL_DATABASE=portus_production
# Again, the password shouldn't be handled like this.
- MYSQL_ROOT_PASSWORD=${DATABASE_PASSWORD}
volumes:
- /media/data1/hub/mariadb:/var/lib/mysql
restart: unless-stopped
registry:
image: library/registry:2.6.2
command: ["/bin/sh", "/etc/docker/registry/init"]
environment:
# Authentication
REGISTRY_AUTH_TOKEN_REALM: https://${MACHINE_FQDN}/v2/token
REGISTRY_AUTH_TOKEN_SERVICE: ${MACHINE_FQDN}
REGISTRY_AUTH_TOKEN_ISSUER: ${MACHINE_FQDN}
REGISTRY_AUTH_TOKEN_ROOTCERTBUNDLE: /secrets/portus.crt
# SSL
REGISTRY_HTTP_TLS_CERTIFICATE: /secrets/portus.crt
REGISTRY_HTTP_TLS_KEY: /secrets/portus.key
# Portus endpoint
REGISTRY_NOTIFICATIONS_ENDPOINTS: >
- name: portus
url: https://${MACHINE_FQDN}/v2/webhooks/events
timeout: 2000ms
threshold: 5
backoff: 1s
volumes:
- /media/data1/hub/registry:/var/lib/registry
- ./secrets:/secrets:ro
- ./registry/config.yml:/etc/docker/registry/config.yml:ro
- ./registry/init:/etc/docker/registry/init:ro
ports:
- 5000:5000
- 5001:5001 # required to access debug service
links:
- portus:portus
restart: unless-stopped
nginx:
image: library/nginx:alpine
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./secrets:/secrets:ro
- static:/srv/Portus/public:ro
ports:
- 80:80
- 443:443
links:
- registry:registry
- portus:portus
restart: unless-stopped
volumes:
static:
driver: local
Portus version: 2.4.0@2.4.0 docker ps
|
Same issue affects me.
Portus version: 2.5.0-dev@c98a51eb0cc2ee772c19ee64269d2a86ec0fe0dc portus-background container log:
registry container log:
|
@maleficxp this bug was fixed at #2018. Your image is probably older than that. Also, we've imlemented the suggestions of #2051. If you upgrade your instance you can take advantage of that too. |
To be honest I think we can close this issue. What do you think, @mssola? |
Agreed. Thanks @vitoravelino for the heads up 👍 |
We have installed Portus using "head" version last month ( not sure the exact version number because upgraded with latest stable version Version: 2.3.5@35b9c801bf5275537a8bd8152d2f5769d6c24b09), the images got deleted automatically from portus. I see that the blobs layers are still available in the blobs folder.
I do not see the issues after upgraded with stable but How do we recover the deleted images tag and bring back it available?
last bug report
#1160
The text was updated successfully, but these errors were encountered: