Project

Profile

Help

Issue #5546

closed

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

Added by jsherril@redhat.com about 5 years ago. Updated over 4 years 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

Actions #1

Updated by fao89 about 5 years ago

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

Updated by fao89 about 5 years ago

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

Actions #3

Updated by dalley about 5 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to dalley
Actions #4

Updated by dalley about 5 years ago

  • Status changed from ASSIGNED to POST

Added by dalley about 5 years ago

Revision 2cefa4de | View on GitHub

Fix "migration plan needs to be pre-serialized"

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

Added by dalley about 5 years ago

Revision 2cefa4de | View on GitHub

Fix "migration plan needs to be pre-serialized"

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

Added by dalley about 5 years ago

Revision 2cefa4de | View on GitHub

Fix "migration plan needs to be pre-serialized"

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

Actions #5

Updated by rchan about 5 years ago

  • Sprint changed from Sprint 60 to Sprint 61
Actions #6

Updated by dalley about 5 years ago

  • Status changed from POST to MODIFIED
Actions #7

Updated by dalley about 5 years ago

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

Actions #8

Updated by ttereshc almost 5 years ago

  • Project changed from Pulp to Migration Plugin
Actions #9

Updated by ttereshc over 4 years ago

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

Updated by bmbouter over 4 years ago

  • Tags deleted (Pulp 2 to 3 Migrate)
Actions #11

Updated by bmbouter over 4 years 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

Also available in: Atom PDF