Bug 1788182 - [abrt] DNF raises RuntimeError when passing invalid values to `--repofrompath`
Summary: [abrt] DNF raises RuntimeError when passing invalid values to `--repofrompath`
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 31
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukáš Hrázký
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:82047bd1d310779da65c4da681b...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-06 16:02 UTC by Allan Lewis
Modified: 2020-06-19 01:05 UTC (History)
10 users (show)

Fixed In Version: dnf-4.2.23-1.fc32 dnf-4.2.23-1.fc31
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-06-05 02:29:54 UTC
Type: ---


Attachments (Terms of Use)
File: _var_log_dnf.log (707.99 KB, text/plain)
2020-01-06 16:02 UTC, Allan Lewis
no flags Details
File: _var_tmp_dnf-allan.lewis-qo7a7nhx_dnf.librepo.log (1.88 MB, text/plain)
2020-01-06 16:02 UTC, Allan Lewis
no flags Details
File: _var_tmp_dnf-allan.lewis-qo7a7nhx_dnf.log (412.37 KB, text/plain)
2020-01-06 16:02 UTC, Allan Lewis
no flags Details
File: _var_tmp_dnf-allan.lewis-qo7a7nhx_dnf.rpm.log (89.60 KB, text/plain)
2020-01-06 16:02 UTC, Allan Lewis
no flags Details
File: _var_tmp_dnf-allan.lewis-qo7a7nhx_hawkey.log (5.00 MB, text/plain)
2020-01-06 16:02 UTC, Allan Lewis
no flags Details
File: backtrace (1.60 KB, text/plain)
2020-01-06 16:02 UTC, Allan Lewis
no flags Details
File: cgroup (449 bytes, text/plain)
2020-01-06 16:03 UTC, Allan Lewis
no flags Details
File: cpuinfo (2.48 KB, text/plain)
2020-01-06 16:03 UTC, Allan Lewis
no flags Details
File: dnf-makecache.log (431.41 KB, text/plain)
2020-01-06 16:03 UTC, Allan Lewis
no flags Details
File: environ (5.96 KB, text/plain)
2020-01-06 16:03 UTC, Allan Lewis
no flags Details
File: mountinfo (4.33 KB, text/plain)
2020-01-06 16:03 UTC, Allan Lewis
no flags Details
File: namespaces (129 bytes, text/plain)
2020-01-06 16:03 UTC, Allan Lewis
no flags Details
File: open_fds (724 bytes, text/plain)
2020-01-06 16:03 UTC, Allan Lewis
no flags Details

Description Allan Lewis 2020-01-06 16:02:18 UTC
Description of problem:
I was testing a repo I created using `dnf reposync` but used the wrong syntax for `--repofrompath`: I put the URL first instead of the repo name. My mistake, but it caused an unhandled exception.

Version-Release number of selected component:
dnf-4.2.17-1.fc31

Additional info:
reporter:       libreport-2.11.3
cmdline:        /usr/bin/python3 /usr/bin/dnf --repofrompath /mnt/nas/repo/mirror2/centos/8/2020-01-06/extras,extras --repo extras list
crash_function: __init__
exception_type: RuntimeError
executable:     /usr/bin/dnf
interpreter:    python3-3.7.5-2.fc31.x86_64
kernel:         5.3.15-300.fc31.x86_64
runlevel:       N 5
type:           Python3
uid:            1000

Truncated backtrace:
repo.py:440:__init__:RuntimeError: Bad id for repo: /mnt/nas/repo/mirror2/centos/8/2020-01-06/extras, byte = / 0

Traceback (most recent call last):
  File "/usr/bin/dnf", line 58, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 191, in user_main
    errcode = main(args)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 65, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 94, in _main
    cli.configure(list(map(ucd, args)), option_parser())
  File "/usr/lib/python3.7/site-packages/dnf/cli/cli.py", line 969, in configure
    self._configure_repos(opts)
  File "/usr/lib/python3.7/site-packages/dnf/cli/cli.py", line 753, in _configure_repos
    this_repo = self.base.repos.add_new_repo(label, self.base.conf, baseurl=[path])
  File "/usr/lib/python3.7/site-packages/dnf/repodict.py", line 86, in add_new_repo
    repo = dnf.repo.Repo(repoid, conf)
  File "/usr/lib/python3.7/site-packages/dnf/repo.py", line 427, in __init__
    self._repo = libdnf.repo.Repo(name if name else "", self._config)
  File "/usr/lib64/python3.7/site-packages/libdnf/repo.py", line 440, in __init__
    _repo.Repo_swiginit(self, _repo.new_Repo(id, config))
RuntimeError: Bad id for repo: /mnt/nas/repo/mirror2/centos/8/2020-01-06/extras, byte = / 0

Local variables in innermost frame:
self: <libdnf.repo.Repo;  >
id: '/mnt/nas/repo/mirror2/centos/8/2020-01-06/extras'
config: <libdnf.conf.ConfigRepo; proxy of <Swig Object of type 'libdnf::ConfigRepo *' at 0x7f2e3cc733c0> >

Comment 1 Allan Lewis 2020-01-06 16:02:29 UTC
Created attachment 1650155 [details]
File: _var_log_dnf.log

Comment 2 Allan Lewis 2020-01-06 16:02:37 UTC
Created attachment 1650156 [details]
File: _var_tmp_dnf-allan.lewis-qo7a7nhx_dnf.librepo.log

Comment 3 Allan Lewis 2020-01-06 16:02:39 UTC
Created attachment 1650157 [details]
File: _var_tmp_dnf-allan.lewis-qo7a7nhx_dnf.log

Comment 4 Allan Lewis 2020-01-06 16:02:41 UTC
Created attachment 1650158 [details]
File: _var_tmp_dnf-allan.lewis-qo7a7nhx_dnf.rpm.log

Comment 5 Allan Lewis 2020-01-06 16:02:50 UTC
Created attachment 1650159 [details]
File: _var_tmp_dnf-allan.lewis-qo7a7nhx_hawkey.log

Comment 6 Allan Lewis 2020-01-06 16:02:55 UTC
Created attachment 1650160 [details]
File: backtrace

Comment 7 Allan Lewis 2020-01-06 16:03:01 UTC
Created attachment 1650161 [details]
File: cgroup

Comment 8 Allan Lewis 2020-01-06 16:03:06 UTC
Created attachment 1650162 [details]
File: cpuinfo

Comment 9 Allan Lewis 2020-01-06 16:03:11 UTC
Created attachment 1650163 [details]
File: dnf-makecache.log

Comment 10 Allan Lewis 2020-01-06 16:03:16 UTC
Created attachment 1650164 [details]
File: environ

Comment 11 Allan Lewis 2020-01-06 16:03:21 UTC
Created attachment 1650165 [details]
File: mountinfo

Comment 12 Allan Lewis 2020-01-06 16:03:27 UTC
Created attachment 1650166 [details]
File: namespaces

Comment 13 Allan Lewis 2020-01-06 16:03:28 UTC
Created attachment 1650167 [details]
File: open_fds

Comment 14 Lukáš Hrázký 2020-01-07 10:08:14 UTC
Hello Allan,

it is a sad fact that there are a lot of unhandled exceptions in dnf. Thanks for the report though, I'll try to fix this one once my PR for allowing to even handle the exceptions goes through: https://github.com/rpm-software-management/libdnf/pull/866

Comment 16 Fedora Update System 2020-06-03 08:55:17 UTC
FEDORA-2020-f3f7292b39 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-f3f7292b39

Comment 17 Fedora Update System 2020-06-03 08:55:18 UTC
FEDORA-2020-a943fde9ba has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-a943fde9ba

Comment 18 Fedora Update System 2020-06-04 03:00:25 UTC
FEDORA-2020-f3f7292b39 has been pushed to the Fedora 31 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-f3f7292b39`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-f3f7292b39

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 19 Fedora Update System 2020-06-04 04:08:31 UTC
FEDORA-2020-a943fde9ba has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-a943fde9ba`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-a943fde9ba

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 20 Fedora Update System 2020-06-05 02:29:54 UTC
FEDORA-2020-a943fde9ba has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 21 Fedora Update System 2020-06-19 01:05:26 UTC
FEDORA-2020-f3f7292b39 has been pushed to the Fedora 31 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.