2.10.1 macports SQL error on 10.6

Joshua Root jmr at macports.org
Mon Sep 2 20:03:31 UTC 2024


> on my MacBook (64bit) after upgrading to macports 2.10.1, "port
> selfupdate" yields:
>
>
> --->  Checking for newer releases of MacPorts
> MacPorts base version 2.10.1 installed,
> MacPorts base version 2.10.1 available.
> --->  MacPorts base is already the latest version
> --->  Updating the ports tree
>
> The ports tree has been updated.
> Error: process_cmd failed: sqlite error: another row available (100)
> while executing query: SELECT cxx_stdlib FROM registry.ports WHERE id=726

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.

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"

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.

Good luck,

- Josh



More information about the macports-users mailing list