Bug 975858

Summary: dnf can't install in an empty installroot
Product: [Fedora] Fedora Reporter: Harald Hoyer <harald>
Component: dnfAssignee: Ales Kozumplik <akozumpl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: akozumpl, jzeleny, kay, pnemade
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libsolv-0.3.0-5.git228d412.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-01 01:37:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Harald Hoyer 2013-06-19 13:25:26 UTC
$ mkdir container
$ sudo dnf -y --releasever=19 --nogpg --installroot=$(pwd)/container --disablerepo='*' --enablerepo=fedora install filesystem 
Config Error: No such file or directory: '/home/harald/git/fedora/filesystem/container/var/log/dnf.log'

$ mkdir -p container/var/log
$ sudo dnf -y --releasever=19 --nogpg --installroot=$(pwd)/container --disablerepo='*' --enablerepo=fedora install filesystem
mkdir: cannot create directory ‘container’: File exists
load_system_repo() failed.

Comment 1 Kay Sievers 2013-06-19 13:31:40 UTC
Note:
Things in general must be *very* careful when creating anything in the empty
and fresh root directory.

The filesystem.rpm sets up a couple of symlinks to directories, blindly
creating real directories instead of symlinks here will break setups.

Comment 2 Ales Kozumplik 2013-06-19 14:13:22 UTC
(In reply to Kay Sievers from comment #1)
> Note:
> Things in general must be *very* careful when creating anything in the empty
> and fresh root directory.

Kay, can you be more specific? DNF needs at least to put the .pid files somewhere, the logs, the metadata cache and the yumdb. Right now it's:

/var/run/dnf.pid
/var/log/dnf*log
/var/cache/dnf/
/var/lib/dnf/yumdb/

How should DNF ideally place these? 

Also, it is definitely not possible to wait until the filelist RPM is installed (it might not even be a part of the transaction and we need the cache dir before even downloading any RPMs).

Comment 3 Harald Hoyer 2013-06-19 14:34:48 UTC
/var/run/dnf.pid -> /run/dnf.pid

Comment 4 Kay Sievers 2013-06-19 14:40:41 UTC
(In reply to Harald Hoyer from comment #3)
> /var/run/dnf.pid -> /run/dnf.pid

This should be safe for now, for the current status quo, yes.

But the whole approach to place things into deeper-level subdirs in an
empty / before filesystem.rpm is installed is just a recipe for future
problems. :)
I guess we need some general solution to that problem, I'm confident
other tools or future changes will run into the same problem again.

Comment 5 Ales Kozumplik 2013-06-21 13:21:45 UTC
fixed by ae1e78f, included in dnf-0.3.8.

Comment 6 Fedora Update System 2013-06-24 13:25:57 UTC
libsolv-0.3.0-5.git228d412.fc19, librepo-0.0.4-2.fc19, hawkey-0.3.14-1.git78b3aa0.fc19, dnf-0.3.8-2.git85524ae.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/libsolv-0.3.0-5.git228d412.fc19,dnf-0.3.8-2.git85524ae.fc19,hawkey-0.3.14-1.git78b3aa0.fc19,librepo-0.0.4-2.fc19

Comment 7 Fedora Update System 2013-06-24 18:50:25 UTC
Package libsolv-0.3.0-5.git228d412.fc19, librepo-0.0.4-2.fc19, hawkey-0.3.14-1.git78b3aa0.fc19, dnf-0.3.8-2.git85524ae.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing libsolv-0.3.0-5.git228d412.fc19 librepo-0.0.4-2.fc19 hawkey-0.3.14-1.git78b3aa0.fc19 dnf-0.3.8-2.git85524ae.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-11602/libsolv-0.3.0-5.git228d412.fc19,dnf-0.3.8-2.git85524ae.fc19,hawkey-0.3.14-1.git78b3aa0.fc19,librepo-0.0.4-2.fc19
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2013-07-01 01:37:41 UTC
libsolv-0.3.0-5.git228d412.fc19, librepo-0.0.4-2.fc19, hawkey-0.3.14-1.git78b3aa0.fc19, dnf-0.3.8-2.git85524ae.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.