Project

Profile

Help

Issue #1384

HTTP 500 when retrieving importers that have with null configs

Added by amacdona@redhat.com about 6 years ago. Updated over 1 year ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
2.7.0
Platform Release:
2.8.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

It is possible(Pulp < 2.8) to have null values in the db for the `config` field of an importer. This breaks the serializer which was new in 2.7.0.

This is how to reproduce:

1. Create a repository without importers or distributors (do not use CLI)

http --json -a admin:admin --verify=no POST https://localhost/pulp/api/v2/repositories/ id=test

2. Associate an importer with this repository

http --json -a admin:admin --verify=no POST 'https://localhost/pulp/api/v2/repositories/test/importers/' importer_type_id=yum_importer

3. Attempt to retrieve the importer

http --json -a admin:admin --verify=no GET 'https://localhost/pulp/api/v2/repositories/test/?importers=true'

I have confirmed that this is not a problem for Pulp < 2.7.0 and that it is not a problem for Pulp >= 2.8. The broken serializer did not exist previously, and the Mongoengine documents convert `null` to an empty dict because `config` is a DictField.

This could be an issue in other places in the API, and if those objects have not been converted to Mongoengine they will be broken in master as well.

The specific cause is that the base serializer allows modification (removal and masking) of fields within an object, and it assumed that the fields being modified exist.

Associated revisions

Revision 0ca55a52 View on GitHub
Added by Austin Macdonald about 6 years ago

serializer should not fail if masked field is None

closes #1384

Revision 0ca55a52 View on GitHub
Added by Austin Macdonald about 6 years ago

serializer should not fail if masked field is None

closes #1384

History

#1 Updated by amacdona@redhat.com about 6 years ago

  • Status changed from NEW to ASSIGNED

#2 Updated by amacdona@redhat.com about 6 years ago

  • Status changed from ASSIGNED to MODIFIED

#3 Updated by Anonymous about 6 years ago

  • % Done changed from 0 to 100

#4 Updated by jortel@redhat.com about 6 years ago

  • Triaged changed from No to Yes

#5 Updated by amacdona@redhat.com almost 6 years ago

  • Platform Release changed from 2.7.1 to 2.7.2

#6 Updated by dkliban@redhat.com almost 6 years ago

  • Status changed from MODIFIED to 5

#7 Updated by semyers over 5 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE
  • Platform Release changed from 2.7.2 to 2.8.0

#8 Updated by bmbouter over 2 years ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF