Project

Profile

Help

Issue #3019

updating importer results in KeyError: 'view'

Added by dkliban@redhat.com about 2 years ago. Updated 6 months ago.

Status:
MODIFIED
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:

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'

Associated revisions

Revision 53bd07de View on GitHub
Added by werwty about 2 years ago

to_internal_value should not process href_writable field if being called from task

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

Revision 53bd07de View on GitHub
Added by werwty about 2 years ago

to_internal_value should not process href_writable field if being called from task

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

Revision 53bd07de View on GitHub
Added by werwty about 2 years ago

to_internal_value should not process href_writable field if being called from task

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

History

#1 Updated by dkliban@redhat.com about 2 years ago

  • Description updated (diff)

#2 Updated by bizhang about 2 years ago

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

#3 Updated by werwty about 2 years ago

  • Status changed from POST to MODIFIED

#4 Updated by daviddavis 6 months ago

  • Sprint/Milestone set to 3.0

#5 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF