Hi,
thanks,
Joshua Root wrote:
This looks like database inconsistency. The id column is a primary key
and so should always be unique, meaning there shouldn't be more than
one row that has a given id.
Hard to say how it happened. The problem could potentially have been
there for some time, only now being detected by the additional
constraint checking that was enabled in 2.10. Memory or disk
corruption are possibilities.
scary... also read below. I check, after some days, which means also a
couple of reboots.
The first step toward fixing it is to find out which ports' db rows
are affected. Try running this: sqlite3
/opt/local/var/macports/registry/registry.db "select * from ports
where id=726"
sqlite3 /opt/local/var/macports/registry/registry.db "select * from
ports where id=726"
726|xmlcatmgr|435d94eb7431bfb474662c034bffac8cbde64759424e188613ed8a7f8287ba96-1298|/opt/local/var/macports/software/xmlcatmgr/xmlcatmgr-2.2_1.darwin_10.x86_64.tbz2|0|2.2|1|||installed|1724755415|image|x86_64|0|darwin|10|none|0
apparently, there is only one line.
An miracle, if I run now "port upgrade outdated" I get no errors, fixed
itself! but reboot or some operation was needed.
If that succeeds, you should get 2 or more rows of port information.
The port name will be in the second column. If it doesn't work, you
may need to resort to a full database dump: sqlite3
/opt/local/var/macports/registry/registry.db ".dump" > registry_dump.txt
Before trying anything to fix it, make a backup of your registry.db.
It's possible that simply uninstalling the two (or more) ports that
share the same id will fix everything. If not, more manual database
surgery may be required. I don't know how much work it's worthwhile
for you to put into this before deleting everything and starting again
is the better option.
Is there anything else I can run to see if there is no other
inconsistency? Or maybe it's OK?
Deleting everything takes some time, so before doing it...
Riccardo