Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Error "Cannot find user" on registry push event #1949

Closed
artemkamolodets opened this issue Aug 20, 2018 · 6 comments
Closed

Error "Cannot find user" on registry push event #1949

artemkamolodets opened this issue Aug 20, 2018 · 6 comments
Labels

Comments

@artemkamolodets
Copy link

Description

Hello. I've got an error message (from background container) when i'm pushing an image into the registry.


Steps to reproduce

  1. I deployed the docker registry.
  2. I deployed portus in docker.
  3. Error appears on image pushing.

Portus background container logs:

portusbg | Handling 'push' event:
portusbg | {
portusbg | "id": "b2b8d1fc-6660-4afe-8c55-202bbe2c3e00",
portusbg | "timestamp": "2018-08-20T09:12:07.690603928Z",
portusbg | "action": "push",
portusbg | "target": {
portusbg | "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
portusbg | "size": 948,
portusbg | "digest": "sha256:4ffd9758ea9ea360fd87d0cee7a2d1cf9dba630bb57ca36b3108dcd3708dc189",
portusbg | "length": 948,
portusbg | "repository": "portus_admin/nginx",
portusbg | "url": "https://{registryFQDN}:5003/v2/portus_admin/nginx/manifests/sha256:4ffd9758ea9ea360fd87d0cee7a2d1cf9dba630bb57ca36b3108dcd3708dc189",
portusbg | "tag": "adv1"
portusbg | },
portusbg | "request": {
portusbg | "id": "bf4fbf57-2d87-4426-bc87-cba1ba86d7c3",
portusbg | "addr": "{IPaddress}:35760",
portusbg | "host": "{registryFQDN}:5003",
portusbg | "method": "PUT",
portusbg | "useragent": "docker/18.03.1-ce go/go1.9.5 git-commit/9ee9f40 kernel/4.15.0-24-generic os/linux arch/amd64 UpstreamClient(Docker-Client/18.03.1-ce \(linux\))"
portusbg | },
portusbg | "actor": {
portusbg | },
portusbg | "source": {
portusbg | "addr": "registry:5000",
portusbg | "instanceID": "5b6a2f58-85ba-4dee-b6ae-0a68bc21c1a5"
portusbg | }
portusbg | }
portusbg | Cannot find user


Configuration of registry:

version: 0.1
log:
fields:
service: registry
storage:
cache:
blobdescriptor: inmemory
filesystem:
rootdirectory: /var/lib/registry
http:
addr: :5000
headers:
X-Content-Type-Options: [nosniff]
health:
storagedriver:
enabled: true
interval: 10s
threshold: 3
notifications:
endpoints:
- name: portus
url: https://{portusFQDN}/v2/webhooks/events
timeout: 2000ms
threshold: 5
backoff: 1s


Compose file of docker registry:

version: '3'
services:
registry:
restart: always
image: library/registry:2.6
hostname: registry
container_name: registry
ports:
- "5003:5000"
env_file:
- "./registry.env"
volumes:
- "./certs:/certs"
- "./config:/etc/docker/registry"


Environment file for docker registry:

REGISTRY_HTTP_TLS_CERTIFICATE=/certs/{mycertificate}.crt
REGISTRY_HTTP_TLS_KEY=/certs/{mykey}.key


Compose file for portus:

version: '3'
services:
portus:
image: opensuse/portus
restart: always
container_name: portus
hostname: portus
ports:
- "127.0.0.1:3000:3000"
volumes:
- "./certificates:/certificates"
- "./keys:/keys"
env_file:
- "./portus.env"
links:
- portusdb

portusbg:
image: opensuse/portus:head
restart: always
container_name: portusbg
depends_on:
- portus
- portusdb
env_file:
- "./portusbg.env"
volumes:
- "./certificates:/certificates"
- "./keys:/keys"
links:
- portusdb

portusdb:
image: postgres
restart: always
container_name: portusdb
hostname: portusdb
env_file:
- "./portusdb.env"


Environment files for portus:

#Main:
PORTUS_PASSWORD=password
PORTUS_DB_ADAPTER=postgresql
PORTUS_DB_HOST=portusdb
PORTUS_DB_USERNAME=portus
PORTUS_DB_PASSWORD=password
PORTUS_DB_DATABASE=portus
PORTUS_DB_PORT=5432
PORTUS_DB_TIMEOUT=30
PORTUS_DB_POOL=5
PORTUS_SECRET_KEY_BASE={key}
PORTUS_KEY_PATH=/keys/{mykey}.key
RAILS_SERVE_STATIC_FILES=true
PORTUS_CHECK_SSL_USAGE_ENABLED=false
PORTUS_MACHINE_FQDN_VALUE={portusFQDN}


#Background:
PORTUS_MACHINE_FQDN_VALUE={portusFQDN}
PORTUS_DB_HOST=portusdb
PORTUS_DB_ADAPTER=postgresql
PORTUS_DB_PASSWORD=password
PORTUS_DB_USERNAME=portus
PORTUS_DB_DATABASE=portus
PORTUS_BACKGROUND=true
PORTUS_SECRET_KEY_BASE={key}
PORTUS_KEY_PATH=/keys/{mykey}.key
PORTUS_PASSWORD=password


#Database:
POSTGRES_USER=portus
POSTGRES_PASSWORD=password
POSTGRES_DB=portus

Please help.
Regards, Artem.

@mrgavinconway001
Copy link

Same issue here.

@jannwe
Copy link

jannwe commented Oct 25, 2018

The same for me. Anyone an idea?

@lordemanonsr
Copy link

I'm having this same issue. Manually checking the registry the images get pushed fine. I just get the similar event response of 'Cannot find user'. Any guidance at all would be appreciated. Exactly what user where is it expecting to find?

@lordemanonsr
Copy link

Fixed the issue. Discovered the details of Registry and Token authentication and I had Token info for the Registry configured incorrectly. Set that up correctly and now events and pushes are processed.

@TechCatOther
Copy link

@lordemanonsr Do you have actor null too?

I think that portus parse actor string in push event.

  "actor": {
  },

That in log writed:

User Load (0.3ms)  SELECT  `users`.* FROM `users` WHERE `users`.`username` IS NULL LIMIT 1

@stale
Copy link

stale bot commented Mar 19, 2019

Thanks for all your contributions!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Mar 19, 2019
@stale stale bot closed this as completed Mar 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants