Bug 1322606

Summary: [abrt] fedora-easy-karma: bodhi.py:96:wrapper:BodhiClientException: CSRF tokens do not match. This happens if you have the page open for a long time. Please reload the page and try to submit your data again. Make sure to save your input somewhere ...
Product: [Fedora] Fedora Reporter: kakoskin
Component: fedora-easy-karmaAssignee: Till Maas <opensource>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: cheese, infra-sig, jonstanley, lmacken, opensource, puiterwijk, relrod, ricky
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/72c30ba03cebd89bc4b5093f76b0b0b9a5f1c67c
Whiteboard: abrt_hash:af021f573dbfa5039d43f4adb9cebe89c7864fa5;
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-19 18:47:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
File: backtrace
none
File: environ none

Description kakoskin 2016-03-30 21:13:50 UTC
Description of problem:
Run Fedora easy karma. Leave it open for couple of hours waiting karma for an update. Supply karma and a comment. Fedora-easy-karma will crash when it tries to submit your karma with backtrace printed to console.

This crash appears to not to be repeatable reliably. 

Expected results: An error message instead of a crash. 




Version-Release number of selected component:
fedora-easy-karma-0-0.26.20150921gitc932687a.fc22

Additional info:
reporter:       libreport-2.6.4
cmdline:        /usr/bin/python /usr/bin/fedora-easy-karma
dso_list:       python-fedora-0.7.1-4.fc22.noarch
executable:     /usr/bin/fedora-easy-karma
kernel:         4.4.6-200.fc22.x86_64
runlevel:       N 5
type:           Python
uid:            1000

Truncated backtrace:
bodhi.py:96:wrapper:BodhiClientException: CSRF tokens do not match.  This happens if you have the page open for a long time. Please reload the page and try to submit your data again. Make sure to save your input somewhere before reloading. 

Traceback (most recent call last):
  File "/usr/bin/fedora-easy-karma", line 831, in <module>
    fek = FedoraEasyKarma()
  File "/usr/bin/fedora-easy-karma", line 690, in __init__
    karma)
  File "/usr/bin/fedora-easy-karma", line 815, in send_comment
    res = bc.comment(update["title"], comment, karma=karma)
  File "/usr/lib/python2.7/site-packages/fedora/client/bodhi.py", line 96, in wrapper
    raise BodhiClientException(problems)
BodhiClientException: CSRF tokens do not match.  This happens if you have the page open for a long time. Please reload the page and try to submit your data again. Make sure to save your input somewhere before reloading. 

Local variables in innermost frame:
e: Munch(description=u'CSRF tokens do not match.  This happens if you have the page open for a long time. Please reload the page and try to submit your data again. Make sure to save your input somewhere before reloading. ', location=u'body', name=u'csrf_token')
args: (<fedora.client.bodhi.Bodhi2Client object at 0x7f41454d00d0>, u'wine-1.9.6-1.fc22', 'No regressions noted.')
problems: u'CSRF tokens do not match.  This happens if you have the page open for a long time. Please reload the page and try to submit your data again. Make sure to save your input somewhere before reloading. '
result: Munch(errors=[Munch(description=u'CSRF tokens do not match.  This happens if you have the page open for a long time. Please reload the page and try to submit your data again. Make sure to save your input somewhere before reloading. ', location=u'body', name=u'csrf_token')], status=u'error')
kwargs: {'karma': '1'}
method: <function comment at 0x7f414e6cc578>

Comment 1 kakoskin 2016-03-30 21:13:54 UTC
Created attachment 1141938 [details]
File: backtrace

Comment 2 kakoskin 2016-03-30 21:13:55 UTC
Created attachment 1141939 [details]
File: environ

Comment 3 Till Maas 2016-04-08 15:06:16 UTC
The session handling is done in python-fedora, reassigning.

Comment 4 Patrick Uiterwijk 2016-04-29 22:27:05 UTC
The only case in which I have been able to reproduce this bug is if the client does two calls to Bodhi at the same time.
The library is NOT multi-thread safe.

The CSRF token is refreshed at the moment a request is sent.

So in this case, I think that easy-karma might be issuing multiple requests at the same time.

Comment 5 Fedora End Of Life 2016-07-19 18:47:27 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 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
bug.

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