docker-registry icon indicating copy to clipboard operation
docker-registry copied to clipboard

FATA[0000]

Open joda70 opened this issue 10 years ago • 5 comments

Using the latest image of registry and docker 1.5.0 on CENTOS.

I run the local docker-registry as follows:

$ docker run -p 80:5000 -v /opt/docker-registry:/reg -e STORAGE_PATH=/reg/data -e LOGLEVEL=debug -e DEBUG=true -e GUNICORN_OPTS=["--preload"] --name pregistry registry

Then to verify that I can store a tagged image on the specified STORAGE_PATH I run: $ docker tag allingeek/hello_world:latest localhost/hello-mine:latest $ docker push localhost/hello-mine The push refers to a repository [localhost/hello-mine](len: 1) Sending image list FATA[0000]

On the registry log I found: 2015-05-11 07:43:48,063 ERROR: Exception on /v1/repositories/hello-mine/ [PUT] IntegrityError: (IntegrityError) UNIQUE constraint failed: repository.name u'INSERT INTO repository (name, description) VALUES (?, ?)' ('library/hello-mine', '')

Do you have any suggestion?

joda70 avatar May 11 '15 07:05 joda70

Looking at #518 I have read that preload can be used if I do not need search. It is not my case.

$ docker run -p 80:5000 -v /opt/docker-registry:/reg -e STORAGE_PATH=/reg/data -e STORAGE_BACKEND=sqlalchemy -e SQLALCHEMY_INDEX_DATABASE:sqlite:////reg/docker-registry.db -e LOGLEVEL=debug -e DEBUG=true -e STANDALONE=true --name pregistry registry

.....

"GET /v2/ H"GET /v2/ HTTP/1.1" 404 233 "-" "Go 1.1 package http" 172.17.42.1 - - [11/May/2015:08:13:36 +0000] "GET /v1/_ping HTTP/1.1" 200 1539 "-" "Go 1.1 package http" 11/May/2015:08:13:36 +0000 DEBUG: args = {'namespace': 'library', 'repository': u'hello-mine'} 2015-05-11 08:13:37,739 ERROR: Exception on /v1/repositories/hello-mine/ [PUT]TTP/1.1" 404 233 "-" "Go 1.1 package http" 172.17.42.1 - - [11/May/2015:08:13:36 +0000] "GET /v1/_ping HTTP/1.1" 200 1539 "-" "Go 1.1 package http" 11/May/2015:08:13:36 +0000 DEBUG: args = {'namespace': 'library', 'repository': u'hello-mine'} 2015-05-11 08:13:37,739 ERROR: Exception on /v1/repositories/hello-mine/ [PUT] ..... OSError: [Errno 13] Permission denied: '/reg/data/repositories/library' 11/May/2015:08:13:37 +0000 ERROR: Exception on /v1/repositories/hello-mine/ [PUT]

joda70 avatar May 11 '15 08:05 joda70

From your first problem: your search index is corrupted. Disable search if you don't need it, otherwise delete the db and start over.

Second problem/comment: you don't have write access to your mounted folder apparently (/reg/data/repositories/library)

dmp42 avatar May 11 '15 14:05 dmp42

I fixed the first problem changing STORAGE_BACKEND in SEARCH_BACKEND and using = instead of : when I set SQLALCHEMY_INDEX_DATABASE:

docker run -p 80:5000 -v /opt/docker-registry:/reg -e STORAGE_PATH=/reg/data -e SEARCH_BACKEND=sqlalchemy -e SQLALCHEMY_INDEX_DATABASE=sqlite:////reg/docker-registry.db -e LOGLEVEL=debug -e DEBUG=true -e STANDALONE=true -e SETTINGS_FLAVOR=local --name pregistry registry

For the second problem I disabled selinux.

joda70 avatar May 11 '15 14:05 joda70

For the second problem I disabled selinux.

Makes sense. You are on RedHat, or Fedora?

dmp42 avatar May 11 '15 15:05 dmp42

I am using

cat /etc/redhat-release CentOS Linux release 7.1.1503 (Core)

joda70 avatar May 11 '15 15:05 joda70