Project

Profile

Help

Issue #4537

Pulp returns 200 when it fails to create rpm content

Added by bherring almost 2 years ago. Updated about 1 month ago.

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

Description

Steps to reproduce:

$ echo "blah" > foo-4.1-1.noarch.rpm
$ http --form POST http://localhost:8000/pulp/api/v3/artifacts/ file@./foo-4.1-1.noarch.rpm
$ http POST http://localhost:8000/pulp/api/v3/content/rpm/packages/ relative_path=foo.rpm _artifact="/pulp/api/v3/artifacts/1/" filename=foo-4.1-1.noarch.rpm

The response correctly shows an error ("RPM file cannot be parsed for metadata.") but the http status code is 200.


Related issues

Copied from RPM Support - Issue #4471: Pulp returns 200 when it fails to create rpm contentCLOSED - CURRENTRELEASE<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#1 Updated by bherring almost 2 years ago

  • Copied from Issue #4471: Pulp returns 200 when it fails to create rpm content added

#2 Updated by bmbouter over 1 year ago

  • Tags deleted (Pulp 3)

#3 Updated by dalley about 1 month ago

  • Tracker changed from Test to Issue
  • Severity set to 2. Medium
  • Triaged set to No
  • Groomed set to No
  • Sprint Candidate set to No

#4 Updated by ggainey about 1 month ago

  • Status changed from NEW to CLOSED - WONTFIX

I think things have changed since this was opened. POST /pulp/api/v3/content/rpm/packages/ now returns a task-href; following the scenario above now looks like the below, which is Working As Designed I believe. Closing.

(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 ~]$ echo "blah" > foo-4.1-1.noarch.rpm
(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 ~]$ http --form POST :/pulp/api/v3/artifacts/ file@./foo-4.1-1.noarch.rpm
HTTP/1.1 201 Created
{
    "file": "artifact/41/af286dc0b172ed2f1ca934fd2278de4a1192302ffa07087cea2682e7d372e3",
...
    "pulp_href": "/pulp/api/v3/artifacts/117fa591-fcc9-431e-969c-db9fe9b035c8/",
...
}
(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 ~]$ http POST :/pulp/api/v3/content/rpm/packages/ relative_path=foo.rpm artifact="/pulp/api/v3/artifacts/117fa591-fcc9-431e-969c-db9fe9b035c8/"
HTTP/1.1 202 Accepted
{
    "task": "/pulp/api/v3/tasks/9c406b26-19dd-4201-8980-0fa2c66e5691/"
}
(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 ~]$ http :/pulp/api/v3/tasks/9c406b26-19dd-4201-8980-0fa2c66e5691/
HTTP/1.1 200 OK
{
    "child_tasks": [],
    "created_resources": [],
    "error": {
        "description": "RPM file cannot be parsed for metadata.",
        "traceback": "  File \"/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/worker.py\", line 975, in perform_job\n    rv = job.perform()\n  File \"/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py\", line 696, in perform\n    self._result = self._execute()\n  File \"/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py\", line 719, in _execute\n    return self.func(*self.args, **self.kwargs)\n  File \"/home/vagrant/devel/pulpcore/pulpcore/app/tasks/base.py\", line 34, in general_create\n    serializer.is_valid(raise_exception=True)\n  File \"/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/serializers.py\", line 220, in is_valid\n    self._validated_data = self.run_validation(self.initial_data)\n  File \"/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/serializers.py\", line 422, in run_validation\n    value = self.validate(value)\n  File \"/home/vagrant/devel/pulpcore/pulpcore/plugin/serializers/content.py\", line 104, in validate\n    data = self.deferred_validate(data)\n  File \"/home/vagrant/devel/pulp_rpm/pulp_rpm/app/serializers/package.py\", line 240, in deferred_validate\n    raise NotAcceptable(detail=\"RPM file cannot be parsed for metadata.\")\n"
    },
    "finished_at": "2020-12-10T18:17:35.345693Z",
    "logging_cid": "68e10e3bbc3a4d86b57c4472b8a80461",
    "name": "pulpcore.app.tasks.base.general_create",
    "parent_task": null,
    "progress_reports": [],
    "pulp_created": "2020-12-10T18:17:35.013049Z",
    "pulp_href": "/pulp/api/v3/tasks/9c406b26-19dd-4201-8980-0fa2c66e5691/",
    "reserved_resources_record": [
        "/pulp/api/v3/artifacts/117fa591-fcc9-431e-969c-db9fe9b035c8/"
    ],
    "started_at": "2020-12-10T18:17:35.167444Z",
    "state": "failed",
    "task_group": null,
    "worker": "/pulp/api/v3/workers/afa23f04-3490-4c49-a375-fed6153cdacb/"
}
(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 ~]$

Please register to edit this issue

Also available in: Atom PDF