Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#31072 closed defect (wontfix)

corrupt flat registry cannot be converted to sqlite

Reported by: newenglishman@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: base Version: 2.0.2
Keywords: registry Cc:
Port:

Description

I am unable to execute any macports commands (including "port help" and "sudo port selfupdate"). Each time I run any command, with or without sudo, I get this error.

Warning: Converting your registry to sqlite format, this might take a while...
DEBUG: can't read "props(files)": no such element in array
    while executing
"$regref map $props(files)"
    invoked from within
"registry::write {
        set regref [registry::entry create $props(name) $props(version) $props(revision) $props(variants) $props(epoch)]
        $re..."
    (procedure "receipt_sqlite::create_entry_l" line 3)
    invoked from within
"receipt_sqlite::create_entry_l $proplist"
    (procedure "registry::convert_to_sqlite" line 62)
    invoked from within
"registry::convert_to_sqlite"
Failed to convert your registry to sqlite!
    while executing
"error "Failed to convert your registry to sqlite!""
    (procedure "mportinit" line 561)
    invoked from within
"mportinit ui_options global_options global_variations"
Error: /opt/local/bin/port: Failed to initialize MacPorts, Failed to convert your registry to sqlite!

I installed the latest (v2.0.2) macports binaries via the dmg file and the problem persists.

Thanks for your help.

Change History (3)

comment:1 Changed 13 years ago by jmroot (Joshua Root)

Resolution: wontfix
Status: newclosed
Summary: macports base - registry failure blocks all port commandscorrupt flat registry cannot be converted to sqlite

One of your flat receipts is corrupt. There isn't really anything that could be done about this automatically. You can either try to fix or remove the receipt (which will almost certainly orphan some files), or uninstall MacPorts and start again.

comment:2 in reply to:  1 ; Changed 13 years ago by newenglishman@…

Replying to jmr@…:

One of your flat receipts is corrupt. There isn't really anything that could be done about this automatically. You can either try to fix or remove the receipt (which will almost certainly orphan some files), or uninstall MacPorts and start again.

Thanks for the help, even though I don't like the news.

Is there a help document on how to find a corrupt receipt and possibly fix it? I don't even know what a receipt is, but I'm willing to learn.

Alternatively is there a way to list my installed ports without using the port command? That would make it easier to install them again after reinstalling MacPorts.

comment:3 in reply to:  2 Changed 13 years ago by someuser12

Maybe you can have a look at the comment I left in #30611 for a method to know what port is blocking the conversion.

To know the list of installed ports, you can list the content of the directory /opt/local/var/macports/receipts: each subdir has a name of an installed port, and in each of them there is one subdir for each installed version, and it contains a receipt.bz2 file. To know if the version is active or not, you have to look into the receipt.bz2 file (e.g. with bzcat receipt.bz2|less) and look if it contains active 1 (the port is installed and active) or active 0 (the port is installed but inactive).

Note: See TracTickets for help on using tickets.