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

Fix AttributeError: ENABLE_NVREA for reposync #8916

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nodeg
Copy link
Member

@nodeg nodeg commented Jun 13, 2024

What does this PR change?

Fixes https://bugzilla.suse.com/show_bug.cgi?id=1226273.

uyuni-server:/var/log/rhn/reposync # less res-7-ltss-updates-x86_64.log
(...)
2024/06/12 13:34:33 -00:00 The package tigervnc-1.8.0-33.el7_9.x86_64 which is referenced by patch RHSA-2024:2080 was not found in the database. This patch has been skipped.
2024/06/12 13:34:33 -00:00     Syncing 3 new patch(es) to channel.
2024/06/12 13:34:33 -00:00 Unexpected error: <class 'AttributeError'>
2024/06/12 13:34:33 -00:00 Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/spacewalk/satellite_tools/reposync.py", line 793, in sync
    self.import_updates(plugin)
  File "/usr/lib/python3.6/site-packages/spacewalk/satellite_tools/reposync.py", line 1007, in import_updates
    processed_updates_count = self.upload_updates(notices)
  File "/usr/lib/python3.6/site-packages/spacewalk/satellite_tools/reposync.py", line 1304, in upload_updates
    importer.run()
  File "/usr/lib/python3.6/site-packages/spacewalk/server/importlib/importLib.py", line 815, in run
    self.fix()
  File "/usr/lib/python3.6/site-packages/spacewalk/server/importlib/errataImport.py", line 151, in fix
    list(self.packages.values()), self.checksums, self.ignoreMissing
  File "/usr/lib/python3.6/site-packages/spacewalk/server/importlib/backend.py", line 935, in lookupPackages
    self.validate_pks()
  File "/usr/lib/python3.6/site-packages/spacewalk/server/importlib/backend.py", line 3298, in validate_pks
    if not CFG.ENABLE_NVREA:
  File "/usr/lib/python3.6/site-packages/spacewalk/common/rhnConfig.py", line 254, in __getattr__
    raise AttributeError(key)
AttributeError: ENABLE_NVREA

uyuni-server:/var/log/rhn/reposync #

GUI diff

No difference.

  • DONE

Documentation

  • No documentation needed: only internal and user invisible changes
  • DONE

Test coverage

  • No tests: already covered
  • DONE

Links

Issue(s): https://github.com/SUSE/spacewalk/issues/24551
Port(s): # Manager 4.3:

  • DONE

Changelogs

Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository

If you don't need a changelog check, please mark this checkbox:

  • No changelog needed

If you uncheck the checkbox after the PR is created, you will need to re-run changelog_test (see below)

Re-run a test

If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run:

  • Re-run test "changelog_test"
  • Re-run test "backend_unittests_pgsql"
  • Re-run test "java_pgsql_tests" (Test skipped, there are no changes to test)
  • Re-run test "schema_migration_test_pgsql"
  • Re-run test "susemanager_unittests"
  • Re-run test "javascript_lint"
  • Re-run test "spacecmd_unittests"

Before you merge

Check How to branch and merge properly!

@nodeg nodeg self-assigned this Jun 13, 2024
@nodeg nodeg force-pushed the context_manage_fix_reposync branch 3 times, most recently from 942eeba to a801fc3 Compare June 13, 2024 07:31
@nodeg nodeg requested a review from agraul June 13, 2024 07:37
@nodeg
Copy link
Member Author

nodeg commented Jun 13, 2024

Do we need/want a backport for this?

@nodeg nodeg marked this pull request as ready for review June 13, 2024 08:43
@nodeg nodeg requested a review from a team as a code owner June 13, 2024 08:43
@nodeg
Copy link
Member Author

nodeg commented Jun 13, 2024

I am not sure why, but the java_pgsql_tests fail with
image
image

vzhestkov
vzhestkov previously approved these changes Jun 13, 2024
Copy link
Contributor

@vzhestkov vzhestkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 suggestion in line, but other than that looks good to me 👍

@agraul agraul force-pushed the context_manage_fix_reposync branch from 9ed4d1f to edf402b Compare July 25, 2024 11:00
@agraul agraul requested review from meaksh and removed request for agraul July 25, 2024 11:07
@agraul agraul assigned agraul and unassigned nodeg Jul 25, 2024
if "checksum_id" in tbs.pk:
tbs.pk.remove("checksum_id")
with cfg_component("server") as cfg:
if not cfg.ENABLE_NVREA:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me looks like AttributeError: ENABLE_NVREA is still possible here if it's missing in rhn.conf or default configs for some reason.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have it in our default rhn_server.conf, if there is an AttributeError there is a bigger problem (default configs missing or modified), IMO it's okay to show a backtrace in that situation.

@m-czernek
Copy link
Contributor

@agraul @nodeg I see that you improved the initial PR, using cfg_component instead of CFG directly, correct? Is there something more we have to do here, or is the PR just waiting for a review?

@agraul
Copy link
Member

agraul commented Aug 21, 2024

@m-czernek I think it's just a PR review now. It would be good if someone double checked the component=None arguments

@ycedres
Copy link
Contributor

ycedres commented Aug 29, 2024

@m-czernek I think it's just a PR review now. It would be good if someone double checked the component=None arguments

@agraul IIUC when component=None the RHNOptions object is initialised with the "global" component here

But I'm not sure if that's what you'd like to double check.

@agraul
Copy link
Member

agraul commented Aug 29, 2024

@ycedres it would be good if you could double check that component=None is the right component, i.e. the settings that are accessed live in the root namespace

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

Successfully merging this pull request may close these issues.

5 participants