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/"
}
Actions #1

Updated by daviddavis about 5 years ago

  • Description updated (diff)
  • Status changed from NEW to POST
  • Assignee set to daviddavis
  • Tags Katello-P2 added

Added by daviddavis about 5 years ago

Revision 800e70f7 | View on GitHub

Fix NoneType error when removing content units

fixes #5478 https://pulp.plan.io/issues/5478

Actions #2

Updated by daviddavis about 5 years ago

  • Status changed from POST to MODIFIED
Actions #3

Updated by rchan about 5 years ago

  • Sprint set to Sprint 59
Actions #4

Updated by bmbouter almost 5 years ago

  • Sprint/Milestone set to 3.0.0
Actions #5

Updated by bmbouter almost 5 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Actions #6

Updated by ggainey over 4 years ago

  • Tags Katello added
  • Tags deleted (Katello-P2)

Also available in: Atom PDF