New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SLES advisories cannot be successfully exported-imported because they have no name #3127
Comments
It strikes me as very questionable design that the https://github.com/pulp/pulp_rpm/blob/main/pulp_rpm/app/models/advisory.py#L254 But also uses this field for the uniqueness constraints: https://github.com/pulp/pulp_rpm/blob/main/pulp_rpm/app/models/advisory.py#L263 I propose we find some fall back value for this field in case the repo we sync does not supply anything. That would solve this issue. I also propose we migrate existing data to retroactively use the new fallback value, and declare the field as not nullable. Alternative approaches welcome. |
Update: We found a SUSE spec for the relevant repometadata, that does not include the existence of the relevant name field: https://en.opensuse.org/openSUSE:Standards_Rpm_Metadata_UpdateInfo |
Well, note that it's present in both their example and the documentation underneath it, but not in the XML schema itself. So the documentation and the provided schema aren't fully consistent with each other either. That being said, it's a valid issue, I'll take a look at your proposed fix. |
Version
Affects all versions of pulp_rpm
Describe the bug
Because of the repometadata format used for advisories on SLES repos, such repos cannot be successfully exported and then re-imported.
To Reproduce
You need access to a SLES repo with advisories in it (requires a SUSE customer account).
Steps:
Import will fail with the unhelpful error
INFO: Task 6453f373-be64-482d-9c89-d7472416bdb6 failed ('NoneType' object has no attribute 'pulp_id')
.Expected behavior
Successful export/import of SLES repos containing advisories.
Additional context
The root cause can be seen as soon as you have synced a SLES repo with any advisories using the following DB query:
SELECT * FROM rpm_updatecollection;
You will see that SLES advisories all have the fieldsname
,shortname
,module
set to None. Of these, only thename
is needed for import/export, see:During sync the name field is set here:
Looking at fedora epel metadata we see for example:
SLES repos simply do not have anything corresponding to
short="EPEL-7"
and<name>Fedora EPEL 7</name>
above in their repo metadata.The text was updated successfully, but these errors were encountered: