Project

Profile

Help

Issue #5210

closed

pulp task status and version details returns 'serialized' ruby hashes in ruby bindings

Added by jsherril@redhat.com over 4 years ago. Updated almost 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:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
API Bindings, Katello
Sprint:
Sprint 57
Quarter:

Description

When fetching a task with the current bindings (), we get something like this:

{
   "_href":"/pulp/api/v3/tasks/3ba12450-d2dc-4fa9-9366-7d85990de332/",
   "_created":"2019-08-01T19:12:06.762+00:00",
   "state":"failed",
   "name":"pulp_file.app.tasks.synchronizing.synchronize",
   "started_at":"2019-08-01T19:12:06.863+00:00",
   "finished_at":"2019-08-01T19:12:07.083+00:00",
   "non_fatal_errors":"[]",
   "error":"{:code=\u003enil, :description=\u003e\"404, message='Not Found'\", :traceback=\u003e\"  File \\\"/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/worker.py\\\", line 822, in perform_job\\n    rv = job.perform()\\n  File \\\"/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py\\\", line 605, in perform\\n    self._result = self._execute()\\n  File \\\"/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py\\\", line 611, in _execute\\n    return self.func(*self.args, **self.kwargs)\\n  File \\\"/usr/local/lib/pulp/src/pulp-file/pulp_file/app/tasks/synchronizing.py\\\", line 45, in synchronize\\n    dv.create()\\n  File \\\"/usr/local/lib/pulp/src/pulpcore-plugin/pulpcore/plugin/stages/declarative_version.py\\\", line 169, in create\\n    loop.run_until_complete(pipeline)\\n  File \\\"/usr/lib64/python3.6/asyncio/base_events.py\\\", line 484, in run_until_complete\\n    return future.result()\\n  File \\\"/usr/local/lib/pulp/src/pulpcore-plugin/pulpcore/plugin/stages/api.py\\\", line 209, in create_pipeline\\n    await asyncio.gather(*futures)\\n  File \\\"/usr/local/lib/pulp/src/pulpcore-plugin/pulpcore/plugin/stages/api.py\\\", line 43, in __call__\\n    await self.run()\\n  File \\\"/usr/local/lib/pulp/src/pulp-file/pulp_file/app/tasks/synchronizing.py\\\", line 73, in run\\n    result = await downloader.run()\\n  File \\\"/usr/local/lib/pulp/src/pulpcore-plugin/pulpcore/plugin/download/base.py\\\", line 212, in run\\n    return await self._run(extra_data=extra_data)\\n  File \\\"/usr/local/lib/pulp/lib64/python3.6/site-packages/backoff/_async.py\\\", line 131, in retry\\n    ret = await target(*args, **kwargs)\\n  File \\\"/usr/local/lib/pulp/src/pulpcore-plugin/pulpcore/plugin/download/http.py\\\", line 183, in _run\\n    response.raise_for_status()\\n  File \\\"/usr/local/lib/pulp/lib64/python3.6/site-packages/aiohttp/client_reqrep.py\\\", line 942, in raise_for_status\\n    headers=self.headers)\\n\"}",
   "worker":"/pulp/api/v3/workers/5e3c86c3-8975-40ee-a8a0-e320ee0b9791/",
   "spawned_tasks":[

   ],
   "progress_reports":[
      {
         "message":"Downloading Metadata",
         "state":"failed",
         "done":0
      },
      {
         "message":"Downloading Artifacts",
         "state":"canceled",
         "done":0
      },
      {
         "message":"Associating Content",
         "state":"canceled",
         "done":0
      }
   ],
   "created_resources":[

   ]
}

Notice that 'error' is a ruby hash that has had 'to_string' called on it, instead of serialized as json.

We see the same thing when fetching a repository version, notice the content summary:

v = '/pulp/api/v3/repositories/de0f6d94-d892-46c2-aa85-996728061692/versions/2/'
puts  PulpcoreClient::RepositoriesVersionsApi.new(PulpcoreClient::ApiClient.new(SmartProxy.first.pulp3_configuration(PulpcoreClient::Configuration))).read(v).to_json
{
   "_href":"/pulp/api/v3/repositories/de0f6d94-d892-46c2-aa85-996728061692/versions/2/",
   "_created":"2019-07-26T15:00:32.181+00:00",
   "number":2,
   "content_summary":"{:added=\u003e{:\"docker.manifest\"=\u003e{:count=\u003e1, :href=\u003e\"/pulp/api/v3/content/docker/manifests/?repository_version_added=/pulp/api/v3/repositories/de0f6d94-d892-46c2-aa85-996728061692/versions/2/\"}, :\"docker.manifest-blob\"=\u003e{:count=\u003e4, :href=\u003e\"/pulp/api/v3/content/docker/blobs/?repository_version_added=/pulp/api/v3/repositories/de0f6d94-d892-46c2-aa85-996728061692/versions/2/\"}, :\"docker.manifest-tag\"=\u003e{:count=\u003e1, :href=\u003e\"/pulp/api/v3/content/docker/manifest-tags/?repository_version_added=/pulp/api/v3/repositories/de0f6d94-d892-46c2-aa85-996728061692/versions/2/\"}}, :removed=\u003e{}, :present=\u003e{:\"docker.manifest\"=\u003e{:count=\u003e1, :href=\u003e\"/pulp/api/v3/content/docker/manifests/?repository_version=/pulp/api/v3/repositories/de0f6d94-d892-46c2-aa85-996728061692/versions/2/\"}, :\"docker.manifest-blob\"=\u003e{:count=\u003e4, :href=\u003e\"/pulp/api/v3/content/docker/blobs/?repository_version=/pulp/api/v3/repositories/de0f6d94-d892-46c2-aa85-996728061692/versions/2/\"}, :\"docker.manifest-tag\"=\u003e{:count=\u003e1, :href=\u003e\"/pulp/api/v3/content/docker/manifest-tags/?repository_version=/pulp/api/v3/repositories/de0f6d94-d892-46c2-aa85-996728061692/versions/2/\"}}}"
Actions #1

Updated by amacdona@redhat.com over 4 years ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 57
  • Tags API Bindings added
Actions #2

Updated by dkliban@redhat.com over 4 years ago

This is a problem with the OpenAPI schema. All the fields that you mention have their type defined as String. Instead they should be separate objects with their own fields defined.

Actions #3

Updated by fao89 over 4 years ago

  • Assignee set to fao89
Actions #4

Updated by fao89 over 4 years ago

  • Status changed from NEW to POST

Added by Fabricio Aguiar over 4 years ago

Revision dc50157a | View on GitHub

defining ContentSummarySerializer

re #5210

Added by Fabricio Aguiar over 4 years ago

Revision 3dbcb9aa | View on GitHub

improve openapi schema for task

closes #5210

Actions #5

Updated by Anonymous over 4 years ago

  • Status changed from POST to MODIFIED
Actions #6

Updated by bmbouter over 4 years ago

  • Sprint/Milestone set to 3.0.0
Actions #7

Updated by bmbouter over 4 years ago

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

Updated by ggainey almost 4 years ago

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

Also available in: Atom PDF