Skip to content
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

No longer compatible with Uyuni 2021 04 following RPC changes. #33

Closed
digdilem opened this issue Apr 29, 2021 · 16 comments
Closed

No longer compatible with Uyuni 2021 04 following RPC changes. #33

digdilem opened this issue Apr 29, 2021 · 16 comments
Assignees

Comments

@digdilem
Copy link

Not an issue with the script itself, but this no longer works with Uyuni - the forked Spacewalk replacement.

Uyuni changed api version to 25 last year, and --ignore-api-version allowed the script to continue working.

However, as of the latest 2021 04 version of Uyuni, they have removed some API calls which now breaks the script.

Running the script returns this at the end and no errata is imported

Fault returned from XML RPC Server, fault code 2609: redstone.xmlrpc.XmlRpcFault: A required patch attribute (advisory_status) was missing.

Uyuni reference: https://www.uyuni-project.org/doc/2021.04/release-notes-uyuni-server.html#_removal_of_deprecated_xmlrpc_api_methods

@paususe
Copy link

paususe commented Apr 29, 2021

@lucidd is this something we need to fix on the Uyuni side?

@stevemeier
Copy link
Owner

@digdilem Could you post more context from the debug log, please? Thanks

@digdilem
Copy link
Author

Certainly -

I ran with --debug and redirected to a file, attached.

Output to stdio was:

DEBUG: Called as /usr/local/centos/errata-import.pl --server uyuni01 --errata /usr/local/centos/errata.latest.xml --publish --rhsa-oval /usr/local/centos/com.redhat.rhsa-RHEL7.xml --ignore-api-version --debug

Fault returned from XML RPC Server, fault code 2609: redstone.xmlrpc.XmlRpcFault: A required patch attribute (advisory_status) was missing.

debug.txt

@stevemeier
Copy link
Owner

Doing some quick digging, it seems that Uyuni has introduced a new mandatory field: advisory_status

Changes were commit here very recently -> https://github.com/uyuni-project/uyuni/commits/master/java/code/src/com/redhat/rhn/frontend/xmlrpc/errata/ErrataHandler.java

According to the source code documentation: (Must be one of the following: "final", "stable", "testing", "retracted")

However, I could find no API documentation that references this. Back in Spacewalk there were API docs for each release but I don't know how this is handled for Uyuni.

@paususe
Copy link

paususe commented Apr 29, 2021

Doing some quick digging, it seems that Uyuni has introduced a new mandatory field: advisory_status

Changes were commit here very recently -> uyuni-project/uyuni@master/java/code/src/com/redhat/rhn/frontend/xmlrpc/errata/ErrataHandler.java (commits)

According to the source code documentation: (Must be one of the following: "final", "stable", "testing", "retracted")

However, I could find no API documentation that references this. Back in Spacewalk there were API docs for each release but I don't know how this is handled for Uyuni.

Ah, that's because of the support for retracted patches we have recently added. This is a SUSE-specific feature, we will talk about it tomorrow at Uyuni Community Hours:
https://github.com/uyuni-project/uyuni/wiki/Uyuni-Community-Hours

API docs here:
https://www.uyuni-project.org/uyuni-docs-api/uyuni/api/errata.html#apidoc-errata-create-1286968216

@hustodemon what should be the right value for CentOS errata? "final" or "stable"?

@stevemeier
Copy link
Owner

@paususe Shouldn't the API version number have been bumped up for this kind of change?

@paususe
Copy link

paususe commented Apr 29, 2021

@paususe Shouldn't the API version number have been bumped up for this kind of change?

Indeed. And we discussed it but I don't know why we did not bump it.

FYI: for CentOS, just use final as the advisory_status.

@stevemeier
Copy link
Owner

I haven't followed Uyuni development but from what little I know it seems that there is now a version 2021.02 and 2021.04 out there, both reporting API version 25.

The first doesn't understand advisory_status and the later requires it. How are clients supposed to deal with that?

@paususe
Copy link

paususe commented Apr 29, 2021

I'm afraid this time exception handling might be the only solution: try to insert one errata with advisory_status. If you get an error, try without.

@stevemeier
Copy link
Owner

What about using api.systemVersion to distinguish?
On my old box this reports 2020.11.

@paususe
Copy link

paususe commented Apr 29, 2021

What about using api.systemVersion to distinguish?
On my old box this reports 2020.11.

That might work. It should report 2021.04 for Uyuni 2021.04.

But then you should also check for the SUSE Manager version: 4.1.8 and 4.2.0 Beta3 include this modified API.

@stevemeier stevemeier self-assigned this Apr 30, 2021
@stevemeier
Copy link
Owner

@digdilem Could you give the attached version a try? This should check for the Uyuni version and set advisory_status when required. Thanks!

errata-import.pl.txt

@digdilem
Copy link
Author

digdilem commented May 1, 2021

@stevemeier
I'm pleased to confirm that this works perfectly and your changes seem to have resolved this issue.

Thank you very much for your prompt attention in sorting this.

Attached is the output from the run. No errors reported and returned a clean exit.

centos-import.-nondebug-20210501SA.txt

(Unrelated and possibly transient error - am getting a 404 on http://cefs.steve-meier.de/errata.latest.xml this morning, but was able to run the tests with a previous copy)

@digdilem digdilem closed this as completed May 1, 2021
@phibid
Copy link

phibid commented May 1, 2021

I confirm, so far so good, worked for me too.

Thanks !

stevemeier added a commit that referenced this issue May 1, 2021
@stevemeier
Copy link
Owner

@digdilem The 404 probably appeared while an updated XML file was being deployed. I have changed the process slightly to hopefully prevent that in the future.

@hustodemon
Copy link

hustodemon commented May 19, 2021

Hello everyone! In the end this got handled as a bug in Uyuni (because of the breakage of backwards-compatibility) and has been fixed in this PR: uyuni-project/uyuni#3750. Uyuni will default to final in case the advisory_status is not explicitly specified in the createErrata API call. The fix will be included in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants