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

Refreshing repos results in get() returned more than one MirrorPackage #35

Closed
nalbyuites opened this issue Jun 1, 2017 · 3 comments
Closed

Comments

@nalbyuites
Copy link

nalbyuites commented Jun 1, 2017

Please let me know if this is a patchman issue or something is wrong with the package list received from the repos. -

root@server$ PYTHONPATH=/srv/patchman /srv/patchman/sbin/patchman -r

Repository 15 : Debian 8.7 x86_64 repo at http://mirror.company.net/debian//dists/jessie/main/binary-amd64
Found deb repo - http://mirror.company.net/debian//dists/jessie/main/binary-amd64/Packages.xz
Downloading repo info: 100%|######################################################################################################################################################|Time: 0:00:00
Extracting packages: 100%|######################################################################################################################################################|Time: 0:00:24
Obtaining stored packages: 100%|######################################################################################################################################################|Time: 0:00:08
Traceback (most recent call last): 0%| |ETA: --:--:--
File "/srv/patchman/sbin/patchman", line 593, in
main()
File "/srv/patchman/sbin/patchman", line 588, in main
showhelp = process_args(args)
File "/srv/patchman/sbin/patchman", line 561, in process_args
refresh_repos(args.repo, args.force)
File "/srv/patchman/sbin/patchman", line 120, in refresh_repos
repo.refresh(force)
File "/srv/patchman/patchman/repos/models.py", line 86, in refresh
refresh_deb_repo(self)
File "/srv/patchman/patchman/repos/utils.py", line 538, in refresh_deb_repo
update_mirror_packages(mirror, packages)
File "/srv/patchman/patchman/repos/utils.py", line 96, in update_mirror_packages
MirrorPackage.objects.get(mirror=mirror, package=p).delete()
File "/usr/lib/python2.7/dist-packages/django/db/models/manager.py", line 127, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 338, in get
(self.model._meta.object_name, num)
patchman.repos.models.MultipleObjectsReturned: get() returned more than one MirrorPackage -- it returned 2!

@furlongm
Copy link
Owner

This usually happens when mirrors are misconfigured. If you delete all repos and re-index them, does the same issue occur?

@furlongm
Copy link
Owner

Closing due to no response.

@julienleboeuf
Copy link

Same issue here with 2.0.3 with patchman -a

Repository 99 : Debian 10.12 x86_64 repo at http://ppa.launchpad.net/linuxuprising/java/ubuntu/dists/bionic/main/binary-amd64
Found deb repo - http://ppa.launchpad.net/linuxuprising/java/ubuntu/dists/bionic/main/binary-amd64/Packages.xz
Downloading repo info:             100%|#############################################################################################################################################################################################################################################################################################|Time: 0:00:00
/usr/lib/python3/dist-packages/debian/deb822.py:748: UserWarning: Parsing of Deb822 data with python-apt's apt_pkg was requested but this cannot be done on non-file input.                                                                                                                                                         |ETA:  --:--:--
  warnings.warn(msg)
Extracting packages:               100%|#############################################################################################################################################################################################################################################################################################|Time: 0:00:00
Obtaining stored packages:         100%|#############################################################################################################################################################################################################################################################################################|Time: 0:00:00
Traceback (most recent call last):  33%|###############################################################################################                                                                                                                                                                                              |ETA:  0:00:00
  File "/usr/bin/patchman", line 686, in <module>
    main()
  File "/usr/bin/patchman", line 680, in main
    showhelp = process_args(args)
  File "/usr/bin/patchman", line 646, in process_args
    refresh_repos(args.repo, args.force)
  File "/usr/bin/patchman", line 121, in refresh_repos
    repo.refresh(force)
  File "/usr/lib/python3/dist-packages/repos/models.py", line 84, in refresh
    refresh_deb_repo(self)
  File "/usr/lib/python3/dist-packages/repos/utils.py", line 655, in refresh_deb_repo
    update_mirror_packages(mirror, packages)
  File "/usr/lib/python3/dist-packages/repos/utils.py", line 94, in update_mirror_packages
    MirrorPackage.objects.get(mirror=mirror, package=p).delete()
  File "/usr/lib/python3/dist-packages/django/db/models/manager.py", line 82, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/django/db/models/query.py", line 410, in get
    raise self.model.MultipleObjectsReturned(
repos.models.MultipleObjectsReturned: get() returned more than one MirrorPackage -- it returned 2!

patchman -d didn't help

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

3 participants