docker-archive / docker-registry

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

Can't remove containers with Redis #962

Open deimosfr opened 9 years ago

deimosfr commented 9 years ago

Hi,

I got an issue with Redis. I can create, tag, everything except removing containers. Here is my configuration:

common: &common
  loglevel: _env:LOGLEVEL:info
  # By default, the registry acts standalone (eg: doesn't query the index)
  standalone: _env:STANDALONE:true
  # Storage redirect to allow S3
  storage_redirect: _env:STORAGE_REDIRECT
  # Token auth is enabled (if NOT standalone)
  disable_token_auth: _env:DISABLE_TOKEN_AUTH
  # No priv key
  privileged_key: _env:PRIVILEGED_KEY
  # No search backend
  search_backend: _env:SEARCH_BACKEND
  # SQLite search backend
  sqlalchemy_index_database: _env:SQLALCHEMY_INDEX_DATABASE:sqlite:///{{docker_registry_sqlalchemy_index_database}}
  cache:
    host: _env:REDIS_PORT_6379_TCP_ADDR
    port: _env:REDIS_PORT_6379_TCP_PORT
    db: 0
  cache_lru:
    host: _env:REDIS_PORT_6379_TCP_ADDR
    port: _env:REDIS_PORT_6379_TCP_PORT
    db: 1

local: &local
  <<: *common
  storage: local
  storage_path: _env:STORAGE_PATH:{{docker_registry_local_storage_path}}

prod: &prod
  <<: *local
  loglevel: _env:LOGLEVEL:info
  debug: _env:DEBUG:true
  search_backend: _env:SEARCH_BACKEND:sqlalchemy

dev: &dev
  <<: *local
  loglevel: _env:LOGLEVEL:debug
  debug: _env:DEBUG:true
  search_backend: _env:SEARCH_BACKEND:sqlalchemy

I've made a link between redis container and registry.

Any ideas ? Thanks

dmp42 commented 9 years ago

Can you clarify what you are trying to do exactly? (eg: command you are using, expected output, actual output). For now, I don't understand how/if this is related to the registry.

deimosfr commented 9 years ago

Hi,

Sorry for the delay. So regarding the command I'm using:

$ curl -X DELETE 'https://registry/v1/repositories/library/image-name/tags/0.3'
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request.  Either the server is overloaded or there is an error in the application.</p>

I do not have the issue without Redis. As said, I just have an issue with the delete request.

Thanks

dmp42 commented 9 years ago

Can you copy the logs from your registry when you get the 500 error?

DanielKerrigan commented 9 years ago

Hi @dmp42, I am also experiencing the same problem. I am using a similar command as the person above and I am receiving the same 500 internal server error. Here are the logs from the registry:

2015-06-17 15:07:01,090 ERROR: Exception on /v1/repositories/centos/tags/latest [DELETE]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python2.7/dist-packages/docker_registry/toolkit.py", line 306, in wrapper
    return f(namespace=namespace, repository=repository, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/docker_registry/toolkit.py", line 280, in wrapper
    return f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/docker_registry/tags.py", line 233, in _delete_tag
    delete_tag(namespace=namespace, repository=repository, tag=tag)
  File "/usr/local/lib/python2.7/dist-packages/docker_registry/tags.py", line 214, in delete_tag
    image = store.get_content(path=tag_path)
TypeError: wrapper() got an unexpected keyword argument 'path'