Project

Profile

Help

Issue #6974

closed

ValueError: Invalid value for `metadata_checksum_type` (), must be one of ['unknown', 'md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512']

Added by daviddavis over 4 years ago. Updated over 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
-
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

Steps to reproduce. I recommend sticking a sleep or debugger before this line: https://github.com/pulp/pulp_rpm/blob/d313a990965ccfa3c15bc1443ae77cfad486ad30/pulp_rpm/app/tasks/publishing.py#L228

  1. Create a publication. Make sure this task is running during during step 2.
  2. List publications with the bindings (or simply access the /pulp/api/v3/publications/rpm/rpm/ to confirm that the publication is returned with empty string for metadata_checksum_type)

Error:

Traceback (most recent call last):
  File "./listpub.py", line 15, in <module>
    PublicationsRpmApi(rpm_client).list().results
  File "/opt/utils/venv/pulp/3.7.3/lib64/python3.7/site-packages/pulpcore/client/pulp_rpm/api/publications_rpm_api.py", line 289, in list
    return self.list_with_http_info(**kwargs)  # noqa: E501
  File "/opt/utils/venv/pulp/3.7.3/lib64/python3.7/site-packages/pulpcore/client/pulp_rpm/api/publications_rpm_api.py", line 401, in list_with_http_info
    collection_formats=collection_formats)
  File "/opt/utils/venv/pulp/3.7.3/lib64/python3.7/site-packages/pulpcore/client/pulp_rpm/api_client.py", line 353, in call_api
    _preload_content, _request_timeout, _host)
  File "/opt/utils/venv/pulp/3.7.3/lib64/python3.7/site-packages/pulpcore/client/pulp_rpm/api_client.py", line 192, in __call_api
    return_data = self.deserialize(response_data, response_type)
  File "/opt/utils/venv/pulp/3.7.3/lib64/python3.7/site-packages/pulpcore/client/pulp_rpm/api_client.py", line 264, in deserialize
    return self.__deserialize(data, response_type)
  File "/opt/utils/venv/pulp/3.7.3/lib64/python3.7/site-packages/pulpcore/client/pulp_rpm/api_client.py", line 303, in __deserialize
    return self.__deserialize_model(data, klass)
  File "/opt/utils/venv/pulp/3.7.3/lib64/python3.7/site-packages/pulpcore/client/pulp_rpm/api_client.py", line 639, in __deserialize_model
    kwargs[attr] = self.__deserialize(value, attr_type)
  File "/opt/utils/venv/pulp/3.7.3/lib64/python3.7/site-packages/pulpcore/client/pulp_rpm/api_client.py", line 281, in __deserialize
    for sub_data in data]
  File "/opt/utils/venv/pulp/3.7.3/lib64/python3.7/site-packages/pulpcore/client/pulp_rpm/api_client.py", line 281, in <listcomp>
    for sub_data in data]
  File "/opt/utils/venv/pulp/3.7.3/lib64/python3.7/site-packages/pulpcore/client/pulp_rpm/api_client.py", line 303, in __deserialize
    return self.__deserialize_model(data, klass)
  File "/opt/utils/venv/pulp/3.7.3/lib64/python3.7/site-packages/pulpcore/client/pulp_rpm/api_client.py", line 641, in __deserialize_model
    instance = klass(**kwargs)
  File "/opt/utils/venv/pulp/3.7.3/lib64/python3.7/site-packages/pulpcore/client/pulp_rpm/models/rpm_rpm_publication.py", line 76, in __init__
    self.metadata_checksum_type = metadata_checksum_type
  File "/opt/utils/venv/pulp/3.7.3/lib64/python3.7/site-packages/pulpcore/client/pulp_rpm/models/rpm_rpm_publication.py", line 192, in metadata_checksum_type
    .format(metadata_checksum_type, allowed_values)
ValueError: Invalid value for `metadata_checksum_type` (), must be one of ['unknown', 'md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512']

Related issues

Related to Pulp - Task #6986: Hide publications that aren't completeCLOSED - COMPLETEdaviddavis

Actions
Actions #1

Updated by daviddavis over 4 years ago

Debugging seems to indicate that we're storing the publication without metadata_checksum_type:

$ nc 127.0.0.1 4444
> /home/vagrant/devel/pulp_rpm/pulp_rpm/app/tasks/publishing.py(229)publish()
-> publication.package_checksum_type = checksum_types.get(
(Pdb) publication
<RpmPublication: pk=eab4e695-24bd-424c-896d-afbd652b552d>
(Pdb) publication._state.adding
False
(Pdb) publication.metadata_checksum_type
''
Actions #3

Updated by daviddavis over 4 years ago

fao89 that would work. I think other plugins might run into the same problem.

It looks like core provides hooks:

https://github.com/pulp/pulpcore/blob/bce4bee8124502ecd183fc664b904f5af5be97db/pulpcore/app/models/publication.py#L102-L142

Could we use those to solve this problem?

Actions #4

Updated by fao89 over 4 years ago

@daviddavis maybe we can introduce kwargs there

Actions #5

Updated by daviddavis over 4 years ago

  • Related to Task #6986: Hide publications that aren't complete added
Actions #6

Updated by pulpbot over 4 years ago

  • Status changed from NEW to POST

Added by daviddavis over 4 years ago

Revision e788b9c1 | View on GitHub

Hide publications that aren't complete

fixes #6974

[nocoverage]

Actions #7

Updated by daviddavis over 4 years ago

  • Status changed from POST to MODIFIED

Added by daviddavis over 4 years ago

Revision cd7710cf | View on GitHub

Hide publications that aren't complete

fixes #6974

[nocoverage]

(cherry picked from commit e788b9c1db2ddbaef7e4ce284c97090ba70bde73)

Actions #8

Updated by daviddavis over 4 years ago

Added by daviddavis over 4 years ago

Revision 3c410f5e | View on GitHub

Hide publications that aren't complete

fixes #6974

[nocoverage]

(cherry picked from commit e788b9c1db2ddbaef7e4ce284c97090ba70bde73)

Actions #9

Updated by daviddavis over 4 years ago

Added by daviddavis over 4 years ago

Revision bbcf904d | View on GitHub

Hide publications that aren't complete

fixes #6974

[nocoverage]

(cherry picked from commit e788b9c1db2ddbaef7e4ce284c97090ba70bde73)

Actions #10

Updated by daviddavis over 4 years ago

Actions #11

Updated by ttereshc over 4 years ago

  • Sprint/Milestone set to Pulp RPM 3.4.2
Actions #12

Updated by ttereshc over 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF