Bug 222502 - ports-mgmt/pkg: pkg-1.10.1: archive_read_open_filename((null))
Summary: ports-mgmt/pkg: pkg-1.10.1: archive_read_open_filename((null))
Status: New
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: 2018-10-20 18:55 UTC (History)
5 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".