Project

Profile

Help

Issue #5478

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

Added by daviddavis 7 months ago. Updated 4 months ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Katello-P2
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:
Sprint 59

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/"
}

Associated revisions

Revision 800e70f7 View on GitHub
Added by daviddavis 7 months ago

Fix NoneType error when removing content units

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

History

#1 Updated by daviddavis 7 months ago

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

#2 Updated by daviddavis 7 months ago

  • Status changed from POST to MODIFIED

#3 Updated by rchan 6 months ago

  • Sprint set to Sprint 59

#4 Updated by bmbouter 4 months ago

  • Sprint/Milestone set to 3.0.0

#5 Updated by bmbouter 4 months ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF