[MacPorts] #34482: uninstall failure: "an invalid entry was passed"
MacPorts
noreply at macports.org
Sun Aug 12 16:07:46 PDT 2012
#34482: uninstall failure: "an invalid entry was passed"
------------------------------------+---------------------------------------
Reporter: jasperfrumau@… | Owner: cal@…
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: base | Version: 2.1.0
Keywords: | Port:
------------------------------------+---------------------------------------
Comment(by cal@…):
I have just looked at this problem again and apparently while some of my
findings were correct I confused "dependencies" and "dependents" in the
progress of advising users on how to fix this. This also means that my
previous advise on how to fix this was probably wrong and might leave you
with a couple of uninstallable packages (you can just use -f in this
case).
To explain this: I was under the impression that the missing port
referenced by the now invalid ID causing this issue was a common
dependency of the ports listed by name in the `dependencies` table, i.e.,
{{{
sqlite> SELECT * FROM dependencies WHERE id NOT IN (SELECT DISTINCT id
FROM ports);
618|apr|
618|expat|
618|libiconv|
618|db46|
618|sqlite3|
}}}
means that port 618 must be a dependency of apr, expat, libiconv, db46 and
sqlite3. However, it really is the other way around: The missing has
dependencies to apr, expat, libiconv, db46 and sqlite3. Since you will
never be able to uninstall this port or manage any of its files using
macports again without the missing entry in `ports`, those entries in the
`dependencies` table are superfluous and can simply be removed. In fact,
not only these, but also all entries in the `files` table with the same id
can be removed (and if there are any with the `active` flag set, they
should also be deleted on disk, but if that really happened there would be
some serious problems with your installation).
So, in your case the missing ID 618 must have the ports apr, expat,
libiconv, db46 and sqlite3 as dependencies. This would match the apr-util
port. We can reassure the missing port is apr-util by looking at the
`files` table:
{{{
sqlite> SELECT active,path FROM files WHERE id = 618;
0|/opt/local/bin/apu-1-config
0|/opt/local/include/apr-1/apr_anylock.h
0|/opt/local/include/apr-1/apr_base64.h
0|/opt/local/include/apr-1/apr_buckets.h
0|/opt/local/include/apr-1/apr_date.h
0|/opt/local/include/apr-1/apr_dbd.h
0|/opt/local/include/apr-1/apr_dbm.h
0|/opt/local/include/apr-1/apr_hooks.h
0|/opt/local/include/apr-1/apr_ldap.h
0|/opt/local/include/apr-1/apr_ldap_init.h
0|/opt/local/include/apr-1/apr_ldap_option.h
0|/opt/local/include/apr-1/apr_ldap_rebind.h
0|/opt/local/include/apr-1/apr_ldap_url.h
0|/opt/local/include/apr-1/apr_md4.h
0|/opt/local/include/apr-1/apr_md5.h
0|/opt/local/include/apr-1/apr_memcache.h
0|/opt/local/include/apr-1/apr_optional.h
0|/opt/local/include/apr-1/apr_optional_hooks.h
0|/opt/local/include/apr-1/apr_queue.h
0|/opt/local/include/apr-1/apr_reslist.h
0|/opt/local/include/apr-1/apr_rmm.h
0|/opt/local/include/apr-1/apr_sdbm.h
0|/opt/local/include/apr-1/apr_sha1.h
0|/opt/local/include/apr-1/apr_strmatch.h
0|/opt/local/include/apr-1/apr_thread_pool.h
0|/opt/local/include/apr-1/apr_uri.h
0|/opt/local/include/apr-1/apr_uuid.h
0|/opt/local/include/apr-1/apr_xlate.h
0|/opt/local/include/apr-1/apr_xml.h
0|/opt/local/include/apr-1/apu.h
0|/opt/local/include/apr-1/apu_version.h
0|/opt/local/include/apr-1/apu_want.h
0|/opt/local/lib/apr-util-1/apr_dbd_odbc-1.so
0|/opt/local/lib/apr-util-1/apr_dbd_odbc.a
0|/opt/local/lib/apr-util-1/apr_dbd_odbc.la
0|/opt/local/lib/apr-util-1/apr_dbd_odbc.so
0|/opt/local/lib/apr-util-1/apr_dbd_sqlite3-1.so
0|/opt/local/lib/apr-util-1/apr_dbd_sqlite3.a
0|/opt/local/lib/apr-util-1/apr_dbd_sqlite3.la
0|/opt/local/lib/apr-util-1/apr_dbd_sqlite3.so
0|/opt/local/lib/apr-util-1/apr_dbm_db-1.so
0|/opt/local/lib/apr-util-1/apr_dbm_db.a
0|/opt/local/lib/apr-util-1/apr_dbm_db.la
0|/opt/local/lib/apr-util-1/apr_dbm_db.so
0|/opt/local/lib/aprutil.exp
0|/opt/local/lib/libaprutil-1.0.3.12.dylib
0|/opt/local/lib/libaprutil-1.0.dylib
0|/opt/local/lib/libaprutil-1.a
0|/opt/local/lib/libaprutil-1.dylib
0|/opt/local/lib/libaprutil-1.la
0|/opt/local/lib/pkgconfig/apr-util-1.pc
}}}
These are the files that once were installed by the now missing port. The
version number of the `libaprutil-1.0.3.12.dylib` file tells us it's an
old version of apr-util. The first column being 0 in all lines also tells
us there are no files in the filesystem owned by this port. We can thus
safely delete these rows:
{{{
DELETE FROM dependencies WHERE id = 618;
DELETE FROM files WHERE id = 618;
}}}
(Please, keep a backup before doing this)
This also gives more insight into how this issue might have been created:
For some reason, the entry corresponding to those in `files` and
`dependencies` has gone missing. That means it either was never added
(that's impossible, because it's ID was known before the other entries
were created) or it was deleted without deleting the other rows. This must
have happened after apr-util was deactivated, because (assuming it was
activated at some point in time) there probably is no way to modify any of
the other tables without the missing row in `ports`. Maybe there is a way
to uninstall a port but not delete the lines from `files` and
`dependencies`.
--
Ticket URL: <https://trac.macports.org/ticket/34482#comment:21>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
More information about the macports-tickets
mailing list