500 error at /report/ - lock wait timeout exceeded

This may have made the database inconsistent and should be patched up

[x] Make database consistent.
[ ] Make sure transactions work so the db cannot become inconsistent.
[ ] Do something to prevent this happening again if we can figure anything out.

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1537809825, '24851'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by brian1234```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'd62e93f754b33b0a2f1b1dd6088991d591537704360', '_ga': 'GA1.2.272862774.1537704367', '_gid': 'GA1.2.931186624.1537704367', 'deck_id': '24847', '_gat_gtag_UA_109131120_1': '1', 'session': '.eJx9UctuwjAQ_Jc9R1XixCbh1qggIUqhUMqjqiKTGMcicagfLQXx73WQKIdKPc7MemZ3fIJsz1RNJZMGukZZ5gEtaiGhu6WVdqhgtaib4oaFzhtVZMJRgAiJMEEkiRMfB4kfIfDgH0Vm3IqquCZVDeesaDfQjbw4ogghD2rDm8xqpiStmTPbKEFlgMLIeTTUmhJl2lDTSriYHOJgOl0NXsfFBD_eq3m6-CJ2WGLbS2_zptkxd9QJaJ4zra8Y1mvBKeo_H_NZWQ1mi74f5B9r_zPqrZLli3vPDnuhmM6o6yfAYRwmQQeTuzCIMCY3uW2M-FHs-x4otnVU-ZuR8s1kfjRkV4az4Xz5cOgse8KORvyJJ_XYZbhG9-6YN1ed-wex_XbcpSgN7x5cbDLz3Y5AyqhiCs4e_GnNUMWZ21Laqjr_AOHtltk.Doqu_w.obRflKDDMqW1pCl-Y1eAnin5sZU'}
Endpoint: add_report
View Args: {}
Person:<PHONE_NUMBER>90519042
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '24847', 'opponent': '24851', 'result': '1–2', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: NZ
X-Forwarded-For: <IP_ADDRESS>, <IP_ADDRESS>
Cf-Ray: 45f6f0cd9f9aa41d-AKL
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Cache-Control: max-age=0
Origin: https://pennydreadfulmagic.com
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
Referer: https://pennydreadfulmagic.com/report/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=d62e93f754b33b0a2f1b1dd6088991d591537704360; _ga=GA1.2.272862774.1537704367; _gid=GA1.2.931186624.1537704367; deck_id=24847; _gat_gtag_UA_109131120_1=1; session=.eJx9UctuwjAQ_Jc9R1XixCbh1qggIUqhUMqjqiKTGMcicagfLQXx73WQKIdKPc7MemZ3fIJsz1RNJZMGukZZ5gEtaiGhu6WVdqhgtaib4oaFzhtVZMJRgAiJMEEkiRMfB4kfIfDgH0Vm3IqquCZVDeesaDfQjbw4ogghD2rDm8xqpiStmTPbKEFlgMLIeTTUmhJl2lDTSriYHOJgOl0NXsfFBD_eq3m6-CJ2WGLbS2_zptkxd9QJaJ4zra8Y1mvBKeo_H_NZWQ1mi74f5B9r_zPqrZLli3vPDnuhmM6o6yfAYRwmQQeTuzCIMCY3uW2M-FHs-x4otnVU-ZuR8s1kfjRkV4az4Xz5cOgse8KORvyJJ_XYZbhG9-6YN1ed-wex_XbcpSgN7x5cbDLz3Y5AyqhiCs4e_GnNUMWZ21Laqjr_AOHtltk.Doqu_w.obRflKDDMqW1pCl-Y1eAnin5sZU
Cf-Connecting-Ip: <IP_ADDRESS>
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1537809825, '24851']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1537809763, '24851'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by brian1234```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'd62e93f754b33b0a2f1b1dd6088991d591537704360', '_ga': 'GA1.2.272862774.1537704367', '_gid': 'GA1.2.931186624.1537704367', 'deck_id': '24847', 'session': '.eJx9UctuwjAQ_Jc9R1XixCbh1qggIUqhUMqjqiKTGMcicagfLQXx73WQKIdKPc7MemZ3fIJsz1RNJZMGukZZ5gEtaiGhu6WVdqhgtaib4oaFzhtVZMJRgAiJMEEkiRMfB4kfIfDgH0Vm3IqquCZVDeesaDfQjbw4ogghD2rDm8xqpiStmTPbKEFlgMLIeTTUmhJl2lDTSriYHOJgOl0NXsfFBD_eq3m6-CJ2WGLbS2_zptkxd9QJaJ4zra8Y1mvBKeo_H_NZWQ1mi74f5B9r_zPqrZLli3vPDnuhmM6o6yfAYRwmQQeTuzCIMCY3uW2M-FHs-x4otnVU-ZuR8s1kfjRkV4az4Xz5cOgse8KORvyJJ_XYZbhG9-6YN1ed-wex_XbcpSgN7x5cbDLz3Y5AyqhiCs4e_GnNUMWZ21Laqjr_AOHtltk.DoqoJg.kwWcZjimobphSgUx-vr-Ut9b1Qc'}
Endpoint: add_report
View Args: {}
Person:<PHONE_NUMBER>90519042
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '24847', 'opponent': '24851', 'result': '1–2', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: NZ
X-Forwarded-For: <IP_ADDRESS>, <IP_ADDRESS>
Cf-Ray: 45f6ef4a3ab0a41d-AKL
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Origin: https://pennydreadfulmagic.com
Content-Type: application/x-www-form-urlencoded
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
Referer: https://pennydreadfulmagic.com/report/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=d62e93f754b33b0a2f1b1dd6088991d591537704360; _ga=GA1.2.272862774.1537704367; _gid=GA1.2.931186624.1537704367; deck_id=24847; session=.eJx9UctuwjAQ_Jc9R1XixCbh1qggIUqhUMqjqiKTGMcicagfLQXx73WQKIdKPc7MemZ3fIJsz1RNJZMGukZZ5gEtaiGhu6WVdqhgtaib4oaFzhtVZMJRgAiJMEEkiRMfB4kfIfDgH0Vm3IqquCZVDeesaDfQjbw4ogghD2rDm8xqpiStmTPbKEFlgMLIeTTUmhJl2lDTSriYHOJgOl0NXsfFBD_eq3m6-CJ2WGLbS2_zptkxd9QJaJ4zra8Y1mvBKeo_H_NZWQ1mi74f5B9r_zPqrZLli3vPDnuhmM6o6yfAYRwmQQeTuzCIMCY3uW2M-FHs-x4otnVU-ZuR8s1kfjRkV4az4Xz5cOgse8KORvyJJ_XYZbhG9-6YN1ed-wex_XbcpSgN7x5cbDLz3Y5AyqhiCs4e_GnNUMWZ21Laqjr_AOHtltk.DoqoJg.kwWcZjimobphSgUx-vr-Ut9b1Qc
Cf-Connecting-Ip: <IP_ADDRESS>
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1537809763, '24851']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1537807984, '24851'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by brian1234```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'd62e93f754b33b0a2f1b1dd6088991d591537704360', '_ga': 'GA1.2.272862774.1537704367', '_gid': 'GA1.2.931186624.1537704367', 'deck_id': '24847', '_gat_gtag_UA_109131120_1': '1', 'session': '.eJx9UctuwjAQ_Jc9R1XixCbh1qggIUqhUMqjqiKTGMcicagfLQXx73WQKIdKPc7MemZ3fIJsz1RNJZMGukZZ5gEtaiGhu6WVdqhgtaib4oaFzhtVZMJRgAiJMEEkiRMfB4kfIfDgH0Vm3IqquCZVDeesaDfQjbw4ogghD2rDm8xqpiStmTPbKEFlgMLIeTTUmhJl2lDTSriYHOJgOl0NXsfFBD_eq3m6-CJ2WGLbS2_zptkxd9QJaJ4zra8Y1mvBKeo_H_NZWQ1mi74f5B9r_zPqrZLli3vPDnuhmM6o6yfAYRwmQQeTuzCIMCY3uW2M-FHs-x4otnVU-ZuR8s1kfjRkV4az4Xz5cOgse8KORvyJJ_XYZbhG9-6YN1ed-wex_XbcpSgN7x5cbDLz3Y5AyqhiCs4e_GnNUMWZ21Laqjr_AOHtltk.Doqn6g.rbULyjYjQtaLPbL9xyL-QGq96Mg'}
Endpoint: add_report
View Args: {}
Person:<PHONE_NUMBER>90519042
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '24847', 'opponent': '24851', 'result': '1–2', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: NZ
X-Forwarded-For: <IP_ADDRESS>, <IP_ADDRESS>
Cf-Ray: 45f6c3d89fb3a43b-AKL
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Cache-Control: max-age=0
Origin: https://pennydreadfulmagic.com
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
Referer: https://pennydreadfulmagic.com/report/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=d62e93f754b33b0a2f1b1dd6088991d591537704360; _ga=GA1.2.272862774.1537704367; _gid=GA1.2.931186624.1537704367; deck_id=24847; _gat_gtag_UA_109131120_1=1; session=.eJx9UctuwjAQ_Jc9R1XixCbh1qggIUqhUMqjqiKTGMcicagfLQXx73WQKIdKPc7MemZ3fIJsz1RNJZMGukZZ5gEtaiGhu6WVdqhgtaib4oaFzhtVZMJRgAiJMEEkiRMfB4kfIfDgH0Vm3IqquCZVDeesaDfQjbw4ogghD2rDm8xqpiStmTPbKEFlgMLIeTTUmhJl2lDTSriYHOJgOl0NXsfFBD_eq3m6-CJ2WGLbS2_zptkxd9QJaJ4zra8Y1mvBKeo_H_NZWQ1mi74f5B9r_zPqrZLli3vPDnuhmM6o6yfAYRwmQQeTuzCIMCY3uW2M-FHs-x4otnVU-ZuR8s1kfjRkV4az4Xz5cOgse8KORvyJJ_XYZbhG9-6YN1ed-wex_XbcpSgN7x5cbDLz3Y5AyqhiCs4e_GnNUMWZ21Laqjr_AOHtltk.Doqn6g.rbULyjYjQtaLPbL9xyL-QGq96Mg
Cf-Connecting-Ip: <IP_ADDRESS>
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1537807984, '24851']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1537803099, '24851'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by brian1234```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'd62e93f754b33b0a2f1b1dd6088991d591537704360', '_ga': 'GA1.2.272862774.1537704367', '_gid': 'GA1.2.931186624.1537704367', 'deck_id': '24847', '_gat_gtag_UA_109131120_1': '1', 'session': '.eJx9UctuwjAQ_Jc9R1XixCbh1qggIUqhUMqjqiKTGMcicagfLQXx73WQKIdKPc7MemZ3fIJsz1RNJZMGukZZ5gEtaiGhu6WVdqhgtaib4oaFzhtVZMJRgAiJMEEkiRMfB4kfIfDgH0Vm3IqquCZVDeesaDfQjbw4ogghD2rDm8xqpiStmTPbKEFlgMLIeTTUmhJl2lDTSriYHOJgOl0NXsfFBD_eq3m6-CJ2WGLbS2_zptkxd9QJaJ4zra8Y1mvBKeo_H_NZWQ1mi74f5B9r_zPqrZLli3vPDnuhmM6o6yfAYRwmQQeTuzCIMCY3uW2M-FHs-x4otnVU-ZuR8s1kfjRkV4az4Xz5cOgse8KORvyJJ_XYZbhG9-6YN1ed-wex_XbcpSgN7x5cbDLz3Y5AyqhiCs4e_GnNUMWZ21Laqjr_AOHtltk.DoqU1A.IKi24N9-ykcKsuDyEtYXxkA1yto'}
Endpoint: add_report
View Args: {}
Person:<PHONE_NUMBER>90519042
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '24847', 'opponent': '24851', 'result': '1–2', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: NZ
X-Forwarded-For: <IP_ADDRESS>, <IP_ADDRESS>
Cf-Ray: 45f64c94698aa435-AKL
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Cache-Control: max-age=0
Origin: https://pennydreadfulmagic.com
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
Referer: https://pennydreadfulmagic.com/report/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=d62e93f754b33b0a2f1b1dd6088991d591537704360; _ga=GA1.2.272862774.1537704367; _gid=GA1.2.931186624.1537704367; deck_id=24847; _gat_gtag_UA_109131120_1=1; session=.eJx9UctuwjAQ_Jc9R1XixCbh1qggIUqhUMqjqiKTGMcicagfLQXx73WQKIdKPc7MemZ3fIJsz1RNJZMGukZZ5gEtaiGhu6WVdqhgtaib4oaFzhtVZMJRgAiJMEEkiRMfB4kfIfDgH0Vm3IqquCZVDeesaDfQjbw4ogghD2rDm8xqpiStmTPbKEFlgMLIeTTUmhJl2lDTSriYHOJgOl0NXsfFBD_eq3m6-CJ2WGLbS2_zptkxd9QJaJ4zra8Y1mvBKeo_H_NZWQ1mi74f5B9r_zPqrZLli3vPDnuhmM6o6yfAYRwmQQeTuzCIMCY3uW2M-FHs-x4otnVU-ZuR8s1kfjRkV4az4Xz5cOgse8KORvyJJ_XYZbhG9-6YN1ed-wex_XbcpSgN7x5cbDLz3Y5AyqhiCs4e_GnNUMWZ21Laqjr_AOHtltk.DoqU1A.IKi24N9-ykcKsuDyEtYXxkA1yto
Cf-Connecting-Ip: <IP_ADDRESS>
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1537803099, '24851']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1537802831, '24851'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by brian1234```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'd62e93f754b33b0a2f1b1dd6088991d591537704360', '_ga': 'GA1.2.272862774.1537704367', '_gid': 'GA1.2.931186624.1537704367', 'deck_id': '24847', '_gat_gtag_UA_109131120_1': '1', 'session': '.eJx9UctuwjAQ_Jc9R1XixCbh1qggIUqhUMqjqiKTGMcicagfLQXx73WQKIdKPc7MemZ3fIJsz1RNJZMGukZZ5gEtaiGhu6WVdqhgtaib4oaFzhtVZMJRgAiJMEEkiRMfB4kfIfDgH0Vm3IqquCZVDeesaDfQjbw4ogghD2rDm8xqpiStmTPbKEFlgMLIeTTUmhJl2lDTSriYHOJgOl0NXsfFBD_eq3m6-CJ2WGLbS2_zptkxd9QJaJ4zra8Y1mvBKeo_H_NZWQ1mi74f5B9r_zPqrZLli3vPDnuhmM6o6yfAYRwmQQeTuzCIMCY3uW2M-FHs-x4otnVU-ZuR8s1kfjRkV4az4Xz5cOgse8KORvyJJ_XYZbhG9-6YN1ed-wex_XbcpSgN7x5cbDLz3Y5AyqhiCs4e_GnNUMWZ21Laqjr_AOHtltk.DoqTwQ.x19u4zxSZYRJKsNexaAkH_4SMoA'}
Endpoint: add_report
View Args: {}
Person:<PHONE_NUMBER>90519042
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '24847', 'opponent': '24851', 'result': '1–2', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: NZ
X-Forwarded-For: <IP_ADDRESS>, <IP_ADDRESS>
Cf-Ray: 45f6460d6dcea435-AKL
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Cache-Control: max-age=0
Origin: https://pennydreadfulmagic.com
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
Referer: https://pennydreadfulmagic.com/report/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=d62e93f754b33b0a2f1b1dd6088991d591537704360; _ga=GA1.2.272862774.1537704367; _gid=GA1.2.931186624.1537704367; deck_id=24847; _gat_gtag_UA_109131120_1=1; session=.eJx9UctuwjAQ_Jc9R1XixCbh1qggIUqhUMqjqiKTGMcicagfLQXx73WQKIdKPc7MemZ3fIJsz1RNJZMGukZZ5gEtaiGhu6WVdqhgtaib4oaFzhtVZMJRgAiJMEEkiRMfB4kfIfDgH0Vm3IqquCZVDeesaDfQjbw4ogghD2rDm8xqpiStmTPbKEFlgMLIeTTUmhJl2lDTSriYHOJgOl0NXsfFBD_eq3m6-CJ2WGLbS2_zptkxd9QJaJ4zra8Y1mvBKeo_H_NZWQ1mi74f5B9r_zPqrZLli3vPDnuhmM6o6yfAYRwmQQeTuzCIMCY3uW2M-FHs-x4otnVU-ZuR8s1kfjRkV4az4Xz5cOgse8KORvyJJ_XYZbhG9-6YN1ed-wex_XbcpSgN7x5cbDLz3Y5AyqhiCs4e_GnNUMWZ21Laqjr_AOHtltk.DoqTwQ.x19u4zxSZYRJKsNexaAkH_4SMoA
Cf-Connecting-Ip: <IP_ADDRESS>
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1537802831, '24851']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1537799843, '24854'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by aduckirl```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'd9b3569b9b8b1292232b94980d70f09b31536605364', 'hide_intro': 'True', 'session': '.eJx9UctuwjAQ_BefoyoJJCHcihCtFA4BCqitqsiNN8bg2MF2eAjx790gUQ6VerG0M-uZ3dkLKRowNVWgHBk604JHKKuFIsOKSosVg1rUmj1qYUttWCEQIkFvEMRxGKRJiE8_7feJR_5hVMFbIdndSWrOgXUTWK1uimEcph6pHddFa8EoWgOKUdaWO2EkSmjauk1YWEddx6STdwkqm30s35YLPRofd9vlehw876dTNzs8-p3eAe50IbQswdp7TVq-B5W_2pCdm31ezWWWH2FFe03il5rjfzg1woAtKMYTRL0kSQdJEj3Ffj9Mo-jBd4khOPB9jxioENr8msx5NPpeyyReZXnwUgesrSZbPcmqg1n4JzTBRBvc5hOjwzuI6ozYLShLvjxykyncuWshI6AGDLl65E9qjhoOOKZqpbz-AEmwmTw.DoqIGg.gE65xZx7xrdOmtuy2wklLfqZnlo', 'deck_id': '24851'}
Endpoint: add_report
View Args: {}
Person:<PHONE_NUMBER>22194944
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '24851', 'opponent': '24854', 'result': '1–2', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: <IP_ADDRESS>, <IP_ADDRESS>
Cf-Ray: 45f5fd17db501fd6-DFW
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: en-US,en;q=0.5
Referer: https://pennydreadfulmagic.com/report/
Content-Type: application/x-www-form-urlencoded
Upgrade-Insecure-Requests: 1
Cookie: __cfduid=d9b3569b9b8b1292232b94980d70f09b31536605364; hide_intro=True; session=.eJx9UctuwjAQ_BefoyoJJCHcihCtFA4BCqitqsiNN8bg2MF2eAjx790gUQ6VerG0M-uZ3dkLKRowNVWgHBk604JHKKuFIsOKSosVg1rUmj1qYUttWCEQIkFvEMRxGKRJiE8_7feJR_5hVMFbIdndSWrOgXUTWK1uimEcph6pHddFa8EoWgOKUdaWO2EkSmjauk1YWEddx6STdwkqm30s35YLPRofd9vlehw876dTNzs8-p3eAe50IbQswdp7TVq-B5W_2pCdm31ezWWWH2FFe03il5rjfzg1woAtKMYTRL0kSQdJEj3Ffj9Mo-jBd4khOPB9jxioENr8msx5NPpeyyReZXnwUgesrSZbPcmqg1n4JzTBRBvc5hOjwzuI6ozYLShLvjxykyncuWshI6AGDLl65E9qjhoOOKZqpbz-AEmwmTw.DoqIGg.gE65xZx7xrdOmtuy2wklLfqZnlo; deck_id=24851
Cf-Connecting-Ip: <IP_ADDRESS>
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1537799843, '24854']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1537798955, '24854'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by aduckirl```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'd9b3569b9b8b1292232b94980d70f09b31536605364', 'hide_intro': 'True', 'session': '.eJx9UctuwjAQ_BefoyoJJCHcihCtFA4BCqitqsiNN8bg2MF2eAjx790gUQ6VerG0M-uZ3dkLKRowNVWgHBk604JHKKuFIsOKSosVg1rUmj1qYUttWCEQIkFvEMRxGKRJiE8_7feJR_5hVMFbIdndSWrOgXUTWK1uimEcph6pHddFa8EoWgOKUdaWO2EkSmjauk1YWEddx6STdwkqm30s35YLPRofd9vlehw876dTNzs8-p3eAe50IbQswdp7TVq-B5W_2pCdm31ezWWWH2FFe03il5rjfzg1woAtKMYTRL0kSQdJEj3Ffj9Mo-jBd4khOPB9jxioENr8msx5NPpeyyReZXnwUgesrSZbPcmqg1n4JzTBRBvc5hOjwzuI6ozYLShLvjxykyncuWshI6AGDLl65E9qjhoOOKZqpbz-AEmwmTw.DoqEpA.CrDevWfmWRAf8p96KQDVYXRnu9A', 'deck_id': '24851'}
Endpoint: add_report
View Args: {}
Person:<PHONE_NUMBER>22194944
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '24851', 'opponent': '24854', 'result': '1–2', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: <IP_ADDRESS>, <IP_ADDRESS>
Cf-Ray: 45f5e76c09722012-DFW
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: en-US,en;q=0.5
Referer: https://pennydreadfulmagic.com/report/
Content-Type: application/x-www-form-urlencoded
Upgrade-Insecure-Requests: 1
Cookie: __cfduid=d9b3569b9b8b1292232b94980d70f09b31536605364; hide_intro=True; session=.eJx9UctuwjAQ_BefoyoJJCHcihCtFA4BCqitqsiNN8bg2MF2eAjx790gUQ6VerG0M-uZ3dkLKRowNVWgHBk604JHKKuFIsOKSosVg1rUmj1qYUttWCEQIkFvEMRxGKRJiE8_7feJR_5hVMFbIdndSWrOgXUTWK1uimEcph6pHddFa8EoWgOKUdaWO2EkSmjauk1YWEddx6STdwkqm30s35YLPRofd9vlehw876dTNzs8-p3eAe50IbQswdp7TVq-B5W_2pCdm31ezWWWH2FFe03il5rjfzg1woAtKMYTRL0kSQdJEj3Ffj9Mo-jBd4khOPB9jxioENr8msx5NPpeyyReZXnwUgesrSZbPcmqg1n4JzTBRBvc5hOjwzuI6ozYLShLvjxykyncuWshI6AGDLl65E9qjhoOOKZqpbz-AEmwmTw.DoqEpA.CrDevWfmWRAf8p96KQDVYXRnu9A; deck_id=24851
Cf-Connecting-Ip: <IP_ADDRESS>
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1537798955, '24854']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

This HAS made the db inconsistent but it really shouldn't have because this should be in a transaction. So this might reveal some deeper issues.
Fixed the immediate problem like so:
MariaDB [decksite]> SELECT * FROM `match` WHERE id IN (43508,43513);
+-------+------------+-------+-------------+-----------+
| id    | date       | round | elimination | mtgo_id   |
+-------+------------+-------+-------------+-----------+
| 43508 |<PHONE_NUMBER> |  NULL |        NULL | 209157642 |
| 43513 |<PHONE_NUMBER> |  NULL |        NULL | 209158515 |
+-------+------------+-------+-------------+-----------+
2 rows in set (0.00 sec)

MariaDB [decksite]> SELECT * FROM deck_match WHERE match_id IN (43508,43513);
+-------+----------+---------+-------+
| id    | match_id | deck_id | games |
+-------+----------+---------+-------+
| 86203 |    43508 |   24851 |     2 |
| 86204 |    43508 |   24842 |     1 |
| 86213 |    43513 |   24851 |     2 |
| 86214 |    43513 |   24636 |     0 |
+-------+----------+---------+-------+
4 rows in set (0.00 sec)

MariaDB [decksite]> SELECT deck_id,wins,losses FROM deck_cache WHERE deck_id IN (24851,24852,24851,24636);
+---------+------+--------+
| deck_id | wins | losses |
+---------+------+--------+
|   24636 |    0 |      0 |
|   24851 |    0 |      0 |
|   24852 |    0 |      0 |
+---------+------+--------+
3 rows in set (0.00 sec)

MariaDB [decksite]> SELECT * FROM deck_match WHERE deck_id IN (24851,24854);
+-------+----------+---------+-------+
| id    | match_id | deck_id | games |
+-------+----------+---------+-------+
| 86203 |    43508 |   24851 |     2 |
| 86213 |    43513 |   24851 |     2 |
+-------+----------+---------+-------+
2 rows in set (0.00 sec)

MariaDB [decksite]> SELECT * FROM deck_match WHERE match_id IN (43508,43513);
+-------+----------+---------+-------+
| id    | match_id | deck_id | games |
+-------+----------+---------+-------+
| 86203 |    43508 |   24851 |     2 |
| 86204 |    43508 |   24842 |     1 |
| 86213 |    43513 |   24851 |     2 |
| 86214 |    43513 |   24636 |     0 |
+-------+----------+---------+-------+
4 rows in set (0.00 sec)

MariaDB [decksite]> SELECT deck_id,wins,losses FROM deck_cache WHERE deck_id IN (24851,24842,24636);
+---------+------+--------+
| deck_id | wins | losses |
+---------+------+--------+
|   24636 |    0 |      0 |
|   24842 |    0 |      0 |
|   24851 |    0 |      0 |
+---------+------+--------+
3 rows in set (0.00 sec)

MariaDB [decksite]> UPDATE deck_cache SET wins = 2 WHERE deck_id = 24851;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [decksite]> UPDATE deck_cache SET losses = 1 WHERE deck_id IN (24842,24636);
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2  Changed: 2  Warnings: 0

This happened again and will be needed to be fixed up
Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1537884900, '24921'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by erjsaitama```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'd027b082dc892e5abe930576a2e4a3e851536066220', '_ga': 'GA1.2.1574050350.1536066284', '_gid': 'GA1.2.1058202807.1537357150', 'deck_id': '24921', 'session': '.eJx9kF9vgjAUxb_LfSYLUAT1zUXm3BKN4ubcspAKFYG2aFvc0PjddzFxPizZ4_13zj2_E8Q7pgSVTBroG1UzC2gqcgn9DeUaqzTXSaXSOE-hD17gEJv0el2_45Gu6zgBWPDPRMZZnfP0qsyrLGNp66greVF0PWJbIExWxbVmSlLBUIypQtPcUEFRpKK12bqxNtS0szLzSXjk5GkkpJmQ5XLtLo7RYDoTh-Pr5LZvqpJhihPQJGFaX2tIwvFhxXsv63m0j6ZNkYyLvU2D0JezRzrEe_a9yxXTMUUgTof4PiZz7LvAI8T1b-MWkW97XRv_V2yDre2vR8kf3iNR5F_2YkCc59FbSedyvmLDcNBMluiBSHcY5gPZIfh802DvQkrDpwUXmdg07QrcM6qYgrMFf7AZqjKGX8qa8_MPQiKTWA.DovUIQ.dxSGC7K0TpFEd5UC9HekEKyaKnI'}
Endpoint: add_report
View Args: {}
Person:<PHONE_NUMBER>54382117
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '24921', 'opponent': '24854', 'result': '2–1', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: JP
X-Forwarded-For: <IP_ADDRESS>, <IP_ADDRESS>
Cf-Ray: 45fe19aa7ca3a524-NRT
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Cache-Control: max-age=0
Origin: https://pennydreadfulmagic.com
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
Referer: https://pennydreadfulmagic.com/report/
Accept-Language: ja,en-US;q=0.9,en;q=0.8
Cookie: __cfduid=d027b082dc892e5abe930576a2e4a3e851536066220; _ga=GA1.2.1574050350.1536066284; _gid=GA1.2.1058202807.1537357150; deck_id=24921; session=.eJx9kF9vgjAUxb_LfSYLUAT1zUXm3BKN4ubcspAKFYG2aFvc0PjddzFxPizZ4_13zj2_E8Q7pgSVTBroG1UzC2gqcgn9DeUaqzTXSaXSOE-hD17gEJv0el2_45Gu6zgBWPDPRMZZnfP0qsyrLGNp66greVF0PWJbIExWxbVmSlLBUIypQtPcUEFRpKK12bqxNtS0szLzSXjk5GkkpJmQ5XLtLo7RYDoTh-Pr5LZvqpJhihPQJGFaX2tIwvFhxXsv63m0j6ZNkYyLvU2D0JezRzrEe_a9yxXTMUUgTof4PiZz7LvAI8T1b-MWkW97XRv_V2yDre2vR8kf3iNR5F_2YkCc59FbSedyvmLDcNBMluiBSHcY5gPZIfh802DvQkrDpwUXmdg07QrcM6qYgrMFf7AZqjKGX8qa8_MPQiKTWA.DovUIQ.dxSGC7K0TpFEd5UC9HekEKyaKnI
Cf-Connecting-Ip: <IP_ADDRESS>
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1537884900, '24921']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1537884848, '24921'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by erjsaitama```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'd027b082dc892e5abe930576a2e4a3e851536066220', '_ga': 'GA1.2.1574050350.1536066284', '_gid': 'GA1.2.1058202807.1537357150', 'deck_id': '24921', '_gat_gtag_UA_109131120_1': '1', 'session': '.eJx9kF9vgjAUxb_LfSYLUAT1zUXm3BKN4ubcspAKFYG2aFvc0PjddzFxPizZ4_13zj2_E8Q7pgSVTBroG1UzC2gqcgn9DeUaqzTXSaXSOE-hD17gEJv0el2_45Gu6zgBWPDPRMZZnfP0qsyrLGNp66greVF0PWJbIExWxbVmSlLBUIypQtPcUEFRpKK12bqxNtS0szLzSXjk5GkkpJmQ5XLtLo7RYDoTh-Pr5LZvqpJhihPQJGFaX2tIwvFhxXsv63m0j6ZNkYyLvU2D0JezRzrEe_a9yxXTMUUgTof4PiZz7LvAI8T1b-MWkW97XRv_V2yDre2vR8kf3iNR5F_2YkCc59FbSedyvmLDcNBMluiBSHcY5gPZIfh802DvQkrDpwUXmdg07QrcM6qYgrMFf7AZqjKGX8qa8_MPQiKTWA.DovUIQ.dxSGC7K0TpFEd5UC9HekEKyaKnI'}
Endpoint: add_report
View Args: {}
Person:<PHONE_NUMBER>54382117
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '24921', 'opponent': '24854', 'result': '2–1', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: JP
X-Forwarded-For: <IP_ADDRESS>, <IP_ADDRESS>
Cf-Ray: 45fe1867dd31a524-NRT
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Cache-Control: max-age=0
Origin: https://pennydreadfulmagic.com
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
Referer: https://pennydreadfulmagic.com/report/
Accept-Language: ja,en-US;q=0.9,en;q=0.8
Cookie: __cfduid=d027b082dc892e5abe930576a2e4a3e851536066220; _ga=GA1.2.1574050350.1536066284; _gid=GA1.2.1058202807.1537357150; deck_id=24921; _gat_gtag_UA_109131120_1=1; session=.eJx9kF9vgjAUxb_LfSYLUAT1zUXm3BKN4ubcspAKFYG2aFvc0PjddzFxPizZ4_13zj2_E8Q7pgSVTBroG1UzC2gqcgn9DeUaqzTXSaXSOE-hD17gEJv0el2_45Gu6zgBWPDPRMZZnfP0qsyrLGNp66greVF0PWJbIExWxbVmSlLBUIypQtPcUEFRpKK12bqxNtS0szLzSXjk5GkkpJmQ5XLtLo7RYDoTh-Pr5LZvqpJhihPQJGFaX2tIwvFhxXsv63m0j6ZNkYyLvU2D0JezRzrEe_a9yxXTMUUgTof4PiZz7LvAI8T1b-MWkW97XRv_V2yDre2vR8kf3iNR5F_2YkCc59FbSedyvmLDcNBMluiBSHcY5gPZIfh802DvQkrDpwUXmdg07QrcM6qYgrMFf7AZqjKGX8qa8_MPQiKTWA.DovUIQ.dxSGC7K0TpFEd5UC9HekEKyaKnI
Cf-Connecting-Ip: <IP_ADDRESS>
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1537884848, '24921']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

We have seen numerous instances of this today.
I'm going to try reducing lock timeout from 4s to 1s in 25e70648 but I don't think it will help it's just something easy to do for now.

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1538953484, '25737'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by craw_advantage```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'df2533654e00330a022e028cd2711d5af1536196537', '_ga': 'GA1.2.140434360.1536196541', 'hide_intro': 'True', '_gid': 'GA1.2.1574403301.1538738964', '_gat_gtag_UA_109131120_1': '1', 'session': '.eJx9UV1vgkAQ_C_3TBpEDsHHkrTViFGjSZumIRtuwVM48D6oYPzvPUysD036OLN7MztzF5I2KCsQKDSZamnQIcAqLsg0h1JZxLDiVc0emKuslizlliJ-GIYBpV4wGvlB6IZ0Qhzyz0SkheEluzuVdVEgGy5QtbgpeoHvOqTSRZ0ahVJAhVYsk_CdAmtBaCjQCtVg9N5LlQY9zPt4t3_JPsxxpsBfJHR5fit4FLcf8Svju8e-ro9ok10IZBkqdcdk067Z-7Y_tJtFbAT1cdEvV_G2wUSreWLf47nhElUKtqQRHUfUp2M3eIpcNwroYzzUFrh-6NoMEnNL7X895u2pC069gXnsjdcK8kPCZ6tVhzBRIrYettbGhvm0_dnP4HlnuVtbinw55CaT6m5YIc8IEiW5OuRPdRpkgfZKYcry-gMYv5vn.DpwifA.nPVAyR_eq6q0X219eij5xmHbBfQ'}
Endpoint: add_report
View Args: {}
Person:<PHONE_NUMBER>14680857
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '25635', 'opponent': '25737', 'result': '0–2', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: <IP_ADDRESS>, <IP_ADDRESS>
Cf-Ray: 4664022c2ef5c1ae-IAD
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Cache-Control: max-age=0
Origin: https://pennydreadfulmagic.com
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36 OPR/56.0.3051.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
Referer: https://pennydreadfulmagic.com/report/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=df2533654e00330a022e028cd2711d5af1536196537; _ga=GA1.2.140434360.1536196541; hide_intro=True; _gid=GA1.2.1574403301.1538738964; _gat_gtag_UA_109131120_1=1; session=.eJx9UV1vgkAQ_C_3TBpEDsHHkrTViFGjSZumIRtuwVM48D6oYPzvPUysD036OLN7MztzF5I2KCsQKDSZamnQIcAqLsg0h1JZxLDiVc0emKuslizlliJ-GIYBpV4wGvlB6IZ0Qhzyz0SkheEluzuVdVEgGy5QtbgpeoHvOqTSRZ0ahVJAhVYsk_CdAmtBaCjQCtVg9N5LlQY9zPt4t3_JPsxxpsBfJHR5fit4FLcf8Svju8e-ro9ok10IZBkqdcdk067Z-7Y_tJtFbAT1cdEvV_G2wUSreWLf47nhElUKtqQRHUfUp2M3eIpcNwroYzzUFrh-6NoMEnNL7X895u2pC069gXnsjdcK8kPCZ6tVhzBRIrYettbGhvm0_dnP4HlnuVtbinw55CaT6m5YIc8IEiW5OuRPdRpkgfZKYcry-gMYv5vn.DpwifA.nPVAyR_eq6q0X219eij5xmHbBfQ
Cf-Connecting-Ip: <IP_ADDRESS>
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1538953484, '25737']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1538944516, '25737'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by logged_out```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'ddc0f1e9cd8cfa192da2d810826a3d6f01535464205', '_ga': 'GA1.2.728120951.1535464213', '_gid': 'GA1.2.974596524.1538722929', 'deck_id': '25745', 'session': 'eyJvYXV0aDJfc3RhdGUiOiJlZnp0NTB2c25iTHNjMUhuY1dZSjhnaVRvMmkxSFYiLCJ0YXJnZXQiOiJodHRwczovL3Blbm55ZHJlYWRmdWxtYWdpYy5jb20vcmVwb3J0LyJ9.Dpv_OQ.eImx1c8i7w1YSbCAcP12MQwgZjI'}
Endpoint: add_report
View Args: {}
Person: logged_out
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '25745', 'opponent': '25737', 'result': '1–2', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: JP
X-Forwarded-For: 240f:a2:9928:1:fca1:495d:f0e7:cb0c, <IP_ADDRESS>
Cf-Ray: 466327379c08aecf-KIX
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: ja,en-US;q=0.7,en;q=0.3
Referer: https://pennydreadfulmagic.com/report/
Content-Type: application/x-www-form-urlencoded
Upgrade-Insecure-Requests: 1
Cookie: __cfduid=ddc0f1e9cd8cfa192da2d810826a3d6f01535464205; _ga=GA1.2.728120951.1535464213; _gid=GA1.2.974596524.1538722929; deck_id=25745; session=eyJvYXV0aDJfc3RhdGUiOiJlZnp0NTB2c25iTHNjMUhuY1dZSjhnaVRvMmkxSFYiLCJ0YXJnZXQiOiJodHRwczovL3Blbm55ZHJlYWRmdWxtYWdpYy5jb20vcmVwb3J0LyJ9.Dpv_OQ.eImx1c8i7w1YSbCAcP12MQwgZjI
Cf-Connecting-Ip: 240f:a2:9928:1:fca1:495d:f0e7:cb0c
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1538944516, '25737']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1538944282, '25737'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by logged_out```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'ddc0f1e9cd8cfa192da2d810826a3d6f01535464205', '_ga': 'GA1.2.728120951.1535464213', '_gid': 'GA1.2.974596524.1538722929', 'deck_id': '25745', '_gat_gtag_UA_109131120_1': '1'}
Endpoint: add_report
View Args: {}
Person: logged_out
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '25745', 'opponent': '25737', 'result': '1–2', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: JP
X-Forwarded-For: 240f:a2:9928:1:fca1:495d:f0e7:cb0c, <IP_ADDRESS>
Cf-Ray:<PHONE_NUMBER>7caecf-KIX
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: ja,en-US;q=0.7,en;q=0.3
Referer: https://pennydreadfulmagic.com/report/
Content-Type: application/x-www-form-urlencoded
Upgrade-Insecure-Requests: 1
Cookie: __cfduid=ddc0f1e9cd8cfa192da2d810826a3d6f01535464205; _ga=GA1.2.728120951.1535464213; _gid=GA1.2.974596524.1538722929; deck_id=25745; _gat_gtag_UA_109131120_1=1
Cf-Connecting-Ip: 240f:a2:9928:1:fca1:495d:f0e7:cb0c
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1538944282, '25737']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1538944185, '25737'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by logged_out```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'ddc0f1e9cd8cfa192da2d810826a3d6f01535464205', '_ga': 'GA1.2.728120951.1535464213', '_gid': 'GA1.2.974596524.1538722929', 'deck_id': '25745'}
Endpoint: add_report
View Args: {}
Person: logged_out
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '25745', 'opponent': '25737', 'result': '1–2', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: JP
X-Forwarded-For: 240f:a2:9928:1:fca1:495d:f0e7:cb0c, <IP_ADDRESS>
Cf-Ray: 46631f1eaaaeaecf-KIX
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: ja,en-US;q=0.7,en;q=0.3
Referer: https://pennydreadfulmagic.com/report/
Content-Type: application/x-www-form-urlencoded
Upgrade-Insecure-Requests: 1
Cookie: __cfduid=ddc0f1e9cd8cfa192da2d810826a3d6f01535464205; _ga=GA1.2.728120951.1535464213; _gid=GA1.2.974596524.1538722929; deck_id=25745
Cf-Connecting-Ip: 240f:a2:9928:1:fca1:495d:f0e7:cb0c
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1538944185, '25737']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1538940521, '25745'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by craw_advantage```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'df2533654e00330a022e028cd2711d5af1536196537', '_ga': 'GA1.2.140434360.1536196541', 'hide_intro': 'True', '_gid': 'GA1.2.1574403301.1538738964', '_gat_gtag_UA_109131120_1': '1', 'session': '.eJx9UV1vgkAQ_C_3TBpEDsHHkrTViFGjSZumIRtuwVM48D6oYPzvPUysD036OLN7MztzF5I2KCsQKDSZamnQIcAqLsg0h1JZxLDiVc0emKuslizlliJ-GIYBpV4wGvlB6IZ0Qhzyz0SkheEluzuVdVEgGy5QtbgpeoHvOqTSRZ0ahVJAhVYsk_CdAmtBaCjQCtVg9N5LlQY9zPt4t3_JPsxxpsBfJHR5fit4FLcf8Svju8e-ro9ok10IZBkqdcdk067Z-7Y_tJtFbAT1cdEvV_G2wUSreWLf47nhElUKtqQRHUfUp2M3eIpcNwroYzzUFrh-6NoMEnNL7X895u2pC069gXnsjdcK8kPCZ6tVhzBRIrYettbGhvm0_dnP4HlnuVtbinw55CaT6m5YIc8IEiW5OuRPdRpkgfZKYcry-gMYv5vn.Dpvv4w.8eRIcrlhryCB0NWdSnPBX3XNw5U'}
Endpoint: add_report
View Args: {}
Person:<PHONE_NUMBER>14680857
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '25635', 'opponent': '25745', 'result': '1–2', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: <IP_ADDRESS>, <IP_ADDRESS>
Cf-Ray: 4662c5ae2ce6c19f-IAD
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Cache-Control: max-age=0
Origin: https://pennydreadfulmagic.com
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36 OPR/56.0.3051.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
Referer: https://pennydreadfulmagic.com/report/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=df2533654e00330a022e028cd2711d5af1536196537; _ga=GA1.2.140434360.1536196541; hide_intro=True; _gid=GA1.2.1574403301.1538738964; _gat_gtag_UA_109131120_1=1; session=.eJx9UV1vgkAQ_C_3TBpEDsHHkrTViFGjSZumIRtuwVM48D6oYPzvPUysD036OLN7MztzF5I2KCsQKDSZamnQIcAqLsg0h1JZxLDiVc0emKuslizlliJ-GIYBpV4wGvlB6IZ0Qhzyz0SkheEluzuVdVEgGy5QtbgpeoHvOqTSRZ0ahVJAhVYsk_CdAmtBaCjQCtVg9N5LlQY9zPt4t3_JPsxxpsBfJHR5fit4FLcf8Svju8e-ro9ok10IZBkqdcdk067Z-7Y_tJtFbAT1cdEvV_G2wUSreWLf47nhElUKtqQRHUfUp2M3eIpcNwroYzzUFrh-6NoMEnNL7X895u2pC069gXnsjdcK8kPCZ6tVhzBRIrYettbGhvm0_dnP4HlnuVtbinw55CaT6m5YIc8IEiW5OuRPdRpkgfZKYcry-gMYv5vn.Dpvv4w.8eRIcrlhryCB0NWdSnPBX3XNw5U
Cf-Connecting-Ip: <IP_ADDRESS>
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1538940521, '25745']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1538940275, '25745'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by craw_advantage```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'df2533654e00330a022e028cd2711d5af1536196537', '_ga': 'GA1.2.140434360.1536196541', 'hide_intro': 'True', '_gid': 'GA1.2.1574403301.1538738964', '_gat_gtag_UA_109131120_1': '1', 'session': '.eJx9UctuwjAQ_BefoyoExzEciUTVCCggVPWhylolmxCaOMEPaED8ex0kyqFSjzO7ntkZn4loUdUgURoyNsqiRyCrS0nGOVTaoQzrsm6yOy512qhMlI4ilHPOwjBggwFl3OdhRDzyz0SKwpZVdnOqmqLArL9AN_KqGDDqe6Q2RSOsRiWhRieWKjgKyA4gDRTohBqwZhsIbcD08-lx-PiCapQ8h1ParkL9XkWWdW90Nlnw7X3fNF_okp0JpClqfcNkfVhlr5vT7rCexVaGFGenxTLetDg3Opm79_jdlgq1AFfSIByOaDTilD4ElDMesvu87435lPsuhMLcUdtfk-Sw79j-ZCGJg-FKQ76bl0_LZYcQaRk7E9dr69J8uALdb5R557hrXZp8euQqI0zXr5AJgkJFLh75050BVaA7U9qquvwAyVSbVg.Dpvu4w.ELjfPcrGqbOhOTywWJ9lPGWsk08'}
Endpoint: add_report
View Args: {}
Person:<PHONE_NUMBER>14680857
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '25635', 'opponent': '25745', 'result': '1–2', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: <IP_ADDRESS>, <IP_ADDRESS>
Cf-Ray: 4662bfabcc07c19f-IAD
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Cache-Control: max-age=0
Origin: https://pennydreadfulmagic.com
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36 OPR/56.0.3051.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
Referer: https://pennydreadfulmagic.com/report/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=df2533654e00330a022e028cd2711d5af1536196537; _ga=GA1.2.140434360.1536196541; hide_intro=True; _gid=GA1.2.1574403301.1538738964; _gat_gtag_UA_109131120_1=1; session=.eJx9UctuwjAQ_BefoyoExzEciUTVCCggVPWhylolmxCaOMEPaED8ex0kyqFSjzO7ntkZn4loUdUgURoyNsqiRyCrS0nGOVTaoQzrsm6yOy512qhMlI4ilHPOwjBggwFl3OdhRDzyz0SKwpZVdnOqmqLArL9AN_KqGDDqe6Q2RSOsRiWhRieWKjgKyA4gDRTohBqwZhsIbcD08-lx-PiCapQ8h1ParkL9XkWWdW90Nlnw7X3fNF_okp0JpClqfcNkfVhlr5vT7rCexVaGFGenxTLetDg3Opm79_jdlgq1AFfSIByOaDTilD4ElDMesvu87435lPsuhMLcUdtfk-Sw79j-ZCGJg-FKQ76bl0_LZYcQaRk7E9dr69J8uALdb5R557hrXZp8euQqI0zXr5AJgkJFLh75050BVaA7U9qquvwAyVSbVg.Dpvu4w.ELjfPcrGqbOhOTywWJ9lPGWsk08
Cf-Connecting-Ip: <IP_ADDRESS>
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1538940275, '25745']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1538939378, '25745'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by logged_out```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'ddc0f1e9cd8cfa192da2d810826a3d6f01535464205', '_ga': 'GA1.2.728120951.1535464213', '_gid': 'GA1.2.974596524.1538722929', 'deck_id': '25745', '_gat_gtag_UA_109131120_1': '1'}
Endpoint: add_report
View Args: {}
Person: logged_out
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '25745', 'opponent': '25635', 'result': '2–1', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: JP
X-Forwarded-For: 240f:a2:9928:1:fca1:495d:f0e7:cb0c, <IP_ADDRESS>
Cf-Ray: 4662a9c53cb8aeff-KIX
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: ja,en-US;q=0.7,en;q=0.3
Referer: https://pennydreadfulmagic.com/report/
Content-Type: application/x-www-form-urlencoded
Upgrade-Insecure-Requests: 1
Cookie: __cfduid=ddc0f1e9cd8cfa192da2d810826a3d6f01535464205; _ga=GA1.2.728120951.1535464213; _gid=GA1.2.974596524.1538722929; deck_id=25745; _gat_gtag_UA_109131120_1=1
Cf-Connecting-Ip: 240f:a2:9928:1:fca1:495d:f0e7:cb0c
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1538939378, '25745']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1538939307, '25737'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by craw_advantage```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'df2533654e00330a022e028cd2711d5af1536196537', '_ga': 'GA1.2.140434360.1536196541', 'hide_intro': 'True', '_gid': 'GA1.2.1574403301.1538738964', 'session': '.eJx9UctuwjAQ_BefoyoExzEciUTVCCggVPWhylolmxCaOMEPaED8ex0kyqFSjzO7ntkZn4loUdUgURoyNsqiRyCrS0nGOVTaoQzrsm6yOy512qhMlI4ilHPOwjBggwFl3OdhRDzyz0SKwpZVdnOqmqLArL9AN_KqGDDqe6Q2RSOsRiWhRieWKjgKyA4gDRTohBqwZhsIbcD08-lx-PiCapQ8h1ParkL9XkWWdW90Nlnw7X3fNF_okp0JpClqfcNkfVhlr5vT7rCexVaGFGenxTLetDg3Opm79_jdlgq1AFfSIByOaDTilD4ElDMesvu87435lPsuhMLcUdtfk-Sw79j-ZCGJg-FKQ76bl0_LZYcQaRk7E9dr69J8uALdb5R557hrXZp8euQqI0zXr5AJgkJFLh75050BVaA7U9qquvwAyVSbVg.DpvrEQ.IsE0fKX1MjsbpxJjd7wGaJhAeyA', '_gat_gtag_UA_109131120_1': '1'}
Endpoint: add_report
View Args: {}
Person:<PHONE_NUMBER>14680857
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '25635', 'opponent': '25737', 'result': '1–2', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: <IP_ADDRESS>, <IP_ADDRESS>
Cf-Ray: 4662a808f9e92438-IAD
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Cache-Control: max-age=0
Origin: https://pennydreadfulmagic.com
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36 OPR/56.0.3051.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
Referer: https://pennydreadfulmagic.com/report/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=df2533654e00330a022e028cd2711d5af1536196537; _ga=GA1.2.140434360.1536196541; hide_intro=True; _gid=GA1.2.1574403301.1538738964; session=.eJx9UctuwjAQ_BefoyoExzEciUTVCCggVPWhylolmxCaOMEPaED8ex0kyqFSjzO7ntkZn4loUdUgURoyNsqiRyCrS0nGOVTaoQzrsm6yOy512qhMlI4ilHPOwjBggwFl3OdhRDzyz0SKwpZVdnOqmqLArL9AN_KqGDDqe6Q2RSOsRiWhRieWKjgKyA4gDRTohBqwZhsIbcD08-lx-PiCapQ8h1ParkL9XkWWdW90Nlnw7X3fNF_okp0JpClqfcNkfVhlr5vT7rCexVaGFGenxTLetDg3Opm79_jdlgq1AFfSIByOaDTilD4ElDMesvu87435lPsuhMLcUdtfk-Sw79j-ZCGJg-FKQ76bl0_LZYcQaRk7E9dr69J8uALdb5R557hrXZp8euQqI0zXr5AJgkJFLh75050BVaA7U9qquvwAyVSbVg.DpvrEQ.IsE0fKX1MjsbpxJjd7wGaJhAeyA; _gat_gtag_UA_109131120_1=1
Cf-Connecting-Ip: <IP_ADDRESS>
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1538939307, '25737']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1538939169, '25737'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by craw_advantage```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'df2533654e00330a022e028cd2711d5af1536196537', '_ga': 'GA1.2.140434360.1536196541', 'hide_intro': 'True', '_gid': 'GA1.2.1574403301.1538738964', '_gat_gtag_UA_109131120_1': '1', 'session': '.eJx9UctuwjAQ_BefoyoExzEciUTVCCggVPWhylolmxCaOMEPaED8ex0kyqFSjzO7ntkZn4loUdUgURoyNsqiRyCrS0nGOVTaoQzrsm6yOy512qhMlI4ilHPOwjBggwFl3OdhRDzyz0SKwpZVdnOqmqLArL9AN_KqGDDqe6Q2RSOsRiWhRieWKjgKyA4gDRTohBqwZhsIbcD08-lx-PiCapQ8h1ParkL9XkWWdW90Nlnw7X3fNF_okp0JpClqfcNkfVhlr5vT7rCexVaGFGenxTLetDg3Opm79_jdlgq1AFfSIByOaDTilD4ElDMesvu87435lPsuhMLcUdtfk-Sw79j-ZCGJg-FKQ76bl0_LZYcQaRk7E9dr69J8uALdb5R557hrXZp8euQqI0zXr5AJgkJFLh75050BVaA7U9qquvwAyVSbVg.DpvqjA.D2ZhBJYci-wm29GRPQ6cs2p1DSI'}
Endpoint: add_report
View Args: {}
Person:<PHONE_NUMBER>14680857
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '25635', 'opponent': '25737', 'result': '1–2', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: <IP_ADDRESS>, <IP_ADDRESS>
Cf-Ray: 4662a4aa8b812438-IAD
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Cache-Control: max-age=0
Origin: https://pennydreadfulmagic.com
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36 OPR/56.0.3051.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
Referer: https://pennydreadfulmagic.com/report/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=df2533654e00330a022e028cd2711d5af1536196537; _ga=GA1.2.140434360.1536196541; hide_intro=True; _gid=GA1.2.1574403301.1538738964; _gat_gtag_UA_109131120_1=1; session=.eJx9UctuwjAQ_BefoyoExzEciUTVCCggVPWhylolmxCaOMEPaED8ex0kyqFSjzO7ntkZn4loUdUgURoyNsqiRyCrS0nGOVTaoQzrsm6yOy512qhMlI4ilHPOwjBggwFl3OdhRDzyz0SKwpZVdnOqmqLArL9AN_KqGDDqe6Q2RSOsRiWhRieWKjgKyA4gDRTohBqwZhsIbcD08-lx-PiCapQ8h1ParkL9XkWWdW90Nlnw7X3fNF_okp0JpClqfcNkfVhlr5vT7rCexVaGFGenxTLetDg3Opm79_jdlgq1AFfSIByOaDTilD4ElDMesvu87435lPsuhMLcUdtfk-Sw79j-ZCGJg-FKQ76bl0_LZYcQaRk7E9dr69J8uALdb5R557hrXZp8euQqI0zXr5AJgkJFLh75050BVaA7U9qquvwAyVSbVg.DpvqjA.D2ZhBJYci-wm29GRPQ6cs2p1DSI
Cf-Connecting-Ip: <IP_ADDRESS>
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1538939169, '25737']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1538937873, '25745'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by logged_out```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'ddc0f1e9cd8cfa192da2d810826a3d6f01535464205', '_ga': 'GA1.2.728120951.1535464213', '_gid': 'GA1.2.974596524.1538722929', 'deck_id': '25745', '_gat_gtag_UA_109131120_1': '1'}
Endpoint: add_report
View Args: {}
Person: logged_out
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '25745', 'opponent': '25737', 'result': '2–1', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: JP
X-Forwarded-For: 240f:a2:9928:1:fca1:495d:f0e7:cb0c, <IP_ADDRESS>
Cf-Ray:<PHONE_NUMBER>c1ae51-KIX
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: ja,en-US;q=0.7,en;q=0.3
Referer: https://pennydreadfulmagic.com/report/
Content-Type: application/x-www-form-urlencoded
Upgrade-Insecure-Requests: 1
Cookie: __cfduid=ddc0f1e9cd8cfa192da2d810826a3d6f01535464205; _ga=GA1.2.728120951.1535464213; _gid=GA1.2.974596524.1538722929; deck_id=25745; _gat_gtag_UA_109131120_1=1
Cf-Connecting-Ip: 240f:a2:9928:1:fca1:495d:f0e7:cb0c
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1538937873, '25745']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1538936619, '25749'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by logged_out```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'd28b1f910128a56e1a36ccfdfac6cd5ab1538561224', '_ga': 'GA1.2.342977662.1538561227', '_gid': 'GA1.2.1292399203.1538935684'}
Endpoint: add_report
View Args: {}
Person: logged_out
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '25737', 'opponent': '25749', 'result': '0–2', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: IT
X-Forwarded-For: <IP_ADDRESS>, <IP_ADDRESS>
Cf-Ray: 46626668ac8abe34-MXP
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Cache-Control: max-age=0
Origin: https://pennydreadfulmagic.com
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Linux; Android 7.0; HUAWEI VNS-L31 Build/HUAWEIVNS-L31) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
Referer: https://pennydreadfulmagic.com/report/
Accept-Language: it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7,es;q=0.6
Cookie: __cfduid=d28b1f910128a56e1a36ccfdfac6cd5ab1538561224; _ga=GA1.2.342977662.1538561227; _gid=GA1.2.1292399203.1538935684
Cf-Connecting-Ip: <IP_ADDRESS>
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1538936619, '25749']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1538935388, '25737'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by logged_out```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'da0e8e0b15803783ca90c87d1ac700af91538910615', '_ga': 'GA1.2.1193909276.1538910624', '_gid': 'GA1.2.1232034784.1538910624', 'deck_id': '25737', '_gat_gtag_UA_109131120_1': '1'}
Endpoint: add_report
View Args: {}
Person: logged_out
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '25737', 'opponent': '25745', 'result': '2–1', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: IT
X-Forwarded-For: <IP_ADDRESS>, <IP_ADDRESS>
Cf-Ray: 4662485d2acabe34-MXP
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Cache-Control: max-age=0
Origin: https://pennydreadfulmagic.com
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
Referer: https://pennydreadfulmagic.com/report/
Accept-Language: it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7
Cookie: __cfduid=da0e8e0b15803783ca90c87d1ac700af91538910615; _ga=GA1.2.1193909276.1538910624; _gid=GA1.2.1232034784.1538910624; deck_id=25737; _gat_gtag_UA_109131120_1=1
Cf-Connecting-Ip: <IP_ADDRESS>
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1538935388, '25737']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1538934474, '25727'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by error2105```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'd945f828a6ad28d46f38ae05d36f876e31537905184', '_ga': 'GA1.2.1787611369.1537905187', '_gid': 'GA1.2.1221145479.1538764777', 'deck_id': '25727', '_gat_gtag_UA_109131120_1': '1', 'session': '.eJx9UV1PwjAU_S99XszWbu3GG0RcQAkfSogYs9TtbjSu62w7BQn_3Y4EeTDx8Zxze869p0eUtaAlb6CxaGB1Bx7ihRQNGpS8Ng4VIIVUxRULkytdZMJRCPssTKKIxTEmNI6DBCMP_aM0WdWJurgk1aqqoOg3MKo5O2Kfhh6StlJZZ0A3XIIzA62VxoEfOQ_FO7vDmbHc9tKarR6262D_MaHfcVqPyyDZPs6VmbNntZ1d5616B3fUEfE8B2MuGKkpyeWXGuWRxBudrof8rqHLdJc8Lb_5xL2HfSs0mIy7foKIJIQmEaM3IWUkjshV7yujfhj7voc0lI7a_YYQNp0KwxYkXC2Gn284aG837H4m-HiXDlsX4ipt3TUvrjv3EaI8OO7clEGvHjrbZPbQj6ARcA0anTz0pzbLdQVuzaar69MPlWOWpQ.DpvYPw.bzCmL755R18SGwrw1qCTlqSufI0'}
Endpoint: add_report
View Args: {}
Person:<PHONE_NUMBER>23688192
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '25727', 'opponent': '25737', 'result': '2–0', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: GB
X-Forwarded-For: <IP_ADDRESS>, <IP_ADDRESS>
Cf-Ray: 4662320b9903bc44-LHR
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Cache-Control: max-age=0
Origin: https://pennydreadfulmagic.com
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
Referer: https://pennydreadfulmagic.com/report/
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8
Cookie: __cfduid=d945f828a6ad28d46f38ae05d36f876e31537905184; _ga=GA1.2.1787611369.1537905187; _gid=GA1.2.1221145479.1538764777; deck_id=25727; _gat_gtag_UA_109131120_1=1; session=.eJx9UV1PwjAU_S99XszWbu3GG0RcQAkfSogYs9TtbjSu62w7BQn_3Y4EeTDx8Zxze869p0eUtaAlb6CxaGB1Bx7ihRQNGpS8Ng4VIIVUxRULkytdZMJRCPssTKKIxTEmNI6DBCMP_aM0WdWJurgk1aqqoOg3MKo5O2Kfhh6StlJZZ0A3XIIzA62VxoEfOQ_FO7vDmbHc9tKarR6262D_MaHfcVqPyyDZPs6VmbNntZ1d5616B3fUEfE8B2MuGKkpyeWXGuWRxBudrof8rqHLdJc8Lb_5xL2HfSs0mIy7foKIJIQmEaM3IWUkjshV7yujfhj7voc0lI7a_YYQNp0KwxYkXC2Gn284aG837H4m-HiXDlsX4ipt3TUvrjv3EaI8OO7clEGvHjrbZPbQj6ARcA0anTz0pzbLdQVuzaar69MPlWOWpQ.DpvYPw.bzCmL755R18SGwrw1qCTlqSufI0
Cf-Connecting-Ip: <IP_ADDRESS>
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1538934474, '25727']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1538934401, '25727'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by error2105```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'd945f828a6ad28d46f38ae05d36f876e31537905184', '_ga': 'GA1.2.1787611369.1537905187', '_gid': 'GA1.2.1221145479.1538764777', 'deck_id': '25727', '_gat_gtag_UA_109131120_1': '1', 'session': '.eJx9UV1PwjAU_S99XszWbu3GG0RcQAkfSogYs9TtbjSu62w7BQn_3Y4EeTDx8Zxze869p0eUtaAlb6CxaGB1Bx7ihRQNGpS8Ng4VIIVUxRULkytdZMJRCPssTKKIxTEmNI6DBCMP_aM0WdWJurgk1aqqoOg3MKo5O2Kfhh6StlJZZ0A3XIIzA62VxoEfOQ_FO7vDmbHc9tKarR6262D_MaHfcVqPyyDZPs6VmbNntZ1d5616B3fUEfE8B2MuGKkpyeWXGuWRxBudrof8rqHLdJc8Lb_5xL2HfSs0mIy7foKIJIQmEaM3IWUkjshV7yujfhj7voc0lI7a_YYQNp0KwxYkXC2Gn284aG837H4m-HiXDlsX4ipt3TUvrjv3EaI8OO7clEGvHjrbZPbQj6ARcA0anTz0pzbLdQVuzaar69MPlWOWpQ.DpvX7w.xjZDoxcHPEyNyMY2tOW1zbNNp68'}
Endpoint: add_report
View Args: {}
Person:<PHONE_NUMBER>23688192
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '25727', 'opponent': '25737', 'result': '2–0', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: GB
X-Forwarded-For: <IP_ADDRESS>, <IP_ADDRESS>
Cf-Ray: 46623042da00bc44-LHR
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Cache-Control: max-age=0
Origin: https://pennydreadfulmagic.com
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
Referer: https://pennydreadfulmagic.com/report/
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8
Cookie: __cfduid=d945f828a6ad28d46f38ae05d36f876e31537905184; _ga=GA1.2.1787611369.1537905187; _gid=GA1.2.1221145479.1538764777; deck_id=25727; _gat_gtag_UA_109131120_1=1; session=.eJx9UV1PwjAU_S99XszWbu3GG0RcQAkfSogYs9TtbjSu62w7BQn_3Y4EeTDx8Zxze869p0eUtaAlb6CxaGB1Bx7ihRQNGpS8Ng4VIIVUxRULkytdZMJRCPssTKKIxTEmNI6DBCMP_aM0WdWJurgk1aqqoOg3MKo5O2Kfhh6StlJZZ0A3XIIzA62VxoEfOQ_FO7vDmbHc9tKarR6262D_MaHfcVqPyyDZPs6VmbNntZ1d5616B3fUEfE8B2MuGKkpyeWXGuWRxBudrof8rqHLdJc8Lb_5xL2HfSs0mIy7foKIJIQmEaM3IWUkjshV7yujfhj7voc0lI7a_YYQNp0KwxYkXC2Gn284aG837H4m-HiXDlsX4ipt3TUvrjv3EaI8OO7clEGvHjrbZPbQj6ARcA0anTz0pzbLdQVuzaar69MPlWOWpQ.DpvX7w.xjZDoxcHPEyNyMY2tOW1zbNNp68
Cf-Connecting-Ip: <IP_ADDRESS>
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1538934401, '25727']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1538931959, '25737'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by logged_out```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'da0e8e0b15803783ca90c87d1ac700af91538910615', '_ga': 'GA1.2.1193909276.1538910624', '_gid': 'GA1.2.1232034784.1538910624', 'deck_id': '25737', '_gat_gtag_UA_109131120_1': '1'}
Endpoint: add_report
View Args: {}
Person: logged_out
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '25737', 'opponent': '25635', 'result': '2–1', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: IT
X-Forwarded-For: <IP_ADDRESS>, <IP_ADDRESS>
Cf-Ray: 4661f4a43bc4be43-MXP
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Cache-Control: max-age=0
Origin: https://pennydreadfulmagic.com
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
Referer: https://pennydreadfulmagic.com/report/
Accept-Language: it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7
Cookie: __cfduid=da0e8e0b15803783ca90c87d1ac700af91538910615; _ga=GA1.2.1193909276.1538910624; _gid=GA1.2.1232034784.1538910624; deck_id=25737; _gat_gtag_UA_109131120_1=1
Cf-Connecting-Ip: <IP_ADDRESS>
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1538931959, '25737']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

