docker-archive / docker-registry

This is **DEPRECATED**! Please go to https://github.com/docker/distribution
Apache License 2.0
2.88k stars 877 forks source link

FATA[0000] #998

Open joda70 opened 9 years ago

joda70 commented 9 years ago

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 commented 9 years ago

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]

dmp42 commented 9 years ago

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)

joda70 commented 9 years ago

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.

dmp42 commented 9 years ago

For the second problem I disabled selinux.

Makes sense. You are on RedHat, or Fedora?

joda70 commented 9 years ago

I am using

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