Opened 13 years ago

Closed 12 years ago

#31878 closed defect (duplicate)

"port echo leaves" leads to error "an invalid entry was passed"

Reported by: t.scheller@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: base Version: 2.0.3
Keywords: Cc: nerdling (Jeremy Lavergne)
Port:

Description

$ port echo leaves
an invalid entry was passed
    while executing
"$dependent name"
    (procedure "receipt_sqlite::list_dependents" line 18)
    invoked from within
"${macports::registry.format}::list_dependents $name $version $revision $variants"
    (procedure "registry::list_dependents" line 3)
    invoked from within
"registry::list_dependents $iname"
    (procedure "get_leaves_ports" line 14)
    invoked from within
"get_${name}_ports"
    ("^leaves(@.*)?$" arm line 8)
    invoked from within
"switch -regex -- $token {
        ^\\)$               -
        ^\;                 -
        ^_EOF_$             { # End of expression/cmd/file
     ..."
    (procedure "element" line 12)
    invoked from within
"element reslist"
    (procedure "unaryExpr" line 17)
    invoked from within
"unaryExpr reslist"
    (procedure "andExpr" line 4)
    invoked from within
"andExpr reslist"
    (procedure "orExpr" line 4)
    invoked from within
"orExpr blist"
    (procedure "seqExpr" line 16)
    invoked from within
"seqExpr reslist"
    (procedure "portExpr" line 3)
    invoked from within
"portExpr portlist"
    (procedure "process_cmd" line 85)
    invoked from within
"process_cmd $remaining_args"
    invoked from within
"if { [llength $remaining_args] > 0 } {

    # If there are remaining arguments, process those as a command
    set exit_status [process_cmd $remaining..."
    (file "/opt/local/bin/port" line 4707)

Change History (6)

comment:1 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Sounds like your registry is corrupt somehow. I don't know why.

comment:2 Changed 13 years ago by t.scheller@…

Hmm okay registry was a good tip. It is really scary to have something called "registry" on Mac OS X ;-)

I've added some puts into receipt_sqlite.tcl and traced down the problem to be related with zlib. If I try to uninstall zlib, I get the same error.

I guess the problem is that it searches for entry 164 (I guess counting from 0) but there are only 164 entries (counting from 1) in the "ports" table

I do not understand the structure of the database. Where are the dependencies defined?

Any ideas how to correct this or how to continue in tracing this down?

$ sudo port list leaves
TKS was here !!!!!!!!!!!!!!
list leaves
TKS registry::list_depends zlib   0
TKS receipt_sqlite::list_dependents zlib   0
TKS port: ::registry::entry163 - dependent: ::registry::entry17
TKS port: ::registry::entry163 - dependent: ::registry::entry21
TKS port: ::registry::entry163 - dependent: ::registry::entry23
TKS port: ::registry::entry163 - dependent: ::registry::entry24
TKS port: ::registry::entry163 - dependent: ::registry::entry25
TKS port: ::registry::entry163 - dependent: ::registry::entry85
TKS port: ::registry::entry163 - dependent: ::registry::entry164
an invalid entry was passed
    while executing
"$dependent name"
    (procedure "receipt_sqlite::list_dependents" line 20)
    invoked from within
"${macports::registry.format}::list_dependents $name $version $revision $variants"
    (procedure "registry::list_dependents" line 4)
    invoked from within
"registry::list_dependents $iname"
    (procedure "get_leaves_ports" line 14)
    invoked from within
"get_${name}_ports"
    ("^leaves(@.*)?$" arm line 8)
    invoked from within
"switch -regex -- $token {
        ^\\)$               -
        ^\;                 -
        ^_EOF_$             { # End of expression/cmd/file
     ..."
    (procedure "element" line 12)
    invoked from within
"element reslist"
    (procedure "unaryExpr" line 17)
    invoked from within
"unaryExpr reslist"
    (procedure "andExpr" line 4)
    invoked from within
"andExpr reslist"
    (procedure "orExpr" line 4)
    invoked from within
"orExpr blist"
    (procedure "seqExpr" line 16)
    invoked from within
"seqExpr reslist"
    (procedure "portExpr" line 3)
    invoked from within
"portExpr portlist"
    (procedure "process_cmd" line 85)
    invoked from within
"process_cmd $remaining_args"
    invoked from within
"if { [llength $remaining_args] > 0 } {

    # If there are remaining arguments, process those as a command
    set exit_status [process_cmd $remaining..."
    (file "/opt/local/bin/port" line 4709)

comment:3 Changed 13 years ago by t.scheller@…

Okay it is definitively an "array index out of bounds" exception. I added

if {$dependent == "::registry::entry164"} {

and it works.

But still zlib depends on something that is not there.

2 versions of zlib were installed:

--->  The following versions of zlib are currently installed:
--->      zlib @1.2.5_0 (active)
--->      zlib @1.2.5_0+universal

I managed to uninstall "zlib @1.2.5_0+universal" but the problem is still there. Then I installed "zlib @1.2.5_0+universal" again and uninstalled "zlib @1.2.5_0" but the problem is still there.

comment:4 Changed 13 years ago by nerdling (Jeremy Lavergne)

Cc: snc@… added

I'm assuming here, based on how I can just drop files into var/macports/software/$name/ and it skips to destroot phase:

If you know what you have installed, you can deactivate everything and blow away the registry. Upon trying to install again, it'll find that you already have the archives in place and just activate everything again.

comment:5 Changed 13 years ago by nerdling (Jeremy Lavergne)

So I'm recommending on my assumption:

  • deactivate installed
  • selfupdate twice
  • install your list of ports again

comment:6 Changed 12 years ago by neverpanic (Clemens Lang)

Resolution: duplicate
Status: newclosed

See #34482 for more info on why this happens and how it can be resolved.

Note: See TracTickets for help on using tickets.