Bug 1144003 - [abrt] dnf: download.py:181:_get_query_source:TypeError: 'NoneType' object has no attribute '__getitem__'
[abrt] dnf: download.py:181:_get_query_source:TypeError: 'NoneType' object ha...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
20
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Tim Lauridsen
Fedora Extras Quality Assurance
https://retrace.fedoraproject.org/faf...
abrt_hash:2411e6982d4abca243db6fbbaa5...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-18 08:36 EDT by Marcela Mašláňová
Modified: 2014-12-13 04:53 EST (History)
6 users (show)

See Also:
Fixed In Version: dnf-0.6.3-2.fc21
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-12-13 04:53:59 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Marcela Mašláňová 2014-09-18 08:36:31 EDT
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:
dnf-0.5.4-2.fc20

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
    cli.run()
  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 08:36:34 EDT
Created attachment 938869 [details]
File: backtrace
Comment 2 Marcela Mašláňová 2014-09-18 08:36:35 EDT
Created attachment 938870 [details]
File: environ
Comment 3 Parag Nemade 2014-09-18 12:46:57 EDT
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 05:55:37 EDT
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 06:57:00 EDT
I will take a look
Comment 6 Tim Lauridsen 2014-09-19 08:18:10 EDT
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

https://github.com/rpm-software-management/dnf-plugins-core/pull/43
Comment 7 Marcela Mašláňová 2014-09-22 06:40:55 EDT
Thanks.
Comment 8 Honza Silhan 2014-11-19 06:39:08 EST
Thanks, Tim.
Comment 9 Fedora Update System 2014-12-09 09:06:50 EST
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.
https://admin.fedoraproject.org/updates/dnf-0.6.3-2.fc21,dnf-plugins-core-0.1.4-1.fc21,hawkey-0.5.2-1.fc21
Comment 10 Fedora Update System 2014-12-11 23:32:58 EST
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:
https://admin.fedoraproject.org/updates/FEDORA-2014-16760/dnf-0.6.3-2.fc21,dnf-plugins-core-0.1.4-1.fc21,hawkey-0.5.2-1.fc21
then log in and leave karma (feedback).
Comment 11 Fedora Update System 2014-12-13 04:53:59 EST
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.