Bug 1258548 - AttributeError: 'NoneType' object has no attribute 'get'
AttributeError: 'NoneType' object has no attribute 'get'
Product: Fedora
Classification: Fedora
Component: koji (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Dennis Gilmore
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2015-08-31 11:32 EDT by John Florian
Modified: 2015-12-02 13:17 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-12-02 10:11:12 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description John Florian 2015-08-31 11:32:10 EDT
Description of problem:
After upgrading to 1.10 and apply the SQL schema upgrade I found the Koji Web page indicating an error while processing my request.  In /var/log/httpd/error_log I found my page requesting causing:

[Mon Aug 31 11:11:10.096815 2015] [wsgi:error] [pid 6208] 96 [ERROR] m=index u=None p=6208 r= koji.web: Traceback (most recent call last):
[Mon Aug 31 11:11:10.096833 2015] [wsgi:error] [pid 6208]   File "/usr/share/koji-web/scripts/wsgi_publisher.py", line 385, in handle_request
[Mon Aug 31 11:11:10.096838 2015] [wsgi:error] [pid 6208]     result = func(environ, **data)
[Mon Aug 31 11:11:10.096841 2015] [wsgi:error] [pid 6208]   File "/usr/share/koji-web/scripts/index.py", line 306, in index
[Mon Aug 31 11:11:10.096844 2015] [wsgi:error] [pid 6208]     return _genHTML(environ, 'index.chtml')
[Mon Aug 31 11:11:10.096848 2015] [wsgi:error] [pid 6208]   File "/usr/share/koji-web/lib/kojiweb/util.py", line 142, in _genHTML
[Mon Aug 31 11:11:10.096851 2015] [wsgi:error] [pid 6208]     return tmpl_inst.respond().encode('utf-8', 'replace')
[Mon Aug 31 11:11:10.096867 2015] [wsgi:error] [pid 6208]   File "index_chtml.py", line 197, in respond
[Mon Aug 31 11:11:10.096870 2015] [wsgi:error] [pid 6208]   File "/usr/share/koji-web/lib/kojiweb/util.py", line 471, in taskScratchClass
[Mon Aug 31 11:11:10.096873 2015] [wsgi:error] [pid 6208]     if opts.get('scratch'):
[Mon Aug 31 11:11:10.096875 2015] [wsgi:error] [pid 6208] AttributeError: 'NoneType' object has no attribute 'get'

To debug this, I applied this to find out the "request" object looked like:

--- /usr/share/koji-web/lib/kojiweb/util.py-orig        2015-07-14 23:45:08.000000000 -0400
+++ /usr/share/koji-web/lib/kojiweb/util.py     2015-08-31 11:17:20.519893359 -0400
@@ -465,6 +465,7 @@
     request = task_object['request']
+    print('JFDEBUG> request={!r}'.format(request))
     if len(request) >= 3:
         opts = request[2]
         if opts.get('scratch'):

I still get the same error, of course, but the log now reveals:

[Mon Aug 31 11:17:27.635331 2015] [wsgi:error] [pid 6402] JFDEBUG> request=[['d13677@dartcontainer.com', 'daniel_brown@dartcontainer.com'], True, None, 'f21-testing', 'mdct-aos-flash-2.29-1.fc21', 2, False, '']

The last thing I had done with the mdct-aos-flash-2.29-1.fc21 build was an attempt to untag it from f21-testing and before that to tag it with f21-released.  The untag operation (koji untag-build f21-testing --all mdct-aos-flash) simply wouldn't succeed -- I kept getting " koji error: SysCallError: (-1, 'Unexpected EOF')" which is when I decided trying to upgrade from 1.9 to 1.10.

I can't go any further as I don't know if taskScratchClass() is handling the request incorrectly or if the request was composed incorrectly.  For a quick kludge to get things running again I've just commented the whole method out except for the last line that returns a null string.  (Thankfully the docstring noted this method is just returning a CSS class so I doubt I'm doing anything bad here.)

FTR, 1.10 did finally allow me to do the untag operation.
Comment 1 John Florian 2015-10-05 15:58:05 EDT
I still see this with koji-web-1.10.0-2.fc21.noarch.
Comment 2 Fedora End Of Life 2015-11-04 05:20:18 EST
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 3 Fedora End Of Life 2015-12-02 10:11:21 EST
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this

Thank you for reporting this bug and we are sorry it could not be fixed.

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