Bug 1144003 - [abrt] dnf: download.py:181:_get_query_source:TypeError: 'NoneType' object has no attribute '__getitem__'
Summary: [abrt] dnf: download.py:181:_get_query_source:TypeError: 'NoneType' object ha...
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 20
Hardware: x86_64
OS: Unspecified
Target Milestone: ---
Assignee: Tim Lauridsen
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:2411e6982d4abca243db6fbbaa5...
Depends On:
TreeView+ depends on / blocked
Reported: 2014-09-18 12:36 UTC by Marcela Mašláňová
Modified: 2014-12-13 09:53 UTC (History)
6 users (show)

Fixed In Version: dnf-0.6.3-2.fc21
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-12-13 09:53:59 UTC
Type: ---

Attachments (Terms of Use)
File: backtrace (1.39 KB, text/plain)
2014-09-18 12:36 UTC, Marcela Mašláňová
no flags Details
File: environ (3.80 KB, text/plain)
2014-09-18 12:36 UTC, Marcela Mašláňová
no flags Details

Description Marcela Mašláňová 2014-09-18 12:36:31 UTC
Description of problem:
dnf download ruby193 --source

Okay, ruby193 wasn't in the repo, but it should do something better than give a traceback.

Version-Release number of selected component:

Additional info:
reporter:       libreport-2.2.3
cmdline:        /usr/bin/python -OO /usr/bin/dnf download ruby193 --source
dso_list:       dnf-plugins-core-0.1.1-3.fc20.noarch
executable:     /usr/bin/dnf
kernel:         3.16.2-200.fc20.x86_64
runlevel:       N 5
type:           Python
uid:            8270

Truncated backtrace:
download.py:181:_get_query_source:TypeError: 'NoneType' object has no attribute '__getitem__'

Traceback (most recent call last):
  File "/usr/bin/dnf", line 36, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 200, in user_main
    errcode = main(args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 83, in main
    return _main(base, args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 133, in _main
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1171, in run
    return self.command.run(self.base.extcmds)
  File "/usr/lib/python2.7/site-packages/dnf-plugins/download.py", line 84, in run
    locations = self._download_source(self.opts.packages)
  File "/usr/lib/python2.7/site-packages/dnf-plugins/download.py", line 111, in _download_source
    pkgs = self._get_packages(source_pkgs, source=True)
  File "/usr/lib/python2.7/site-packages/dnf-plugins/download.py", line 119, in _get_packages
    queries = map(self._get_query_source, pkg_specs)
  File "/usr/lib/python2.7/site-packages/dnf-plugins/download.py", line 181, in _get_query_source
    pkg_spec = pkg_spec[:-4]  # skip the .rpm
TypeError: 'NoneType' object has no attribute '__getitem__'

Local variables in innermost frame:
pkg_spec: None
self: <dnf.plugin.dynamic.download.DownloadCommand object at 0x1e61410>

Comment 1 Marcela Mašláňová 2014-09-18 12:36:34 UTC
Created attachment 938869 [details]
File: backtrace

Comment 2 Marcela Mašláňová 2014-09-18 12:36:35 UTC
Created attachment 938870 [details]
File: environ

Comment 3 Parag Nemade 2014-09-18 16:46:57 UTC
I think there is no such traceback on Fedora 21. I tried to reproduce this as
$ sudo dnf download ruby193 --source
enabled fedora-source repository
Fedora 21 - Source                                225 kB/s | 5.4 MB     00:24    

and no output as it didn't find srpm ruby193

Comment 4 Honza Silhan 2014-09-19 09:55:37 UTC
I haven't reproduced it either - no traceback in f20 with the same packages as reporter.

Do you know what's going on, Tim? Would you mind taking it, please?

Comment 5 Tim Lauridsen 2014-09-19 10:57:00 UTC
I will take a look

Comment 6 Tim Lauridsen 2014-09-19 12:18:10 UTC
Look a little strange, this will only happen if no sourcerpm is defined for a given package.

I have made a fix, so the plugin don't traceback in this case


Comment 7 Marcela Mašláňová 2014-09-22 10:40:55 UTC

Comment 8 Honza Silhan 2014-11-19 11:39:08 UTC
Thanks, Tim.

Comment 9 Fedora Update System 2014-12-09 14:06:50 UTC
dnf-0.6.3-2.fc21,dnf-plugins-core-0.1.4-1.fc21,hawkey-0.5.2-1.fc21 has been submitted as an update for Fedora 21.

Comment 10 Fedora Update System 2014-12-12 04:32:58 UTC
Package dnf-0.6.3-2.fc21, hawkey-0.5.2-1.fc21, dnf-plugins-core-0.1.4-1.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing dnf-0.6.3-2.fc21 hawkey-0.5.2-1.fc21 dnf-plugins-core-0.1.4-1.fc21'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 11 Fedora Update System 2014-12-13 09:53:59 UTC
dnf-0.6.3-2.fc21, hawkey-0.5.2-1.fc21, dnf-plugins-core-0.1.4-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, 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.