A user was complaining about not being able to add a package to a tag, and yet not being able to build the package because it didn't belong to the tag:
~ > koji add-pkg --owner lxman collectd9-testing python-collectd_certificate Package python-collectd_certificate already exists in tag collectd9-testing Adding 0 packages to tag collectd9-testing ~ > koji list-pkgs --tag collectd9-testing --package python-collectd_certificate (no matching packages)
I couldn't figure out what was going on through the CLI, but then I saw this on the web interface:
It seems somehow the package has been added twice with the same name! I have no idea how this happened. I thought maybe there was some unicode funny business going on, but now I'm questioning my sanity and the meaning of a unique constraint:
koji=> select id, name, encode(name::bytea, 'hex') FROM package where id=7694 or id=8429; id | name | encode ------+-----------------------------+-------------------------------------------------------- 7694 | python-collectd_certificate | 707974686f6e2d636f6c6c656374645f6365727469666963617465 8429 | python-collectd_certificate | 707974686f6e2d636f6c6c656374645f6365727469666963617465 (2 rows) koji=> select * from package where name='python-collectd_certificate'; id | name ------+----------------------------- 8429 | python-collectd_certificate (1 row)
Any tips for how to resolve this without messing up the DB? There are builds created for both packages.
Apparently this is one of those rare cases of database corruption. I did some careful DB surgery and all is good now!
Metadata Update from @alexi: - Issue close_status updated to: Invalid - Issue status updated to: Closed (was: Open)
I'm horrified if we're able to create duplicate name here. Only related thing I've seen is here and here but it shouldn't be a case here? At least what is proposed in such case is reindexing the table or maybe best just reindex all (text) indices.
Metadata Update from @tkopecek: - Custom field Size adjusted to None
Yeah, I was kind of shocked too. I fixed that case and reindexed all indexes. Apparently, that was the only issue, but now I wonder if I shouldn't do a regular reindexing or something...
This issue has been migrated to Fedora Forge: https://forge.fedoraproject.org/koji/koji/issues/3622
Please continue any further discussion there.