Failed to execute UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s with [1538930077, '25737'] because of (1205, 'Lock wait timeout exceeded; try restarting transaction')

Reported on decksite by logged_out```
--------------------------------------------------------------------------------
Request Method: POST
Path: /report/?
Cookies: {'__cfduid': 'da0e8e0b15803783ca90c87d1ac700af91538910615', '_ga': 'GA1.2.1193909276.1538910624', '_gid': 'GA1.2.1232034784.1538910624', 'deck_id': '25737', '_gat_gtag_UA_109131120_1': '1'}
Endpoint: add_report
View Args: {}
Person: logged_out
Referrer: https://pennydreadfulmagic.com/report/
Request Data: {'entry': '25737', 'opponent': '25722', 'result': '2–0', 'draws': '0'}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: IT
X-Forwarded-For: <IP_ADDRESS>, <IP_ADDRESS>
Cf-Ray: 4661c6b1de0a430a-MXP
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Cache-Control: max-age=0
Origin: https://pennydreadfulmagic.com
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
Referer: https://pennydreadfulmagic.com/report/
Accept-Language: it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7
Cookie: __cfduid=da0e8e0b15803783ca90c87d1ac700af91538910615; _ga=GA1.2.1193909276.1538910624; _gid=GA1.2.1232034784.1538910624; deck_id=25737; _gat_gtag_UA_109131120_1=1
Cf-Connecting-Ip: <IP_ADDRESS>
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive
Content-Length: 53

--------------------------------------------------------------------------------
DatabaseException
Failed to execute `UPDATE deck_cache SET wins = IFNULL(wins, 0) + 1, active_date = %s WHERE deck_id = %s` with `[1538930077, '25737']` because of `(1205, 'Lock wait timeout exceeded; try restarting transaction')`
Stack Trace:
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/discord/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "./decksite/main.py", line 321, in add_report
if form.validate() and lg.report(form):
File "./decksite/league.py", line 256, in report
match.insert_match(dtutil.now(), form.entry, form.entry_games, form.opponent, form.opponent_games, None, None, mtgo_match_id)
File "./decksite/data/match.py", line 28, in insert_match
db().execute(sql, [dtutil.dt2ts(dt), winner_id])
File "./shared/database.py", line 45, in execute
[n, _] = self.execute_anything(sql, args, False)
File "./shared/database.py", line 60, in execute_anything
raise DatabaseException('Failed to execute {sql} with {args} because of {e}'.format(sql=sql, args=args, e=e))

I'm able to get the expected error if I add a false time.sleep(5) into the code for reporting a match.

So it's not that we're not catching the instances of failing to get the lock or what have you.
So what is it?

Ok looking at this despite the presence of the word "lock" we're not talking about our locks here we're talking about db locks. Trying to update deck_cache is failing because the query times out waiting for whatever lock it needs to do its update. So get_lock and release_lock for the explicit lock are just dandy (I think) but something is locking deck_cache in such a way that the update can't complete in a timely fashion.

Our transactions also do not work despite the reference counting changes I made recently because when we create the cursor we set autocommit=True and apparently using BEGIN does not turn off autocommit as it would in normal MySQL when used via mysqldb (just from my experimenting).

Making transactions work correctly is 89f154a.

In each of these cases we fail setting either wins or losses on deck_cache before inserting the actual match. The matches in question are:
# person_id|opponent_id|game_wins|game_losses
24921|24854|2|1
24921|24854|2|1
25635|25737|0|2
25745|25737|1|2
25745|25737|1|2
25745|25737|1|2
25635|25745|1|2
25635|25745|1|2
25745|25635|2|1
25635|25737|1|2
25635|25737|1|2
25745|25737|2|1
25737|25749|0|2
25737|25745|2|1
25727|25737|2|0
25727|25737|2|0
25737|25635|2|1
25737|25722|2|0
25722|25727|2|1
25722|25714|1|2
25714|25722|2|1
25714|25722|2|1
25714|25722|2|1
25714|25722|2|1
25714|25722|2|1
25714|25722|2|1
25709|25562|2|1
25562|25709|1|2
25709|25562|2|1
25562|25709|1|2
25562|25709|1|2
25562|25719|2|0
25562|25719|2|0
25562|25719|2|0
25562|25719|2|0
25562|25719|2|0
25562|25719|2|0
25710|25716|0|2
25612|25383|1|2
25498|25503|1|2
25498|25503|1|2
25498|25503|1|2
25498|25501|2|1

Some were successfully reported at some stage:
MariaDB [decksite]> SELECT match_id FROM deck_match WHERE deck_id = 24921 AND match_id IN (SELECT match_id FROM deck_match WHERE deck_id = 24854);
+----------+
| match_id |
+----------+
|    43770 |
+----------+
1 row in set (0.00 sec)

MariaDB [decksite]> SELECT match_id FROM deck_match WHERE deck_id = 25498 AND match_id IN (SELECT match_id FROM deck_match WHERE deck_id = 25501);
Empty set (0.01 sec)

MariaDB [decksite]> SELECT match_id FROM deck_match WHERE deck_id = 25498 AND match_id IN (SELECT match_id FROM deck_match WHERE deck_id = 25503);
+----------+
| match_id |
+----------+
|    44739 |
+----------+
1 row in set (0.00 sec)

MariaDB [decksite]> SELECT match_id FROM deck_match WHERE deck_id = 25562 AND match_id IN (SELECT match_id FROM deck_match WHERE deck_id = 25709);
Empty set (0.00 sec)

MariaDB [decksite]> SELECT match_id FROM deck_match WHERE deck_id = 25562 AND match_id IN (SELECT match_id FROM deck_match WHERE deck_id = 25719);
Empty set (0.00 sec)

MariaDB [decksite]> SELECT match_id FROM deck_match WHERE deck_id = 25612 AND match_id IN (SELECT match_id FROM deck_match WHERE deck_id = 25383);
Empty set (0.00 sec)

MariaDB [decksite]> SELECT match_id FROM deck_match WHERE deck_id = 25635 AND match_id IN (SELECT match_id FROM deck_match WHERE deck_id = 25737);
Empty set (0.00 sec)

MariaDB [decksite]> SELECT match_id FROM deck_match WHERE deck_id = 25635 AND match_id IN (SELECT match_id FROM deck_match WHERE deck_id = 25737);
Empty set (0.00 sec)

MariaDB [decksite]> SELECT match_id FROM deck_match WHERE deck_id = 25635 AND match_id IN (SELECT match_id FROM deck_match WHERE deck_id = 25745);
+----------+
| match_id |
+----------+
|    45166 |
+----------+
1 row in set (0.00 sec)

MariaDB [decksite]> SELECT match_id FROM deck_match WHERE deck_id = 25709 AND match_id IN (SELECT match_id FROM deck_match WHERE deck_id = 25562);
Empty set (0.00 sec)

MariaDB [decksite]> SELECT match_id FROM deck_match WHERE deck_id = 25710 AND match_id IN (SELECT match_id FROM deck_match WHERE deck_id = 25716);
Empty set (0.00 sec)

MariaDB [decksite]> SELECT match_id FROM deck_match WHERE deck_id = 25714 AND match_id IN (SELECT match_id FROM deck_match WHERE deck_id = 25722);
Empty set (0.00 sec)

MariaDB [decksite]> SELECT match_id FROM deck_match WHERE deck_id = 25722 AND match_id IN (SELECT match_id FROM deck_match WHERE deck_id = 25714);
Empty set (0.00 sec)

MariaDB [decksite]> SELECT match_id FROM deck_match WHERE deck_id = 25722 AND match_id IN (SELECT match_id FROM deck_match WHERE deck_id = 25727);
Empty set (0.00 sec)

MariaDB [decksite]> SELECT match_id FROM deck_match WHERE deck_id = 25727 AND match_id IN (SELECT match_id FROM deck_match WHERE deck_id = 25737);
Empty set (0.00 sec)

MariaDB [decksite]> SELECT match_id FROM deck_match WHERE deck_id = 25737 AND match_id IN (SELECT match_id FROM deck_match WHERE deck_id = 25635);
Empty set (0.00 sec)

MariaDB [decksite]> SELECT match_id FROM deck_match WHERE deck_id = 25737 AND match_id IN (SELECT match_id FROM deck_match WHERE deck_id = 25722);
Empty set (0.00 sec)

MariaDB [decksite]> SELECT match_id FROM deck_match WHERE deck_id = 25737 AND match_id IN (SELECT match_id FROM deck_match WHERE deck_id = 25745);
Empty set (0.00 sec)

MariaDB [decksite]> SELECT match_id FROM deck_match WHERE deck_id = 25737 AND match_id IN (SELECT match_id FROM deck_match WHERE deck_id = 25749);
Empty set (0.01 sec)

MariaDB [decksite]> SELECT match_id FROM deck_match WHERE deck_id = 25745 AND match_id IN (SELECT match_id FROM deck_match WHERE deck_id = 25635);
+----------+
| match_id |
+----------+
|    45166 |
+----------+
1 row in set (0.00 sec)

MariaDB [decksite]> SELECT match_id FROM deck_match WHERE deck_id = 25745 AND match_id IN (SELECT match_id FROM deck_match WHERE deck_id = 25737);
Empty set (0.00 sec)

MariaDB [decksite]> SELECT match_id FROM deck_match WHERE deck_id = 25745 AND match_id IN (SELECT match_id FROM deck_match WHERE deck_id = 25737);
Empty set (0.00 sec)

MariaDB [decksite]>

Leaves us with:
25498|25501|2|1
25562|25709|1|2
25562|25719|2|0
25612|25383|1|2
25635|25737|0|2
25635|25737|1|2
25709|25562|2|1
25710|25716|0|2
25714|25722|2|1
25722|25714|1|2
25722|25727|2|1
25727|25737|2|0
25737|25635|2|1
25737|25722|2|0
25737|25745|2|1
25737|25749|0|2
25745|25737|1|2
25745|25737|2|1

unreported.

Unique list of affected decks:
25383
25498
25501
25562
25612
25635
25709
25710
25714
25716
25719
25722
25727
25737
25745
25749

MariaDB [decksite]> SELECT COUNT(*) FROM deck_match WHERE deck_id = 25749;SELECT COUNT(*) FROM deck_match WHERE deck_id = 25383;
+----------+
| COUNT(*) |
+----------+
|        5 |
+----------+
1 row in set (0.00 sec)

+----------+
| COUNT(*) |
+----------+
|        5 |
+----------+
1 row in set (0.00 sec)

MariaDB [decksite]> SELECT COUNT(*) FROM deck_match WHERE deck_id = 25498;
+----------+
| COUNT(*) |
+----------+
|        5 |
+----------+
1 row in set (0.00 sec)

MariaDB [decksite]> SELECT COUNT(*) FROM deck_match WHERE deck_id = 25501;
+----------+
| COUNT(*) |
+----------+
|        4 |
+----------+
1 row in set (0.00 sec)

MariaDB [decksite]> SELECT COUNT(*) FROM deck_match WHERE deck_id = 25562;
+----------+
| COUNT(*) |
+----------+
|        4 |
+----------+
1 row in set (0.00 sec)

MariaDB [decksite]> SELECT COUNT(*) FROM deck_match WHERE deck_id = 25612;
+----------+
| COUNT(*) |
+----------+
|        1 |
+----------+
1 row in set (0.00 sec)

MariaDB [decksite]> SELECT COUNT(*) FROM deck_match WHERE deck_id = 25635;
+----------+
| COUNT(*) |
+----------+
|        4 |
+----------+
1 row in set (0.00 sec)

MariaDB [decksite]> SELECT COUNT(*) FROM deck_match WHERE deck_id = 25709;
+----------+
| COUNT(*) |
+----------+
|        4 |
+----------+
1 row in set (0.00 sec)

MariaDB [decksite]> SELECT COUNT(*) FROM deck_match WHERE deck_id = 25710;
+----------+
| COUNT(*) |
+----------+
|        1 |
+----------+
1 row in set (0.00 sec)

MariaDB [decksite]> SELECT COUNT(*) FROM deck_match WHERE deck_id = 25714;
+----------+
| COUNT(*) |
+----------+
|        5 |
+----------+
1 row in set (0.00 sec)

MariaDB [decksite]> SELECT COUNT(*) FROM deck_match WHERE deck_id = 25716;
+----------+
| COUNT(*) |
+----------+
|        2 |
+----------+
1 row in set (0.00 sec)

MariaDB [decksite]> SELECT COUNT(*) FROM deck_match WHERE deck_id = 25719;
+----------+
| COUNT(*) |
+----------+
|        1 |
+----------+
1 row in set (0.00 sec)

MariaDB [decksite]> SELECT COUNT(*) FROM deck_match WHERE deck_id = 25722;
+----------+
| COUNT(*) |
+----------+
|        0 |
+----------+
1 row in set (0.01 sec)

MariaDB [decksite]> SELECT COUNT(*) FROM deck_match WHERE deck_id = 25727;
+----------+
| COUNT(*) |
+----------+
|        2 |
+----------+
1 row in set (0.00 sec)

MariaDB [decksite]> SELECT COUNT(*) FROM deck_match WHERE deck_id = 25737;
+----------+
| COUNT(*) |
+----------+
|        0 |
+----------+
1 row in set (0.00 sec)

MariaDB [decksite]> SELECT COUNT(*) FROM deck_match WHERE deck_id = 25745;
+----------+
| COUNT(*) |
+----------+
|        2 |
+----------+
1 row in set (0.00 sec)

MariaDB [decksite]> SELECT COUNT(*) FROM deck_match WHERE deck_id = 25749;
+----------+
| COUNT(*) |
+----------+
|        5 |
+----------+
1 row in set (0.00 sec)

MariaDB [decksite]>

Some of these decks have completed their runs but most have not.
Not completely sure how to proceed.

Ran a one-off update to get wins and losses correct. Altered four rows.
Probably not going to fuss about the missing results unless people ask.
I'm not sure anything I've done here will make this work better in future although when the transaction fails it should not leave the db in an inconsistent state if the first UPDATE works now. Mostly it was the first update failing, though.
Vague suspicions: (i) this affects particular decks more than other somehow - see how one Japanese player had five results in a row fail to stick, (ii) it's something to do with pdbot telling folks to report manually.

We now close database connections at the end of every request and we also log when we try and end a request with an open transaction. Between these things we should be good (?)