Project

Profile

Help

Test #4464

closed

Content delivery breaks if remote is deleted

Added by bherring about 5 years ago. Updated almost 5 years ago.

Status:
CLOSED - COMPLETE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
-
Version:
Platform Release:
Tags:
Sprint:
Quarter:

Description

Problem

It is possible to delete a Remote which is referenced by RemoteArtifacts that are part of a Publication/Repo. As cascading delete is used (https://github.com/pulp/pulp/blob/88a6ebf31de83a4877909fa93fd94bf122894838/pulpcore/app/models/content.py#L335), this will delete the RemoteArtifacts as well.

If such an artifact is retrieved via the content app and needs to be streamed, this will fail with an internal server error:

Dec 30 17:41:45 pulp3.dev gunicorn[23755]: Traceback (most recent call last):
Dec 30 17:41:45 pulp3.dev gunicorn[23755]:   File "/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/aiohttp/web_protocol.py", line 390, in start
Dec 30 17:41:45 pulp3.dev gunicorn[23755]:     resp = await self._request_handler(request)
Dec 30 17:41:45 pulp3.dev gunicorn[23755]:   File "/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/aiohttp/web_app.py", line 366, in _handle
Dec 30 17:41:45 pulp3.dev gunicorn[23755]:     resp = await handler(request)
Dec 30 17:41:45 pulp3.dev gunicorn[23755]:   File "/home/vagrant/devel/pulp/pulpcore/content/handler.py", line 65, in stream_content
Dec 30 17:41:45 pulp3.dev gunicorn[23755]:     return await self._match_and_stream(path, request)
Dec 30 17:41:45 pulp3.dev gunicorn[23755]:   File "/home/vagrant/devel/pulp/pulpcore/content/handler.py", line 179, in _match_and_stream
Dec 30 17:41:45 pulp3.dev gunicorn[23755]:     return await self._stream_content_artifact(request, web.StreamResponse(), ca)
Dec 30 17:41:45 pulp3.dev gunicorn[23755]:   File "/home/vagrant/devel/pulp/pulpcore/content/handler.py", line 223, in _stream_content_artifact
Dec 30 17:41:45 pulp3.dev gunicorn[23755]:     remote_artifact = content_artifact.remoteartifact_set.get()
Dec 30 17:41:45 pulp3.dev gunicorn[23755]:   File "/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
Dec 30 17:41:45 pulp3.dev gunicorn[23755]:     return getattr(self.get_queryset(), name)(*args, **kwargs)
Dec 30 17:41:45 pulp3.dev gunicorn[23755]:   File "/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/db/models/query.py", line 399, in get
Dec 30 17:41:45 pulp3.dev gunicorn[23755]:     self.model._meta.object_name
Dec 30 17:41:45 pulp3.dev gunicorn[23755]: pulpcore.app.models.content.RemoteArtifact.DoesNotExist: RemoteArtifact matching query does not exist.

Possible solutions:

1. Block the deletion of the remote as long as referencing RemoteArtifacts exist
2. Return a 404 not found error


Related issues

Copied from Pulp - Issue #4289: Content delivery breaks if remote is deletedCLOSED - CURRENTRELEASEbmbouterActions
Actions #1

Updated by bherring about 5 years ago

  • Copied from Issue #4289: Content delivery breaks if remote is deleted added
Actions #2

Updated by bherring about 5 years ago

Triage Notes

  • lazy sync but don't let it downloaded
  • delete the remote
  • try to get the unit through a distribution;
  • Should get a 404 and NOT 500
  • see #4323 as related for HTTP return updates
Actions #3

Updated by daviddavis about 5 years ago

  • Tags deleted (Pulp 3 RC Blocker)
Actions #4

Updated by kersom about 5 years ago

  • Assignee set to kersom
Actions #5

Updated by kersom almost 5 years ago

  • Status changed from NEW to ASSIGNED

Added by kersom almost 5 years ago

Revision 73b9788f | View on GitHub

Add test to content delivery breaks if remote is deleted

Add test to verify that content delivery breaks if a remote - using lazy download policy, is deleted. Also verify that the content can be downloaded from Pulp once the remote is recreated and another sync is triggered.

https://pulp.plan.io/issues/4464 #4464

Actions #6

Updated by kersom almost 5 years ago

  • Status changed from ASSIGNED to MODIFIED
Actions #7

Updated by kersom almost 5 years ago

  • Status changed from MODIFIED to CLOSED - COMPLETE
Actions #8

Updated by bmbouter almost 5 years ago

  • Tags deleted (Pulp 3)

Also available in: Atom PDF