Bug 222502 - ports-mgmt/pkg: archive_read_open_filename((null))
Summary: ports-mgmt/pkg: archive_read_open_filename((null))
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-pkg (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-21 20:06 UTC by Eugene Grosbein
Modified: 2022-05-04 13:41 UTC (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Grosbein freebsd_committer 2017-09-21 20:06:40 UTC
Hi!

pkg-static(8) can be used in chroot environment having no networking to populate it with pre-downloaded set of package files, that is: pkg-static install -yU *.txz

It fails with non-descriptive error if such set of files has two different versions of the same package. It is easy to reproduce this without mentioned chroot environment, too.

# fetch http://pkg.freebsd.org/FreeBSD:11:amd64/release_0/All/snappy-1.1.3.txz
# fetch http://pkg.freebsd.org/FreeBSD:11:amd64/release_1/All/snappy-1.1.4.txz
# pkg install -yU snappy-1.1.3.txz snappy-1.1.4.txz
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        snappy: 1.1.4

Number of packages to be installed: 1
pkg: archive_read_open_filename((null)): Failed to open '(null)'

More understandable error message is expected. Also, '(null)' points to some internal logic error.
Comment 1 Matthew L. Dailey 2018-01-02 15:38:10 UTC
I ran into this issue this morning using pkg 1.10.3 trying to reinstall a custom-built package:

# pkg --version
1.10.3

# pkg -d install -y /tmp/ldb-1.1.29_1.txz
DBG(1)[34197]> pkg initialized
Updating FreeBSD repository catalogue...
DBG(1)[34197]> PkgRepo: verifying update for FreeBSD
DBG(1)[34197]> Pkgrepo, begin update of '/var/db/pkg/repo-FreeBSD.sqlite'
DBG(1)[34197]> Fetch: fetching from: http://pkgmir.geo.freebsd.org/FreeBSD:11:amd64/latest/meta.txz with opts "i"
DBG(1)[34197]> Fetch: fetching from: http://pkgmir.geo.freebsd.org/FreeBSD:11:amd64/latest/packagesite.txz with opts "i"
FreeBSD repository is up to date.
All repositories are up to date.
DBG(1)[34197]> want to get an advisory lock on a database
DBG(1)[34197]> Jobs> Adding file: /tmp/ldb-1.1.29_1.txz
DBG(1)[34197]> removing ldb from the request as it is the same as local
DBG(1)[34197]> trying to delete local package ldb-1.1.29_1 on install/upgrade, reiterate on SAT
Checking integrity...DBG(1)[34197]> Binary> loading /var/cache/pkg/ldb-1.1.29_1-c96c1cd1cd.txz
DBG(1)[34197]> check integrity for 1 items added
 done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be REINSTALLED:
	ldb-1.1.29_1

Number of packages to be reinstalled: 1
DBG(1)[34197]> want to upgrade advisory to exclusive lock
pkg: archive_read_open_filename((null)): Failed to open '(null)'
DBG(1)[34197]> release an exclusive lock on a database
DBG(1)[34197]> release an advisory lock on a database
Comment 2 Janos Mohacsi 2018-01-29 08:35:18 UTC
This is not an individual problem. See 


pkg -d install xmltooling-1.6.3_1.txz
DBG(1)[39685]> pkg initialized
Updating FreeBSD repository catalogue...
DBG(1)[39685]> PkgRepo: verifying update for FreeBSD
DBG(1)[39685]> Pkgrepo, begin update of '/var/db/pkg/repo-FreeBSD.sqlite'
DBG(1)[39685]> Fetch: fetching from: http://pkgmir.geo.freebsd.org/FreeBSD:11:amd64/quarterly/meta.txz with opts "i"
DBG(1)[39685]> Fetch: fetching from: http://pkgmir.geo.freebsd.org/FreeBSD:11:amd64/quarterly/packagesite.txz with opts "i"
FreeBSD repository is up to date.
All repositories are up to date.
DBG(1)[39685]> want to get an advisory lock on a database
DBG(1)[39685]> Jobs> Adding file: xmltooling-1.6.3_1.txz
DBG(1)[39685]> removing xmltooling from the request as it is the same as local
DBG(1)[39685]> trying to delete local package xmltooling-1.6.2 on install/upgrade, reiterate on SAT
Checking integrity...DBG(1)[39685]> check integrity for 1 items added
 done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
	xmltooling: 1.6.2 -> 1.6.3_1

Number of packages to be upgraded: 1

Proceed with this action? [y/N]: y
DBG(1)[39685]> want to upgrade advisory to exclusive lock
pkg: archive_read_open_filename((null)): Failed to open '(null)'
DBG(1)[39685]> release an exclusive lock on a database
DBG(1)[39685]> release an advisory lock on a database
Comment 3 Brad Davis freebsd_committer 2018-10-20 18:38:50 UTC
Can you try using `pkg add' ?  IIRC, that goes around a lot of the code involved with repo handling.
Comment 4 Eugene Grosbein freebsd_committer 2018-10-20 18:55:14 UTC
(In reply to Brad Davis from comment #3)

"pkg add" works. But this PR is about some logic errors in the "pkg install".
Comment 5 Baptiste Daroussin freebsd_committer 2021-08-18 08:38:37 UTC
From the testing I cannot reproduce anymore, I remember fixing something like this in the past.

If not please reopen the PR.
Comment 6 johannesfalke 2021-11-15 13:48:55 UTC
# pkg --version
1.17.4

# pkg -d install /var/cache/pkg/libmediainfo-20.09.txz
DBG(1)[25981]> pkg initialized
Updating FreeBSD repository catalogue...
DBG(1)[25981]> PkgRepo: verifying update for FreeBSD
DBG(1)[25981]> Pkgrepo, begin update of '/var/db/pkg/repo-FreeBSD.sqlite'
DBG(1)[25981]> Request to fetch pkg+http://pkg.eu.FreeBSD.org/FreeBSD:12:amd64/latest/meta.conf
DBG(1)[25981]> opening libfetch fetcher
DBG(1)[25981]> Fetch > libfetch: connecting
DBG(1)[25981]> Fetch: fetching from: http://pkg0.bme.freebsd.org/FreeBSD:12:amd64/latest/meta.conf with opts "i"
DBG(1)[25981]> Request to fetch pkg+http://pkg.eu.FreeBSD.org/FreeBSD:12:amd64/latest/packagesite.pkg
DBG(1)[25981]> opening libfetch fetcher
DBG(1)[25981]> Fetch > libfetch: connecting
DBG(1)[25981]> Fetch: fetching from: http://pkg0.bme.freebsd.org/FreeBSD:12:amd64/latest/packagesite.pkg with opts "i"
DBG(1)[25981]> Request to fetch pkg+http://pkg.eu.FreeBSD.org/FreeBSD:12:amd64/latest/packagesite.txz
DBG(1)[25981]> opening libfetch fetcher
DBG(1)[25981]> Fetch > libfetch: connecting
DBG(1)[25981]> Fetch: fetching from: http://pkg0.bme.freebsd.org/FreeBSD:12:amd64/latest/packagesite.txz with opts "i"
FreeBSD repository is up to date.
All repositories are up to date.
DBG(1)[25981]> want to get an advisory lock on a database
DBG(1)[25981]> Jobs> Adding file: /var/cache/pkg/libmediainfo-20.09.txz
DBG(1)[25981]> removing libmediainfo from the request as it is the same as local
DBG(1)[25981]> solver: for package: libmediainfo cannot find provide for requirement: libtinyxml2.so.8
DBG(1)[25981]> trying to delete local package libmediainfo-21.09 on install/upgrade, reiterate on SAT
Checking integrity...DBG(1)[25981]> check integrity for 1 items added
 done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be DOWNGRADED:
        libmediainfo: 21.09 -> 20.09

Number of packages to be downgraded: 1

Proceed with this action? [y/N]: y
DBG(1)[25981]> want to upgrade advisory to exclusive lock
pkg: archive_read_open_filename((null)): Failed to open '(null)'
DBG(1)[25981]> release an exclusive lock on a database
DBG(1)[25981]> release an advisory lock on a database

I still see this issue
Comment 7 Eugene Grosbein freebsd_committer 2022-05-04 13:41:24 UTC
This is reproducible with pkg-1.17.5_1 under 13.1-STABLE/amd64

# pkg install -yU rsync-3.2.3_1.pkg rsync-3.2.4.pkg
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        rsync: 3.2.4

Number of packages to be installed: 1
pkg: archive_read_open_filename((null)): Failed to open '(null)'