Project

Profile

Help

Issue #1384

closed

HTTP 500 when retrieving importers that have with null configs

Added by amacdona@redhat.com over 8 years ago. Updated over 3 years 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.

Added by Austin Macdonald over 8 years ago

Revision 0ca55a52 | View on GitHub

serializer should not fail if masked field is None

closes #1384

Added by Austin Macdonald over 8 years ago

Revision 0ca55a52 | View on GitHub

serializer should not fail if masked field is None

closes #1384

Actions #1

Updated by amacdona@redhat.com over 8 years ago

  • Status changed from NEW to ASSIGNED
Actions #2

Updated by amacdona@redhat.com over 8 years ago

  • Status changed from ASSIGNED to MODIFIED
Actions #3

Updated by Anonymous over 8 years ago

  • % Done changed from 0 to 100
Actions #4

Updated by jortel@redhat.com over 8 years ago

  • Triaged changed from No to Yes
Actions #5

Updated by amacdona@redhat.com over 8 years ago

  • Platform Release changed from 2.7.1 to 2.7.2
Actions #6

Updated by dkliban@redhat.com about 8 years ago

  • Status changed from MODIFIED to 5
Actions #7

Updated by semyers almost 8 years ago

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

Updated by bmbouter almost 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF