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

Issue on starting the registry container as a non-root user #999

Open joda70 opened 9 years ago

joda70 commented 9 years ago

I am not sure this issue is in the right place. However, I am going to explain my current problem. I would like to run the service docker-registry with non-root permission.

In the local volume there are the following permissions: ls -al /opt/docker-registry/ total 0 drwxrwxrwx. 3 registry registry 17 11 mag 14.57 . drwxr-xr-x. 3 root root 28 11 mag 14.57 .. drwxr-xr-x. 2 registry registry 6 11 mag 14.57 data

So I run the registry: docker run -p 80:5000 -v /etc/group:/etc/group -v /etc/passwd:/etc/passwd --user registry:registry -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 ppregistry registry ... [2015-05-11 14:59:49 +0000] [14] [ERROR] Exception in worker process: ...

Can you suggest anything?

dmp42 commented 9 years ago

Can you copy the actual exception and log around it?

joda70 commented 9 years ago

docker run -p 80:5000 -v /etc/group:/etc/group -v /etc/passwd:/etc/passwd --user registry:registry -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 basic_registry registry [2015-05-12 11:02:09 +0000] [1] [INFO] Starting gunicorn 19.1.1 [2015-05-12 11:02:09 +0000] [1] [INFO] Listening at: http://0.0.0.0:5000 (1) [2015-05-12 11:02:09 +0000] [1] [INFO] Using worker: gevent [2015-05-12 11:02:09 +0000] [13] [INFO] Booting worker with pid: 13 [2015-05-12 11:02:09 +0000] [14] [INFO] Booting worker with pid: 14 [2015-05-12 11:02:09 +0000] [15] [INFO] Booting worker with pid: 15 [2015-05-12 11:02:10 +0000] [16] [INFO] Booting worker with pid: 16 12/May/2015:11:02:10 +0000 WARNING: Cache storage disabled! 12/May/2015:11:02:10 +0000 WARNING: Cache storage disabled! 12/May/2015:11:02:10 +0000 WARNING: LRU cache disabled! 12/May/2015:11:02:10 +0000 WARNING: LRU cache disabled! 12/May/2015:11:02:10 +0000 WARNING: Cache storage disabled! 12/May/2015:11:02:10 +0000 WARNING: LRU cache disabled! 12/May/2015:11:02:10 +0000 WARNING: Cache storage disabled! 12/May/2015:11:02:10 +0000 WARNING: LRU cache disabled! 12/May/2015:11:02:10 +0000 DEBUG: Will return docker-registry.drivers.file.Storage 12/May/2015:11:02:10 +0000 DEBUG: Will return docker-registry.drivers.file.Storage 12/May/2015:11:02:10 +0000 DEBUG: Will return docker-registry.drivers.file.Storage 12/May/2015:11:02:10 +0000 DEBUG: Will return docker-registry.drivers.file.Storage [2015-05-12 11:02:10 +0000] [14] [ERROR] Exception in worker process: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 507, in spawn_worker worker.init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 193, in init_process super(GeventWorker, self).init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 114, in init_process self.wsgi = self.app.wsgi() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 66, in wsgi self.callable = self.load() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load return self.load_wsgiapp() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 356, in import_app import(module) File "/usr/local/lib/python2.7/dist-packages/docker_registry/wsgi.py", line 27, in from .search import * # noqa File "/usr/local/lib/python2.7/dist-packages/docker_registry/search.py", line 14, in INDEX = index.load(cfg.search_backend.lower()) File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/init.py", line 82, in load return db.SQLAlchemyIndex() File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/db.py", line 86, in init self._setup_database() File "/usr/local/lib/python2.7/dist-packages/docker_registry/toolkit.py", line 325, in wrapper lock_file = open(lock_path, 'w') IOError: [Errno 13] Permission denied: './registry._setup_database.lock' Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 507, in spawn_worker worker.init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 193, in init_process super(GeventWorker, self).init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 114, in init_process self.wsgi = self.app.wsgi() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 66, in wsgi self.callable = self.load() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load return self.load_wsgiapp() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 356, in import_app import(module) File "/usr/local/lib/python2.7/dist-packages/docker_registry/wsgi.py", line 27, in from .search import * # noqa File "/usr/local/lib/python2.7/dist-packages/docker_registry/search.py", line 14, in INDEX = index.load(cfg.search_backend.lower()) File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/init.py", line 82, in load return db.SQLAlchemyIndex() File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/db.py", line 86, in init self._setup_database() File "/usr/local/lib/python2.7/dist-packages/docker_registry/toolkit.py", line 325, in wrapper lock_file = open(lock_path, 'w') IOError: [Errno 13] Permission denied: './registry._setup_database.lock' [2015-05-12 11:02:10 +0000] [16] [ERROR] Exception in worker process: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 507, in spawn_worker worker.init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 193, in init_process super(GeventWorker, self).init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 114, in init_process self.wsgi = self.app.wsgi() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 66, in wsgi self.callable = self.load() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load return self.load_wsgiapp() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 356, in import_app import(module) File "/usr/local/lib/python2.7/dist-packages/docker_registry/wsgi.py", line 27, in from .search import * # noqa File "/usr/local/lib/python2.7/dist-packages/docker_registry/search.py", line 14, in INDEX = index.load(cfg.search_backend.lower()) File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/init.py", line 82, in load return db.SQLAlchemyIndex() File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/db.py", line 86, in init self._setup_database() File "/usr/local/lib/python2.7/dist-packages/docker_registry/toolkit.py", line 325, in wrapper lock_file = open(lock_path, 'w') IOError: [Errno 13] Permission denied: './registry._setup_database.lock' Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 507, in spawn_worker worker.init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 193, in init_process super(GeventWorker, self).init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 114, in init_process self.wsgi = self.app.wsgi() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 66, in wsgi self.callable = self.load() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load return self.load_wsgiapp() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 356, in import_app import(module) File "/usr/local/lib/python2.7/dist-packages/docker_registry/wsgi.py", line 27, in from .search import * # noqa File "/usr/local/lib/python2.7/dist-packages/docker_registry/search.py", line 14, in INDEX = index.load(cfg.search_backend.lower()) File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/init.py", line 82, in load return db.SQLAlchemyIndex() File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/db.py", line 86, in init self._setup_database() File "/usr/local/lib/python2.7/dist-packages/docker_registry/toolkit.py", line 325, in wrapper lock_file = open(lock_path, 'w') IOError: [Errno 13] Permission denied: './registry._setup_database.lock' [2015-05-12 11:02:10 +0000] [14] [INFO] Worker exiting (pid: 14) [2015-05-12 11:02:10 +0000] [16] [INFO] Worker exiting (pid: 16) [2015-05-12 11:02:10 +0000] [13] [ERROR] Exception in worker process: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 507, in spawn_worker worker.init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 193, in init_process super(GeventWorker, self).init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 114, in init_process self.wsgi = self.app.wsgi() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 66, in wsgi self.callable = self.load() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load return self.load_wsgiapp() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 356, in import_app import(module) File "/usr/local/lib/python2.7/dist-packages/docker_registry/wsgi.py", line 27, in from .search import * # noqa File "/usr/local/lib/python2.7/dist-packages/docker_registry/search.py", line 14, in INDEX = index.load(cfg.search_backend.lower()) File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/init.py", line 82, in load return db.SQLAlchemyIndex() File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/db.py", line 86, in init self._setup_database() File "/usr/local/lib/python2.7/dist-packages/docker_registry/toolkit.py", line 325, in wrapper lock_file = open(lock_path, 'w') IOError: [Errno 13] Permission denied: './registry._setup_database.lock' Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 507, in spawn_worker worker.init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 193, in init_process super(GeventWorker, self).init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 114, in init_process self.wsgi = self.app.wsgi() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 66, in wsgi self.callable = self.load() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load return self.load_wsgiapp() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 356, in import_app import(module) File "/usr/local/lib/python2.7/dist-packages/docker_registry/wsgi.py", line 27, in from .search import * # noqa File "/usr/local/lib/python2.7/dist-packages/docker_registry/search.py", line 14, in INDEX = index.load(cfg.search_backend.lower()) File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/init.py", line 82, in load return db.SQLAlchemyIndex() File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/db.py", line 86, in init self._setup_database() File "/usr/local/lib/python2.7/dist-packages/docker_registry/toolkit.py", line 325, in wrapper lock_file = open(lock_path, 'w') IOError: [Errno 13] Permission denied: './registry._setup_database.lock' [2015-05-12 11:02:10 +0000] [13] [INFO] Worker exiting (pid: 13) [2015-05-12 11:02:10 +0000] [15] [ERROR] Exception in worker process: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 507, in spawn_worker worker.init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 193, in init_process super(GeventWorker, self).init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 114, in init_process self.wsgi = self.app.wsgi() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 66, in wsgi self.callable = self.load() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load return self.load_wsgiapp() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 356, in import_app import(module) File "/usr/local/lib/python2.7/dist-packages/docker_registry/wsgi.py", line 27, in from .search import * # noqa File "/usr/local/lib/python2.7/dist-packages/docker_registry/search.py", line 14, in INDEX = index.load(cfg.search_backend.lower()) File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/init.py", line 82, in load return db.SQLAlchemyIndex() File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/db.py", line 86, in init self._setup_database() File "/usr/local/lib/python2.7/dist-packages/docker_registry/toolkit.py", line 325, in wrapper lock_file = open(lock_path, 'w') IOError: [Errno 13] Permission denied: './registry._setup_database.lock' Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 507, in spawn_worker worker.init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 193, in init_process super(GeventWorker, self).init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 114, in init_process self.wsgi = self.app.wsgi() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 66, in wsgi self.callable = self.load() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load return self.load_wsgiapp() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 356, in import_app import(module) File "/usr/local/lib/python2.7/dist-packages/docker_registry/wsgi.py", line 27, in from .search import * # noqa File "/usr/local/lib/python2.7/dist-packages/docker_registry/search.py", line 14, in INDEX = index.load(cfg.search_backend.lower()) File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/init.py", line 82, in load return db.SQLAlchemyIndex() File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/db.py", line 86, in init self._setup_database() File "/usr/local/lib/python2.7/dist-packages/docker_registry/toolkit.py", line 325, in wrapper lock_file = open(lock_path, 'w') IOError: [Errno 13] Permission denied: './registry._setup_database.lock' [2015-05-12 11:02:10 +0000] [15] [INFO] Worker exiting (pid: 15) [2015-05-12 11:02:10 +0000] [1] [INFO] Shutting down: Master [2015-05-12 11:02:10 +0000] [1] [INFO] Reason: Worker failed to boot.

In the local volume I have: ls -al docker-registry/data/ total 4 drwxr-xr-x. 4 registry registry 38 11 mag 15.59 . drwxr-xr-x. 3 registry registry 42 11 mag 15.59 .. drwxr-xr-x. 7 registry registry 4096 11 mag 15.59 images drwxr-xr-x. 3 registry registry 20 11 mag 15.59 repositories

RichardScothern commented 9 years ago

I see the following in your logs. Do you have permissions for that directory? Can you touch a file there with non-root?

_> IOError: [Errno 13] Permission denied: './registry.setupdatabase.lock'

On Tue, May 12, 2015 at 4:03 AM, joda70 notifications@github.com wrote:

docker run -p 80:5000 -v /etc/group:/etc/group -v /etc/passwd:/etc/passwd --user registry:registry -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 -e INDEX_ENDPOINT=http://docker.cloud.cnaf.infn.it --name basic_registry registry [2015-05-12 11:02:09 +0000] [1] [INFO] Starting gunicorn 19.1.1 [2015-05-12 11:02:09 +0000] [1] [INFO] Listening at: http://0.0.0.0:5000 (1) [2015-05-12 11:02:09 +0000] [1] [INFO] Using worker: gevent [2015-05-12 11:02:09 +0000] [13] [INFO] Booting worker with pid: 13 [2015-05-12 11:02:09 +0000] [14] [INFO] Booting worker with pid: 14 [2015-05-12 11:02:09 +0000] [15] [INFO] Booting worker with pid: 15 [2015-05-12 11:02:10 +0000] [16] [INFO] Booting worker with pid: 16 12/May/2015:11:02:10 +0000 WARNING: Cache storage disabled! 12/May/2015:11:02:10 +0000 WARNING: Cache storage disabled! 12/May/2015:11:02:10 +0000 WARNING: LRU cache disabled! 12/May/2015:11:02:10 +0000 WARNING: LRU cache disabled! 12/May/2015:11:02:10 +0000 WARNING: Cache storage disabled! 12/May/2015:11:02:10 +0000 WARNING: LRU cache disabled! 12/May/2015:11:02:10 +0000 WARNING: Cache storage disabled! 12/May/2015:11:02:10 +0000 WARNING: LRU cache disabled! 12/May/2015:11:02:10 +0000 DEBUG: Will return docker-registry.drivers.file.Storage 12/May/2015:11:02:10 +0000 DEBUG: Will return docker-registry.drivers.file.Storage 12/May/2015:11:02:10 +0000 DEBUG: Will return docker-registry.drivers.file.Storage 12/May/2015:11:02:10 +0000 DEBUG: Will return docker-registry.drivers.file.Storage [2015-05-12 11:02:10 +0000] [14] [ERROR] Exception in worker process: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 507, in spawn_worker worker.init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 193, in init_process super(GeventWorker, self).init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 114, in init_process self.wsgi = self.app.wsgi() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 66, in wsgi self.callable = self.load() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load return self.load_wsgiapp() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 356, in import_app import(module) File "/usr/local/lib/python2.7/dist-packages/docker_registry/wsgi.py", line 27, in from .search import * # noqa File "/usr/local/lib/python2.7/dist-packages/docker_registry/search.py", line 14, in INDEX = index.load(cfg.search_backend.lower()) File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/ init.py", line 82, in load return db.SQLAlchemyIndex() File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/db.py", line 86, in init self.

_setup_database() File "/usr/local/lib/python2.7/dist-packages/docker_registry/toolkit.py", line 325, in wrapper lock_file = open(lock_path, 'w') IOError: [Errno 13] Permission denied: './registry.setup_database.lock' Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 507, in spawn_worker worker.init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 193, in init_process super(GeventWorker, self).init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 114, in init_process self.wsgi = self.app.wsgi() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 66, in wsgi self.callable = self.load() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load return self.load_wsgiapp() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 356, in import_app _import(module) File "/usr/local/lib/python2.7/dist-packages/docker_registry/wsgi.py", line 27, in from .search import * # noqa File "/usr/local/lib/python2.7/dist-packages/docker_registry/search.py", line 14, in INDEX = index.load(cfg.search_backend.lower()) File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/ init.py", line 82, in load return db.SQLAlchemyIndex() File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/db.py", line 86, in init self.

_setup_database() File "/usr/local/lib/python2.7/dist-packages/docker_registry/toolkit.py", line 325, in wrapper lock_file = open(lock_path, 'w') IOError: [Errno 13] Permission denied: './registry.setup_database.lock' [2015-05-12 11:02:10 +0000] [16] [ERROR] Exception in worker process: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 507, in spawn_worker worker.init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 193, in init_process super(GeventWorker, self).init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 114, in init_process self.wsgi = self.app.wsgi() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 66, in wsgi self.callable = self.load() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load return self.load_wsgiapp() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 356, in import_app _import(module) File "/usr/local/lib/python2.7/dist-packages/docker_registry/wsgi.py", line 27, in from .search import * # noqa File "/usr/local/lib/python2.7/dist-packages/docker_registry/search.py", line 14, in INDEX = index.load(cfg.search_backend.lower()) File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/ init.py", line 82, in load return db.SQLAlchemyIndex() File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/db.py", line 86, in init self.

_setup_database() File "/usr/local/lib/python2.7/dist-packages/docker_registry/toolkit.py", line 325, in wrapper lock_file = open(lock_path, 'w') IOError: [Errno 13] Permission denied: './registry.setup_database.lock' Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 507, in spawn_worker worker.init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 193, in init_process super(GeventWorker, self).init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 114, in init_process self.wsgi = self.app.wsgi() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 66, in wsgi self.callable = self.load() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load return self.load_wsgiapp() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 356, in import_app _import(module) File "/usr/local/lib/python2.7/dist-packages/docker_registry/wsgi.py", line 27, in from .search import * # noqa File "/usr/local/lib/python2.7/dist-packages/docker_registry/search.py", line 14, in INDEX = index.load(cfg.search_backend.lower()) File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/ init.py", line 82, in load return db.SQLAlchemyIndex() File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/db.py", line 86, in init self.

_setup_database() File "/usr/local/lib/python2.7/dist-packages/docker_registry/toolkit.py", line 325, in wrapper lock_file = open(lock_path, 'w') IOError: [Errno 13] Permission denied: './registry.setup_database.lock' [2015-05-12 11:02:10 +0000] [14] [INFO] Worker exiting (pid: 14) [2015-05-12 11:02:10 +0000] [16] [INFO] Worker exiting (pid: 16) [2015-05-12 11:02:10 +0000] [13] [ERROR] Exception in worker process: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 507, in spawn_worker worker.init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 193, in init_process super(GeventWorker, self).init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 114, in init_process self.wsgi = self.app.wsgi() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 66, in wsgi self.callable = self.load() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load return self.load_wsgiapp() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 356, in import_app _import(module) File "/usr/local/lib/python2.7/dist-packages/docker_registry/wsgi.py", line 27, in from .search import * # noqa File "/usr/local/lib/python2.7/dist-packages/docker_registry/search.py", line 14, in INDEX = index.load(cfg.search_backend.lower()) File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/ init.py", line 82, in load return db.SQLAlchemyIndex() File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/db.py", line 86, in init self.

_setup_database() File "/usr/local/lib/python2.7/dist-packages/docker_registry/toolkit.py", line 325, in wrapper lock_file = open(lock_path, 'w') IOError: [Errno 13] Permission denied: './registry.setup_database.lock' Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 507, in spawn_worker worker.init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 193, in init_process super(GeventWorker, self).init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 114, in init_process self.wsgi = self.app.wsgi() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 66, in wsgi self.callable = self.load() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load return self.load_wsgiapp() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 356, in import_app _import(module) File "/usr/local/lib/python2.7/dist-packages/docker_registry/wsgi.py", line 27, in from .search import * # noqa File "/usr/local/lib/python2.7/dist-packages/docker_registry/search.py", line 14, in INDEX = index.load(cfg.search_backend.lower()) File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/ init.py", line 82, in load return db.SQLAlchemyIndex() File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/db.py", line 86, in init self.

_setup_database() File "/usr/local/lib/python2.7/dist-packages/docker_registry/toolkit.py", line 325, in wrapper lock_file = open(lock_path, 'w') IOError: [Errno 13] Permission denied: './registry.setup_database.lock' [2015-05-12 11:02:10 +0000] [13] [INFO] Worker exiting (pid: 13) [2015-05-12 11:02:10 +0000] [15] [ERROR] Exception in worker process: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 507, in spawn_worker worker.init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 193, in init_process super(GeventWorker, self).init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 114, in init_process self.wsgi = self.app.wsgi() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 66, in wsgi self.callable = self.load() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load return self.load_wsgiapp() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 356, in import_app _import(module) File "/usr/local/lib/python2.7/dist-packages/docker_registry/wsgi.py", line 27, in from .search import * # noqa File "/usr/local/lib/python2.7/dist-packages/docker_registry/search.py", line 14, in INDEX = index.load(cfg.search_backend.lower()) File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/ init.py", line 82, in load return db.SQLAlchemyIndex() File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/db.py", line 86, in init self.

_setup_database() File "/usr/local/lib/python2.7/dist-packages/docker_registry/toolkit.py", line 325, in wrapper lock_file = open(lock_path, 'w') IOError: [Errno 13] Permission denied: './registry.setup_database.lock' Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 507, in spawn_worker worker.init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 193, in init_process super(GeventWorker, self).init_process() File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 114, in init_process self.wsgi = self.app.wsgi() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 66, in wsgi self.callable = self.load() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load return self.load_wsgiapp() File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 356, in import_app _import(module) File "/usr/local/lib/python2.7/dist-packages/docker_registry/wsgi.py", line 27, in from .search import * # noqa File "/usr/local/lib/python2.7/dist-packages/docker_registry/search.py", line 14, in INDEX = index.load(cfg.search_backend.lower()) File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/ init.py", line 82, in load return db.SQLAlchemyIndex() File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/index/db.py", line 86, in init self._setup_database() File "/usr/local/lib/python2.7/dist-packages/docker_registry/toolkit.py", line 325, in wrapper lock_file = open(lock_path, 'w') IOError: [Errno 13] Permission denied: './registry._setup_database.lock' [2015-05-12 11:02:10 +0000] [15] [INFO] Worker exiting (pid: 15) [2015-05-12 11:02:10 +0000] [1] [INFO] Shutting down: Master [2015-05-12 11:02:10 +0000] [1] [INFO] Reason: Worker failed to boot.

In the local volume I have: ls -al docker-registry/data/ total 4 drwxr-xr-x. 4 registry registry 38 11 mag 15.59 . drwxr-xr-x. 3 registry registry 42 11 mag 15.59 .. drwxr-xr-x. 7 registry registry 4096 11 mag 15.59 images drwxr-xr-x. 3 registry registry 20 11 mag 15.59 repositories

— Reply to this email directly or view it on GitHub https://github.com/docker/docker-registry/issues/999#issuecomment-101236545 .

joda70 commented 9 years ago

It seems that I have the same problem as the one specified in #915

joda70 commented 9 years ago

On the local machine, I was able to create a file in the /opt/docker-registry by using the registry user. On the other hand, I obtained permission denied

IOError: [Errno 13] Permission denied: './registry._setup_database.lock'

when I run the registry container that I got from

docker.io/registry latest

docker run -p 80:5000 -v /etc/group:/etc/group -v /etc/passwd:/etc/passwd --user registry:registry -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 basic_registry registry