Project

Profile

Help

Issue #5478

closed

Removing all items from a repo that has no versions raises error

Added by daviddavis about 5 years ago. Updated over 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Katello
Sprint:
Sprint 59
Quarter:

Description

Steps to reproduce:

http :/pulp/api/v3/repostories/ name=foo
http :/pulp/api/v3/repositories/<uuid>/versions/ remove_content_units:="[\"*\"]"

Error:

                                                                                                                                            {                                                                                                                                           
    "_created": "2019-09-18T19:16:23.910811Z",                                                                                              
    "_href": "/pulp/api/v3/tasks/8ceebd1c-fb03-42b0-a1bb-8981ad665c68/",                                                                    
    "created_resources": [],                                                                                                                
    "error": {                                                                                                                              
        "description": "'NoneType' object has no attribute 'content'",                                                                      
        "traceback": "  File \"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/worker.py\", line 822, in perform_job\n    rv = job.perform()\n  File \"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py\", line 605, in perform\n    self._result = self._execute()\n  File \"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py\", line 611, in _execute\n    return self.func(*self.args, **self.kwargs)\n  File \"/home/vagrant/devel/pulpcore/pulpcore/app/tasks/repository.py\", line 92, in add_and_remove\n    remove_content_units = latest.content.values_list('pk', flat=True)\n"
    },
    "finished_at": "2019-09-18T19:16:24.157756Z",
    "name": "pulpcore.app.tasks.repository.add_and_remove",
    "non_fatal_errors": [],
    "parent": null,
    "progress_reports": [],
    "reserved_resources_record": [
        "/pulp/api/v3/repositories/885643cc-49ec-402f-840e-948bd341798c/"
    ],
    "spawned_tasks": [],
    "started_at": "2019-09-18T19:16:24.111274Z",
    "state": "failed",
    "worker": "/pulp/api/v3/workers/6bf34752-51ff-450a-96ca-5aa6c22d4c91/"
}

Also available in: Atom PDF