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

INTERNAL ERROR: Package database is not sorted!!! #18

Open
andywolk opened this issue Mar 16, 2021 · 3 comments
Open

INTERNAL ERROR: Package database is not sorted!!! #18

andywolk opened this issue Mar 16, 2021 · 3 comments

Comments

@andywolk
Copy link

andywolk commented Mar 16, 2021

reprepro multiple-versions-debian branch.
I started seeing The lock file './db/lockfile' already exists. There might be another instance with the error same database dir running. To avoid locking overhead, only one process but there is no other reprepro running at the same time.
This is what I found in the logs. Note
reprepro: archallflood.c:310: save_package_version: Assertion `false' failed.

build	16-Mar-2021 14:55:30	Exporting indices...
error	16-Mar-2021 14:55:30	INTERNAL ERROR: Package database is not sorted!!!
error	16-Mar-2021 14:55:30	reprepro: archallflood.c:310: save_package_version: Assertion `false' failed.
error	16-Mar-2021 14:55:30	Aborted
error	16-Mar-2021 14:55:30	The lock file './db/lockfile' already exists. There might be another instance with the
error	16-Mar-2021 14:55:30	same database dir running. To avoid locking overhead, only one process
error	16-Mar-2021 14:55:30	can access the database at the same time. Do not delete the lock file unless
error	16-Mar-2021 14:55:30	you are sure no other version is still running!
error	16-Mar-2021 14:55:30	There have been errors!
error	16-Mar-2021 14:55:30	The lock file './db/lockfile' already exists. There might be another instance with the
error	16-Mar-2021 14:55:30	same database dir running. To avoid locking overhead, only one process
error	16-Mar-2021 14:55:30	can access the database at the same time. Do not delete the lock file unless
error	16-Mar-2021 14:55:30	you are sure no other version is still running!
error	16-Mar-2021 14:55:30	There have been errors!

https://files.freeswitch.org/repo/deb/debian-unstable/conf/distributions
https://files.freeswitch.org/repo/deb/debian-unstable/db/

@andywolk
Copy link
Author

reprepro flood stretch does fail but not reprepro flood buster

@bdrung
Copy link
Contributor

bdrung commented Mar 18, 2021

Thanks for providing the config and db files. I can reproduce the issue with the given files. I wrote a small Python script to check order in the package database:

#!/usr/bin/python3

import apt_pkg
import bsddb3

subtables = [x.decode() for x in bsddb3.btopen("db/packagenames.db", "r").keys()]

for subtable in subtables:
    print("Processing db/packagenames.db '%s'..." % (subtable))

    db = bsddb3.db.DB()
    db.open("db/packagenames.db", subtable, bsddb3.db.DB_BTREE, bsddb3.db.DB_RDONLY)
    print(
        "%s has %i packages and %i package versions"
        % (subtable, len(set(db.keys())), len(db.values()))
    )

    prev_package = ""
    prev_version = ""

    for key, value in db.items():
        key = key.decode().strip("\0")
        value = value.decode().strip("\0")

        package, version = value.split("|")

        if key != package:
            print("Package name differs for key and value: '%s' mistmatches '%s'." % (key, value))

        if package == prev_package:
            # Check order of values
            if apt_pkg.version_compare(version, prev_version) < 0:
                print(
                    "Package version order is wrong for '%s': %s < %s"
                    % (package, version, prev_version)
                )

for subtable in subtables:
    print("Processing db/packages.db '%s'..." % (subtable))

    db = bsddb3.db.DB()
    db.open("db/packages.db", subtable, bsddb3.db.DB_BTREE, bsddb3.db.DB_RDONLY)

    prev_package = ""
    prev_version = ""

    for key in db.keys():
        key = key.decode().strip("\0")

        package, version = key.split("|")

        if package == prev_package:
            # Check order of values
            if apt_pkg.version_compare(version, prev_version) < 0:
                print(
                    "Package version order is wrong for '%s': %s < %s"
                    % (package, version, prev_version)
                )

But this script does not find any incorrect order.

@andywolk
Copy link
Author

reprepro flood buster started failing too.

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

2 participants