Bug 1151956

Summary: [DNF Mock] Config error: releasever not given and can not be detected from the installroot.
Product: [Fedora] Fedora Reporter: Marcin Juszkiewicz <mjuszkie>
Component: fedpkgAssignee: Pavol Babinčák <pbabinca>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: dennis, jdisnard, jorti, jskarvad, mebrown, mhroncok, mizdebsk, mjuszkie, msimacek, msuchy, pnemade, praiskup, rhbugs, s, tmraz, twaugh, williams
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rpkg-1.33-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1211115 (view as bug list) Environment:
Last Closed: 2015-04-21 19:27:29 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:
Bug Depends On:    
Bug Blocks: 1211115    
Attachments:
Description Flags
root.log from fedpkg mockbuild
none
root.log from manual mock call none

Description Marcin Juszkiewicz 2014-10-13 07:48:50 UTC
Created attachment 946264 [details]
root.log from fedpkg mockbuild

Description of problem:

When DNF support is enabled in mock then 'fedpkg mockbuild' for rawhide fails:

INFO: calling preinit hooks
Mock Version: 1.2.0
INFO: Mock Version: 1.2.0
Start: /usr/bin/dnf update
Config error: releasever not given and can not be detected from the installroot.
ERROR: Exception(/home/hrw/HDD/devel/redhat/rpmbuild/fedora-packager/mock/mock-1.2.0-1.fc22.src.rpm) Config(rawhide-x86_64) 0 minutes 0 seconds

Works if I want to build for f21.

Version-Release number of selected component (if applicable):

mock 1.2.0-1
fedora-packager 0.5.10.4-2.fc21

How reproducible:

always

Steps to Reproduce:
1. fedpkg clone -a flashrom
2. cd flashrom
3. enable dnf in /etc/mock/site-defaults.cfg
4. fedpkg mockbuild

Actual results:

09:46 hrw@puchatek:flashrom$ LANGUAGE=C fedpkg mockbuild

Wrote: /home/hrw/HDD/devel/redhat/rpmbuild/fedora-packager/flashrom/flashrom-0.9.7-1.svn1850.fc22.src.rpm
INFO: mock.py version 1.2.0 starting (python version = 2.7.8)...
Start: init plugins
INFO: selinux enabled
Finish: init plugins
Start: run
INFO: Start(/home/hrw/HDD/devel/redhat/rpmbuild/fedora-packager/flashrom/flashrom-0.9.7-1.svn1850.fc22.src.rpm)  Config(rawhide-x86_64)
Start: clean chroot
Finish: clean chroot
Start: chroot init
INFO: calling preinit hooks
Mock Version: 1.2.0
INFO: Mock Version: 1.2.0
Start: /usr/bin/dnf update
Config error: releasever not given and can not be detected from the installroot.
ERROR: Exception(/home/hrw/HDD/devel/redhat/rpmbuild/fedora-packager/flashrom/flashrom-0.9.7-1.svn1850.fc22.src.rpm) Config(rawhide-x86_64) 0 minutes 0 seconds
INFO: Results and/or logs in: /home/hrw/HDD/devel/redhat/rpmbuild/fedora-packager/flashrom/results_flashrom/0.9.7/1.svn1850.fc22
INFO: Cleaning up build root ('cleanup_on_failure=True')
Start: clean chroot
Finish: clean chroot
ERROR: Command failed. See logs for output.
 # /usr/bin/dnf --installroot /var/lib/mock/rawhide-x86_64/root groupinstall build --setopt=tsflags=nocontexts
Could not run mockbuild: Command '['mock', '--configdir', '/tmp/fedora-devel-x86_64.gAwPJXmockconfig', '-r', 'fedora-devel-x86_64', '--resultdir', '/home/hrw/HDD/devel/redhat/rpmbuild/fedora-packager/flashrom/results_flashrom/0.9.7/1.svn1850.fc22', '--rebuild', '/home/hrw/HDD/devel/redhat/rpmbuild/fedora-packager/flashrom/flashrom-0.9.7-1.svn1850.fc22.src.rpm']' returned non-zero exit status 1

Expected results:

build goes and final packages are created

Additional info:

Comment 1 Marcin Juszkiewicz 2014-10-13 07:52:41 UTC
Created attachment 946268 [details]
root.log from manual mock call

When I run 'mock flashrom-0.9.7-1.svn1850.fc22.src.rpm' then builds fine.

Comment 2 Dennis Gilmore 2014-10-13 08:35:05 UTC
Reassigning to mock. fedpkg has no way to know dnf is used and it shouldn't matter. Mock should do the same thing regardless of what's used in the backend

Comment 3 Mikolaj Izdebski 2014-10-13 09:03:23 UTC
As workaround you can set releasever manually, for example:
config_opts['releasever'] = '22'

Comment 4 Marcin Juszkiewicz 2014-10-13 09:05:47 UTC
Mikołaj: I rarely use 'fedpkg mockbuild' - most of builds do with 'mock --verbose' so this issue does not affects me too much.

Comment 5 Mikolaj Izdebski 2014-10-13 09:10:30 UTC
I see, I just wanted to point a workaround.

IMO this is a bug in fedpkg/rpkg - mock requires releasever and all configs shipped with mock by default have explicit releasever set. Fedpkg generates its own mock config without releasever, which causes mock to fail.

Comment 6 Miroslav Suchý 2014-10-13 11:25:17 UTC
$ ls -l /etc/mock/default.cfg                                                                      lrwxrwxrwx 1 root root 25 Oct 13 13:20 /etc/mock/default.cfg -> fedora-rawhide-x86_64.cfg

$ grep dnf /etc/mock/site-defaults.cfg 
config_opts['package_manager'] = 'dnf'

$ mock --rebuild mock-1.2.0-1.fc20.src.rpm
successfully pass

likely because:
$ grep releasever /etc/mock/default.cfg
config_opts['releasever'] = '22'

Can you please run:
$ rpm -V mock 

and verify that your /etc/mock/fedora-rawhide-x86_64.cfg
and you do not have any .rpmnew/.rpmsave leftovers?

Comment 7 Marcin Juszkiewicz 2014-10-13 11:31:52 UTC
13:27 hrw@puchatek:~$  ls -l /etc/mock/default.cfg 
lrwxrwxrwx. 1 root root 25 10-01 11:24 /etc/mock/default.cfg -> fedora-rawhide-x86_64.cfg

13:27 hrw@puchatek:~$  grep dnf /etc/mock/site-defaults.cfg 
config_opts['package_manager'] = 'dnf'

13:27 hrw@puchatek:~$ rpm -V mock
S.5....T.  c /etc/mock/site-defaults.cfg

13:28 hrw@puchatek:~$ ls /etc/mock/
default.cfg           fedora-19-x86_64.cfg   fedora-21-s390x.cfg
epel-5-i386.cfg       fedora-20-armhfp.cfg   fedora-21-x86_64.cfg
epel-5-ppc.cfg        fedora-20-i386.cfg     fedora-rawhide-aarch64.cfg
epel-5-x86_64.cfg     fedora-20-ppc64.cfg    fedora-rawhide-armhfp.cfg
epel-6-i386.cfg       fedora-20-ppc.cfg      fedora-rawhide-i386.cfg
epel-6-ppc64.cfg      fedora-20-s390.cfg     fedora-rawhide-ppc64.cfg
epel-6-x86_64.cfg     fedora-20-s390x.cfg    fedora-rawhide-ppc64le.cfg
epel-7-x86_64.cfg     fedora-20-x86_64.cfg   fedora-rawhide-s390.cfg
fedora-19-armhfp.cfg  fedora-21-aarch64.cfg  fedora-rawhide-s390x.cfg
fedora-19-i386.cfg    fedora-21-armhfp.cfg   fedora-rawhide-sparc.cfg
fedora-19-ppc64.cfg   fedora-21-i386.cfg     fedora-rawhide-x86_64.cfg
fedora-19-ppc.cfg     fedora-21-ppc64.cfg    logging.ini
fedora-19-s390.cfg    fedora-21-ppc64le.cfg  site-defaults.cfg
fedora-19-s390x.cfg   fedora-21-s390.cfg

13:28 hrw@puchatek:~$ diff -u site-defaults.cfg /etc/mock/site-defaults.cfg 
--- site-defaults.cfg   2014-10-12 22:38:04.000000000 +0200
+++ /etc/mock/site-defaults.cfg 2014-10-13 09:30:50.660049072 +0200
@@ -48,6 +48,7 @@
 # config_opts['package_manager'] = 'yum'
 # If you want to use DNF, set it to 'dnf'. To use DNf you need to have dnf and
 # dnf-plugins-core installed
+config_opts['package_manager'] = 'dnf'
 
 # You can configure Yum, DNF, rpm and rpmbuild executable paths if you need to
 # use different versions that the system-wide ones


Note that calling "mock" directly works. Calling 'fedpkg mockbuild' fails.

Comment 8 Miroslav Suchý 2014-10-13 11:36:08 UTC
mock --rebuild /tmp/flashrom/flashrom-0.9.7-1.svn1850.fc22.src.rpm

Finish sucessfully, while:

fedpkg mockbuild

(as stated in #0) fail.

Investigating...

Comment 9 Miroslav Suchý 2014-10-13 11:53:09 UTC
I see:
$ fedpkg -v mockbuild
...
Initiating a koji session to http://koji.fedoraproject.org/kojihub
Temporary mock config directory: /tmp/fedora-devel-x86_64.Fzqv4Gmockconfig
Running mock --configdir /tmp/fedora-devel-x86_64.Fzqv4Gmockconfig -r fedora-devel-x86_64 --resultdir /tmp/flashrom/results_flashrom/0.9.7/1.svn1850.fc22 --rebuild /tmp/flashrom/flashrom-0.9.7-1.svn1850.fc22.src.rpm directly on the tty

When I pause the process here and do:

/tmp/fedora-devel-x86_64.Fzqv4Gmockconfig/fedora-devel-x86_64.cfg

which does not contain releasever variable.

Note that mock no longer ships fedora-devel-*.cfg config files. These were for long time symlinks to fedora-rawhide-*.cfg. And with these last release we decided that it is time to remove it.

I'm not sure what fedpkg is doing when the file is missing (it would be nice to produce some warning). But the solution seems to be (and I verified that is then working):


--- ./src/fedpkg/__init__.py.orig       2014-10-13 13:46:01.511026580 +0200
+++ ./src/fedpkg/__init__.py    2014-10-13 13:46:16.462071850 +0200
@@ -153,7 +153,7 @@
             self._distval = self._findmasterbranch()
             self._distvar = 'fedora'
             self.dist = 'fc%s' % self._distval
-            self.mockconfig = 'fedora-devel-%s' % self.localarch
+            self.mockconfig = 'fedora-rawhide-%s' % self.localarch
             self.override = None
             self._distunset = 'rhel'
         # If we don't match one of the above, punt

Therefore flipping back to fedpkg.

Comment 11 Miro Hrončok 2015-01-30 22:53:31 UTC
Will this fix be propagated to Fedora as well?

Comment 12 Tomas Mraz 2015-02-18 17:58:00 UTC
Please. :)

Comment 13 Pavol Babinčák 2015-04-15 15:29:32 UTC
*** Bug 1212112 has been marked as a duplicate of this bug. ***

Comment 14 Tim Waugh 2015-04-15 15:47:51 UTC
Marking as affecting Fedora 22 and re-opening as there is no package fixing this in Fedora 22.

Comment 15 Fedora Update System 2015-04-15 15:51:41 UTC
rpkg-1.33-1.fc22,fedpkg-1.20-1.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/rpkg-1.33-1.fc22,fedpkg-1.20-1.fc22

Comment 16 Fedora Update System 2015-04-15 15:53:12 UTC
rpkg-1.33-1.fc21, fedpkg-1.20-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/rpkg-1.33-1.fc21,fedpkg-1.20-1.fc21

Comment 17 Fedora Update System 2015-04-15 15:54:57 UTC
rpkg-1.33-1.el7,fedpkg-1.20-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/rpkg-1.33-1.el7,fedpkg-1.20-1.el7

Comment 18 Fedora Update System 2015-04-16 08:58:39 UTC
rpkg-1.34-1.el6,fedpkg-1.20-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/rpkg-1.34-1.el6,fedpkg-1.20-1.el6

Comment 19 Fedora Update System 2015-04-17 18:15:11 UTC
Package rpkg-1.33-1.el7, fedpkg-1.20-1.el7:
* should fix your issue,
* was pushed to the Fedora EPEL 7 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing rpkg-1.33-1.el7 fedpkg-1.20-1.el7'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2015-5830/rpkg-1.33-1.el7,fedpkg-1.20-1.el7
then log in and leave karma (feedback).

Comment 20 Fedora Update System 2015-04-21 19:27:29 UTC
rpkg-1.33-1.fc22, fedpkg-1.20-1.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 21 Fedora Update System 2015-04-27 08:41:26 UTC
rpkg-1.33-1.fc21, fedpkg-1.20-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 22 Fedora Update System 2015-05-08 16:39:34 UTC
rpkg-1.34-1.el6, fedpkg-1.20-1.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 23 Fedora Update System 2015-05-08 16:42:00 UTC
rpkg-1.33-1.el7, fedpkg-1.20-1.el7 has been pushed to the Fedora EPEL 7 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 24 Miroslav Suchý 2015-11-04 14:15:32 UTC
*** Bug 1181722 has been marked as a duplicate of this bug. ***