sqlite error: disk I/O error

Rainer Müller raimue at macports.org
Mon Jul 12 03:34:40 PDT 2010


On 07/08/2010 09:57 AM, Ryan Schmidt wrote:
> I pressed Control-C while MacPorts was activating a port. Now anything I do with port gives me:
> 
> 
> sqlite error: disk I/O error (10) while executing query: ATTACH DATABASE '/opt/local/var/macports/registry/registry.db' AS registry
>    while executing
> "registry::open $db_path"
>    (procedure "mportinit" line 536)
>    invoked from within
> "mportinit ui_options global_options global_variations"
> Error: /opt/local/bin/port: Failed to initialize MacPorts, sqlite error: disk I/O error (10) while executing query: ATTACH DATABASE '/opt/local/var/macports/registry/registry.db' AS registry
> 
> 
> How do I recover?

I am not sure if I am right ("I/O error" sounds strange), so I can only
guess based on my prior experience.

Your SQLite DB was probably in an inconsistent state. SQLite keeps a
journal log in a separate file (it's "registry.db-journal" or something
like that), which is used to recover from interrupted actions. In order
to re-apply this log and get a consistent DB, it needs write access to
the registry.db file. So when you ran this command without root
privileges it was not able to fix the registry and reported an error
(although I would not expect "I/O error").

To get around this, just run with root privileges and it should fix itself.

Rainer


More information about the macports-users mailing list