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

Unexpected error: <class 'spacewalk.server.importlib.importLib.InvalidPackageError'> #3040

Closed
StefanSa opened this issue Dec 17, 2020 · 5 comments · Fixed by #3047
Closed

Comments

@StefanSa
Copy link

Additional Information

i get this error message while importing / linking a new repo.

2020/12/17 09:14:54 +02:00   Linking packages to the channel.
2020/12/17 09:14:55 +02:00 Unexpected error: <class 'spacewalk.server.importlib.importLib.InvalidPackageError'>
2020/12/17 09:14:55 +02:00 Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/spacewalk/satellite_tools/reposync.py", line 592, in sync
    ret = self.import_packages(plugin, data['id'], url, is_non_local_repo)
  File "/usr/lib/python3.6/site-packages/spacewalk/satellite_tools/reposync.py", line 1107, in import_packages
    importer.run()
  File "/usr/lib/python3.6/site-packages/spacewalk/server/importlib/importLib.py", line 777, in run
    self.submit()
  File "/usr/lib/python3.6/site-packages/spacewalk/server/importlib/packageImport.py", line 126, in submit
    self.backend.lookupPackages(self.batch, self.checksums)
  File "/usr/lib/python3.6/site-packages/spacewalk/server/importlib/backend.py", line 822, in lookupPackages
    raise_with_tb(not_found[0], not_found[1])
  File "/usr/lib/python3.6/site-packages/uyuni/common/usix.py", line 77, in raise_with_tb
    raise value
  File "/usr/lib/python3.6/site-packages/spacewalk/server/importlib/backend.py", line 814, in lookupPackages
    self.__lookupObjectCollection([package], 'rhnPackage')
  File "/usr/lib/python3.6/site-packages/spacewalk/server/importlib/backend.py", line 2493, in __lookupObjectCollection
    raise InvalidPackageError(object, "Could not find object %s in table %s" % (object, tableName))
spacewalk.server.importlib.importLib.InvalidPackageError: Could not find object [<<class 'spacewalk.server.importlib.importLib.IncompletePackage'> instance; attributes={'package_id': None, 'name': 'dbish', 'epoch': None, 'version': '11.97', 'release': 'lp152.1.1', 'arch': 'noarch', 'org_id': 1, 'package_size': None, 'last_modified': None, 'md5sum': None, 'channels': {155: 'opensuse_15.2_leap_perl_and_perl-modules'}, 'checksum_list': None, 'checksum': '5a157c2b12daa51f061537b9ad0bcd8502ce35229f0c62f16fe3206dfa25867b', 'checksum_type': 'sha256', 'checksums': {'sha256': '5a157c2b12daa51f061537b9ad0bcd8502ce35229f0c62f16fe3206dfa25867b'}, 'name_id': 60838, 'evr_id': 44419, 'package_arch_id': 100, 'nevra_id': 132334, 'checksum_id': 8567910}] in table rhnPackage

Version of Uyuni Server and Proxy (if used)

zypper info Uyuni-Server-release

Informationen zu Paket Uyuni-Server-release:
--------------------------------------------
Repository         : uyuni-server-stable
Name               : Uyuni-Server-release
Version            : 2020.11-99.2.uyuni
Arch               : x86_64
Anbieter           : obs://build.opensuse.org/systemsmanagement:Uyuni
Support Level      : Stufe 3
Installierte Größe : 1,4 KiB
Installiert        : Ja
Status             : veraltet (Version 2020.09-98.2.uyuni installiert)
Quellpaket         : Uyuni-Server-release-2020.11-99.2.uyuni.src
Zusammenfassung    : Uyuni Server
Beschreibung       :
    Uyuni lets you efficiently manage physical, virtual,
    and cloud-based Linux systems. It provides automated and cost-effective
    configuration and software management, asset management, and system
    provisioning.
@StefanSa
Copy link
Author

hmm, after the second attempt the sync was complete.

@mcalmer
Copy link
Contributor

mcalmer commented Dec 18, 2020

@StefanSa Can you check the logs in the "Importing packages to DB:" section? The section with all the

Package batch #1 of 305 completed...

or can you find something in the postgresql log?

Btw: what OS repo where you syncing? SUSE, CentOS, Fedora, Ubuntu, Debian, etc...?

@StefanSa
Copy link
Author

StefanSa commented Dec 18, 2020

@mcalmer
we only have / use suse.
that was this repo devel:/languages:/perl/openSUSE_Leap_15.2
the only error message i found was this one:

2020/12/17 09:12:28 +02:00 Importing packages started.
2020/12/17 09:12:28 +02:00 
2020/12/17 09:12:28 +02:00   Importing packages to DB:
2020/12/17 09:12:32 +02:00 duplicate key value violates unique constraint "rhn_pkey_keyid_uq"
DETAIL:  Key (key_id)=(dcca98dddcef338c) already exists.

the DB import was successful, but then the error message mentioned above appeared Unexpected error.

@mcalmer mcalmer mentioned this issue Dec 18, 2020
13 tasks
@mcalmer
Copy link
Contributor

mcalmer commented Dec 18, 2020

I have a different case, but the underlying problem is the same.
We import packages in parallel. If two batches want to insert the same key at the same point in time they lookup the key, but do not see that another bunch already added it until it is commited. The first one wins and the second gets a a unique constraint violation.

I added a fix for this in the PR.

@mcalmer
Copy link
Contributor

mcalmer commented Dec 30, 2020

Should be fixed with 2021.01

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 a pull request may close this issue.

2 participants