#379 KeyError: 'config_path' when trying to test in EPEL-8
Closed: fixed by ngompa. Opened by eclipseo.

fedora-review --mock-config epel-8-x86_64 -n lastpass-cli
INFO: Processing local files: lastpass-cli
INFO: Getting .spec and .srpm Urls from : Local files in /home/bob/packaging/fedora-scm/lastpass-cli
INFO:   --> SRPM url: file:///home/bob/packaging/fedora-scm/lastpass-cli/lastpass-cli-1.3.3-1.fc32.src.rpm
INFO:   --> Spec url: file:///home/bob/packaging/fedora-scm/lastpass-cli/lastpass-cli.spec
INFO: Using review directory: /home/bob/packaging/fedora-scm/lastpass-cli/review-lastpass-cli
INFO: Downloading (Source0): https://github.com/LastPass/lastpass-cli/archive/v1.3.3/lastpass-cli-1.3.3.tar.gz
INFO: Running checks and generating report
INFO: Results and/or logs in: /home/bob/packaging/fedora-scm/lastpass-cli/review-lastpass-cli/results
  File "/etc/mock/epel-8-x86_64.cfg", line 5, in <module>
    include('templates/centos-8.tpl')
KeyError: 'config_path'
ERROR: Exception down the road... (logs in /home/bob/.cache/fedora-review.log)

fedora-review.log:

01-22 22:50 root         DEBUG    Exception down the road...
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/FedoraReview/review_
helper.py", line 236, in run
    self._do_run(outfile)
  File "/usr/lib/python3.7/site-packages/FedoraReview/review_helper.py", line 226, in _do_run
    self._do_report(outfile)
  File "/usr/lib/python3.7/site-packages/FedoraReview/review_helper.py", line 99, in _do_report
    self._run_checks(self.bug.spec_file, self.bug.srpm_file, outfile)
  File "/usr/lib/python3.7/site-packages/FedoraReview/review_helper.py", line 117, in _run_checks
    self.checks.run_checks(output=output, writedown=not Settings.no_report)
  File "/usr/lib/python3.7/site-packages/FedoraReview/checks.py", line 382, in run_checks
    run_check(name)
  File "/usr/lib/python3.7/site-packages/FedoraReview/checks.py", line 357, in run_check
    check.run()
  File "/usr/lib/python3.7/site-packages/FedoraReview/plugins/generic_build.py", line 203, in run
    Mock.build(self.srpm.filename)
  File "/usr/lib/python3.7/site-packages/FedoraReview/mock.py", line 454, in build
    self.builddir_cleanup()
  File "/usr/lib/python3.7/site-packages/FedoraReview/mock.py", line 581, in builddir_cleanup
    paths = glob(os.path.join(self.get_builddir("BUILD"), "*"))
  File "/usr/lib/python3.7/site-packages/FedoraReview/mock.py", line 357, in get_builddir
    p = self._get_dir(os.path.join("root", self._topdir[1:]))
  File "/usr/lib/python3.7/site-packages/FedoraReview/mock.py", line 198, in _get_dir
    self._get_root()
  File "/usr/lib/python3.7/site-packages/FedoraReview/mock.py", line 185, in _get_root
    self.mock_root = config_opts["root"]
  File "/usr/lib/python3.7/site-packages/mockbuild/util.py", line 121, in __getitem__
    return self.__render_value(self.__dict__[key])
KeyError: 'root'
01-22 22:50 root         ERROR    Exception down the road... (logs in /home/bob/.cache/fedora-review.log)

@sergiomb Can you look it up? You're the last one that touched that part of the code.


Adding:

config_opts['config_path'] = mockdir

fixed the issue.

yes i'm curious

what version of mock and fedora-review you are using ?

fedora-review 0.7.4
mock 1.5.0-1.git.119.b1b5730.fc31 from copr:copr.fedorainfracloud.org:group_mock:mock

Adding:
config_opts['config_path'] = mockdir

fixed the issue.

where ?

        # we need disable trace from mock.util to avoid a lot of spurious
        # messages which are send to stdout
        logging.getLogger("trace").propagate = 0
        config_opts = mockbuild.util.setup_default_config_opts(None, "unknown",
            get_paths()['purelib'])
        config_opts['config_paths'] = []
        config_opts['config_path'] = mockdir
        config_opts['__jinja_expand'] = True
        mockbuild.util.update_config_from_file(config_opts, path, None)
        self.mock_root = config_opts["root"]

https://pagure.io/FedoraReview/blob/master/f/src/FedoraReview/mock.py#_177

Please test if this PR is the proper fix [1] , I'm confident that is .

[1]
https://pagure.io/FedoraReview/pull-request/380

I had update commit just right now to add this line [1]

[1]
config_opts['__jinja_expand'] = True

Worked fine even without that line.

without the line , review.txt shows [1] :smile:

[1]
Buildroot used: fedora-rawhide-{{ target_arch }}
instead
Buildroot used: fedora-rawhide-x86_64

Ha ok I didn't check the review.txt

Thank you for taking a look at this!

Huh, I see the same issue on fedora 31 (running fedora-rawhide-x86_64 chroot) now. Maybe it is related to the recent mock 2.0 / mock-core-configs update.

Huh, I see the same issue on fedora 31 (running fedora-rawhide-x86_64 chroot) now. Maybe it is related to the recent mock 2.0 / mock-core-configs update.

https://pagure.io/FedoraReview/pull-request/380 is the fix

Also seeing this on F31 here. Yes, seems correlated with the mock update. Could we get an updated fedora-review to Fedora if possible please? I expect more folks will start reporting this soon.

I'll work on cutting a release later today.

Thanks very mucn @ngompa. I'll keep an eye out for the update to test it out ASAP.

Ugh, this fell a bit by the wayside when I got slammed with FTBFS bug emails... Working on it now.

Metadata Update from @ngompa:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

Bodhi updates:

  • Fedora 31: https://bodhi.fedoraproject.org/updates/FEDORA-2020-793b10aeab
  • Fedora 30: https://bodhi.fedoraproject.org/updates/FEDORA-2020-d101164411
Metadata