Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 500 error when registry content is missing on the filesystem #555

Closed
ipanova opened this issue Jan 27, 2022 · 0 comments · Fixed by #556
Closed

Fix 500 error when registry content is missing on the filesystem #555

ipanova opened this issue Jan 27, 2022 · 0 comments · Fixed by #556
Assignees

Comments

@ipanova
Copy link
Member

ipanova commented Jan 27, 2022

Jan 26 16:39:55 rn000052275 gunicorn[238574]: pulp [-]:  - - [26/Jan/2022:22:39:55 +0000] "HEAD /v2/ee-supported-rhel8/blobs/sha256:1e6a9467750ba441584f9678e1537abd9e3b028f063da3994befd760452196f3 HTTP/1.0" 302 0 "-" "skopeo/1.4.2-dev"
Jan 26 16:39:55 rn000052275 gunicorn[238573]: [2022-01-26 22:39:55 +0000] [238656] [ERROR] Error handling request
Jan 26 16:39:55 rn000052275 gunicorn[238573]: Traceback (most recent call last):
Jan 26 16:39:55 rn000052275 gunicorn[238573]:  File "/usr/lib64/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
Jan 26 16:39:55 rn000052275 gunicorn[238573]:    resp = await self._request_handler(request)
Jan 26 16:39:55 rn000052275 gunicorn[238573]:  File "/usr/lib64/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
Jan 26 16:39:55 rn000052275 gunicorn[238573]:    resp = await handler(request)
Jan 26 16:39:55 rn000052275 gunicorn[238573]:  File "/usr/lib64/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
Jan 26 16:39:55 rn000052275 gunicorn[238573]:    return await handler(request)
Jan 26 16:39:55 rn000052275 gunicorn[238573]:  File "/usr/lib/python3.8/site-packages/pulpcore/content/authentication.py", line 35, in authenticate
Jan 26 16:39:55 rn000052275 gunicorn[238573]:    return await handler(request)
Jan 26 16:39:55 rn000052275 gunicorn[238573]:  File "/usr/lib/python3.8/site-packages/pulp_container/app/registry.py", line 269, in get_by_digest
Jan 26 16:39:55 rn000052275 gunicorn[238573]:    return await Registry._dispatch(artifact.file, headers)
Jan 26 16:39:55 rn000052275 gunicorn[238573]:  File "/usr/lib/python3.8/site-packages/pulp_container/app/registry.py", line 78, in _dispatch
Jan 26 16:39:55 rn000052275 gunicorn[238573]:    full_headers["Content-Length"] = str(file.size)
Jan 26 16:39:55 rn000052275 gunicorn[238573]:  File "/usr/lib/python3.8/site-packages/django/db/models/fields/files.py", line 71, in size
Jan 26 16:39:55 rn000052275 gunicorn[238573]:    return self.storage.size(self.name)
Jan 26 16:39:55 rn000052275 gunicorn[238573]:  File "/usr/lib/python3.8/site-packages/django/core/files/storage.py", line 334, in size
Jan 26 16:39:55 rn000052275 gunicorn[238573]:    return os.path.getsize(self.path(name))
Jan 26 16:39:55 rn000052275 gunicorn[238573]:  File "/usr/lib64/python3.8/genericpath.py", line 50, in getsize
Jan 26 16:39:55 rn000052275 gunicorn[238573]:    return os.stat(filename).st_size
Jan 26 16:39:55 rn000052275 gunicorn[238573]: FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/pulp/media/artifact/1e/6a9467750ba441584f9678e1537abd9e3b028f063da3994befd760452196f3'
Jan 26 16:39:55 rn000052275 gunicorn[238573]: [26/Jan/2022:22:39:55 +0000] "HEAD /pulp/container/ee-supported-rhel8/blobs/sha256:1e6a9467750ba441584f9678e1537abd9e3b028f063da3994befd760452196f3?

This happened when a new pulp server was provisioned, pointed at an existing database. I was able to reproduce the error by just nuking things under /var/lib/pulp/media/artifact/.

ipanova added a commit to ipanova/pulp_container that referenced this issue Jan 27, 2022
ipanova added a commit to ipanova/pulp_container that referenced this issue Jan 27, 2022
ipanova added a commit to ipanova/pulp_container that referenced this issue Feb 1, 2022
ipanova added a commit to ipanova/pulp_container that referenced this issue Feb 1, 2022
ipanova added a commit to ipanova/pulp_container that referenced this issue Feb 1, 2022
ipanova added a commit to ipanova/pulp_container that referenced this issue Feb 1, 2022
ipanova added a commit to ipanova/pulp_container that referenced this issue Feb 1, 2022
ipanova added a commit to ipanova/pulp_container that referenced this issue Feb 2, 2022
ipanova added a commit to ipanova/pulp_container that referenced this issue Feb 21, 2022
ipanova added a commit to ipanova/pulp_container that referenced this issue Feb 21, 2022
@ipanova ipanova self-assigned this Feb 22, 2022
patchback bot pushed a commit that referenced this issue Mar 4, 2022
patchback bot pushed a commit that referenced this issue Mar 4, 2022
patchback bot pushed a commit that referenced this issue Mar 4, 2022
ipanova added a commit that referenced this issue Mar 4, 2022
ipanova added a commit that referenced this issue Mar 4, 2022
ipanova added a commit that referenced this issue Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant