Project

Profile

Help

Issue #3019

closed

updating importer results in KeyError: 'view'

Added by dkliban@redhat.com over 6 years ago. Updated about 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:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

This is a new issue that did not exist prior to sometime last week.

http POST http://localhost:1234/api/v3/repositories/ name=mycoolrepo
http POST http://localhost:1234/api/v3/repositories/mycoolrepo/importers/example-futures/ name=mycoolimporter download_policy='immediate' feed_url='https://repos.fedorapeople.org/pulp/pulp/fixtures/file/PULP_MANIFEST' repository='http://localhost:1234/api/v3/repositories/mycoolrepo/' sync_mode='mirror'
http PATCH http://localhost:1234/api/v3/repositories/mycoolrepo/importers/example-futures/mycoolimporter/ download_policy='on_demand'

The following is then emitted in the celery logs:

Task failed : [240c79f9-8bce-4e46-bf6a-5a8b6dac033d]
Task pulpcore.app.tasks.importer.update[240c79f9-8bce-4e46-bf6a-5a8b6dac033d] raised unexpected: KeyError('view',)
Traceback (most recent call last):
  File "/home/vagrant/.virtualenvs/pulp/lib/python3.5/site-packages/celery/app/trace.py", line 374, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/home/vagrant/devel/pulp/platform/pulpcore/tasking/tasks.py", line 272, in __call__
    return super(UserFacingTask, self).__call__(*args, **kwargs)
  File "/home/vagrant/.virtualenvs/pulp/lib/python3.5/site-packages/celery/app/trace.py", line 629, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/vagrant/devel/pulp/platform/pulpcore/app/tasks/importer.py", line 41, in update
    serializer.is_valid(raise_exception=True)
  File "/home/vagrant/.virtualenvs/pulp/lib/python3.5/site-packages/rest_framework/serializers.py", line 237, in is_valid
    self._validated_data = self.run_validation(self.initial_data)
  File "/home/vagrant/.virtualenvs/pulp/lib/python3.5/site-packages/rest_framework/serializers.py", line 432, in run_validation
    value = self.to_internal_value(data)    
  File "/home/vagrant/devel/pulp/platform/pulpcore/app/serializers/base.py", line 164, in to_internal_value
    parent_field, parent = self.context['view'].get_parent_field_and_object()
KeyError: 'view'
Actions #1

Updated by dkliban@redhat.com over 6 years ago

  • Description updated (diff)
Actions #2

Updated by bizhang over 6 years ago

  • Status changed from NEW to POST
  • Assignee set to bizhang

Added by werwty over 6 years ago

Revision 53bd07de | View on GitHub

to_internal_value should not process href_writable field if being called from task

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

Added by werwty over 6 years ago

Revision 53bd07de | View on GitHub

to_internal_value should not process href_writable field if being called from task

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

Actions #3

Updated by werwty over 6 years ago

  • Status changed from POST to MODIFIED
Actions #4

Updated by daviddavis almost 5 years ago

  • Sprint/Milestone set to 3.0.0
Actions #5

Updated by bmbouter almost 5 years ago

  • Tags deleted (Pulp 3)
Actions #6

Updated by bmbouter over 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF