Project

Profile

Help

Issue #5546

migration plan creation expects 'plan' to be pre-serialized within bindings

Added by jsherril@redhat.com over 1 year ago. Updated about 1 year ago.

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

Description

From the ruby bindings when calling the api to create a plan:

        migration_plan_api.create(plan: {"plugins":[{"type":"iso"}]})

this throws an error on the server:

Oct  7 15:27:14 devel2 gunicorn: pulp: django.request:ERROR: Internal Server Error: /pulp/api/v3/migration-plans/
Oct  7 15:27:14 devel2 gunicorn: Traceback (most recent call last):
Oct  7 15:27:14 devel2 gunicorn: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
Oct  7 15:27:14 devel2 gunicorn: response = get_response(request)
Oct  7 15:27:14 devel2 gunicorn: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
Oct  7 15:27:14 devel2 gunicorn: response = self.process_exception_by_middleware(e, request)
Oct  7 15:27:14 devel2 gunicorn: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
Oct  7 15:27:14 devel2 gunicorn: response = wrapped_callback(request, *callback_args, **callback_kwargs)
Oct  7 15:27:14 devel2 gunicorn: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
Oct  7 15:27:14 devel2 gunicorn: return view_func(*args, **kwargs)
Oct  7 15:27:14 devel2 gunicorn: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/viewsets.py", line 114, in view
Oct  7 15:27:14 devel2 gunicorn: return self.dispatch(request, *args, **kwargs)
Oct  7 15:27:14 devel2 gunicorn: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/views.py", line 505, in dispatch
Oct  7 15:27:14 devel2 gunicorn: response = self.handle_exception(exc)
Oct  7 15:27:14 devel2 gunicorn: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/views.py", line 465, in handle_exception
Oct  7 15:27:14 devel2 gunicorn: self.raise_uncaught_exception(exc)
Oct  7 15:27:14 devel2 gunicorn: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/views.py", line 476, in raise_uncaught_exception
Oct  7 15:27:14 devel2 gunicorn: raise exc
Oct  7 15:27:14 devel2 gunicorn: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/views.py", line 502, in dispatch
Oct  7 15:27:14 devel2 gunicorn: response = handler(request, *args, **kwargs)
Oct  7 15:27:14 devel2 gunicorn: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/mixins.py", line 18, in create
Oct  7 15:27:14 devel2 gunicorn: serializer.is_valid(raise_exception=True)
Oct  7 15:27:14 devel2 gunicorn: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/serializers.py", line 235, in is_valid
Oct  7 15:27:14 devel2 gunicorn: self._validated_data = self.run_validation(self.initial_data)
Oct  7 15:27:14 devel2 gunicorn: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/serializers.py", line 433, in run_validation
Oct  7 15:27:14 devel2 gunicorn: value = self.validate(value)
Oct  7 15:27:14 devel2 gunicorn: File "/usr/local/lib/pulp/src/pulp/pulp_2to3_migration/app/serializers.py", line 49, in validate
Oct  7 15:27:14 devel2 gunicorn: loaded_plan = json.loads(data['plan'])
Oct  7 15:27:14 devel2 gunicorn: File "/usr/lib64/python3.6/json/__init__.py", line 348, in loads
Oct  7 15:27:14 devel2 gunicorn: 'not {!r}'.format(s.__class__.__name__))
Oct  7 15:27:14 devel2 gunicorn: TypeError: the JSON object must be str, bytes or bytearray, not 'dict'

pre-serializing the data seems to get past it:

        migration_plan_api.create(plan: {"plugins":[{"type":"iso"}]}.to_json)

which seems quite different than the rest of the api

Associated revisions

Revision 2cefa4de View on GitHub
Added by dalley over 1 year ago

Fix "migration plan needs to be pre-serialized"

closes: #5546 https://pulp.plan.io/issues/5546

Revision 2cefa4de View on GitHub
Added by dalley over 1 year ago

Fix "migration plan needs to be pre-serialized"

closes: #5546 https://pulp.plan.io/issues/5546

Revision 2cefa4de View on GitHub
Added by dalley over 1 year ago

Fix "migration plan needs to be pre-serialized"

closes: #5546 https://pulp.plan.io/issues/5546

History

#1 Updated by fao89 over 1 year ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 60
  • Tags API Bindings added

#2 Updated by fao89 over 1 year ago

might be related to this:
https://pulp.plan.io/issues/4903#note-9

#3 Updated by dalley over 1 year ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to dalley

#4 Updated by dalley over 1 year ago

  • Status changed from ASSIGNED to POST

#5 Updated by rchan over 1 year ago

  • Sprint changed from Sprint 60 to Sprint 61

#6 Updated by dalley over 1 year ago

  • Status changed from POST to MODIFIED

#7 Updated by dalley over 1 year ago

Applied in changeset commit:pulp-2to3-migrate|2cefa4de9fb40518563c01b77b23d16268f727de.

#8 Updated by ttereshc over 1 year ago

  • Project changed from Pulp to Migration Plugin

#9 Updated by ttereshc about 1 year ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE
  • Sprint/Milestone set to 0.1.0

#10 Updated by bmbouter about 1 year ago

  • Tags deleted (Pulp 2 to 3 Migrate)

#11 Updated by bmbouter about 1 year ago

We're removing the 'Pulp 2 to 3 Migrate' tag to allow membership of the Migration Plugin project in Redmine to be the controlling area https://pulp.plan.io/projects/migration

Please register to edit this issue

Also available in: Atom PDF