Project

Profile

Help

Issue #4537

closed

Pulp returns 200 when it fails to create rpm content

Added by bherring about 5 years ago. Updated over 3 years 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 - CURRENTRELEASEppickaActions
Actions #1

Updated by bherring about 5 years ago

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

Updated by bmbouter almost 5 years ago

  • Tags deleted (Pulp 3)
Actions #3

Updated by dalley over 3 years 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
Actions #4

Updated by ggainey over 3 years 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 ~]$

Also available in: Atom PDF