2.10.1 macports SQL error on 10.6

Joshua Root jmr at macports.org
Sat Sep 7 02:25:07 UTC 2024


On 7/9/2024 02:14, Riccardo Mottola wrote:
>>
>> 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.

Interesting. Maybe the issue was at the filesystem level and rebooting 
triggered a fsck that repaired it, or maybe sqlite was able to 
self-repair somehow when given write access.

> Is there anything else I can run to see if there is no other 
> inconsistency? Or maybe it's OK?

First install the macports.sqlext port. Then run this command (all one 
line):

sqlite3 /opt/local/var/macports/registry/registry.db ".load 
/opt/local/lib/sqlite3/macports.sqlext" "PRAGMA integrity_check"

That will check that the database is internally consistent. It does not 
however check that the data is correct with respect to external factors, 
e.g. whether the files that each port is recorded as installing actually 
exist in the filesystem.

> Deleting everything takes some time, so before doing it...

If you're no longer seeing errors, no need to delete anything I guess. 
It's probably worth running a test with smartctl (from the smartmontools 
port), just in case.

- Josh


More information about the macports-users mailing list