PennyDreadfulMTG / perf-reports

2 stars 2 forks source link

500 error at /api/status/ #42533

Closed vorpal-buildbot closed 5 years ago

vorpal-buildbot commented 5 years ago

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31141)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by carmandor

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'db69caa6837efbe8f225171f32780f3d51547108667', '_ga': 'GA1.2.1023975177.1547108675', '_gid': 'GA1.2.684814235.1547108675', 'session': '.eJx9UctuwjAQ_Jc9R1UCJo65tYAaaFUailRoVUVWsgRDHEe2U17i3-sgUQ6Vepyd9czs-ARpjVryCisLfasb9IDnUlTQX_HSOJSjFFLlNyxMpnSeCjcCwkISdKIgpJSybsh8Ch78w1Rp0YgyvzqVqigwbxMYVV0UO7TLPJC2UGljUFdcohPLeBsxV9ppKN7YdSc1ltuW-t6_0CyOYnvkm8E03I2b98ZnH8Nku5ktyW3fqi26o07AswyNuWK4p9Owt1fJ8zJODM-2bDITfjKaj56SeHdw73FfC40m5a6foEcoDbosCO56JIoYudFtY6FPIt_3QOPKjda_HrMRfQ0200X02JnLIZkM3qw8LKwaG32sl87DNVq7Yz5dde4fxKr1vRRl4MuDi0xqD-0KPCDXqOHswZ_WLNcFupRVU5bnH5G0mF4.DxjECA.c2CA9IPY89rHQzmAi2IKwPa6uYY'}
            Endpoint: person_status
            View Args: {}
            Person: 496412816777936907
            Referrer: https://pennydreadfulmagic.com/seasons/7/league/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: IT
X-Forwarded-For: 185.67.237.178, 188.114.102.198
Cf-Ray: 496ef3783f6a430a-MXP
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
Accept: */*
Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3
Referer: https://pennydreadfulmagic.com/seasons/7/league/
X-Requested-With: XMLHttpRequest
Cookie: __cfduid=db69caa6837efbe8f225171f32780f3d51547108667; _ga=GA1.2.1023975177.1547108675; _gid=GA1.2.684814235.1547108675; session=.eJx9UctuwjAQ_Jc9R1UCJo65tYAaaFUailRoVUVWsgRDHEe2U17i3-sgUQ6Vepyd9czs-ARpjVryCisLfasb9IDnUlTQX_HSOJSjFFLlNyxMpnSeCjcCwkISdKIgpJSybsh8Ch78w1Rp0YgyvzqVqigwbxMYVV0UO7TLPJC2UGljUFdcohPLeBsxV9ppKN7YdSc1ltuW-t6_0CyOYnvkm8E03I2b98ZnH8Nku5ktyW3fqi26o07AswyNuWK4p9Owt1fJ8zJODM-2bDITfjKaj56SeHdw73FfC40m5a6foEcoDbosCO56JIoYudFtY6FPIt_3QOPKjda_HrMRfQ0200X02JnLIZkM3qw8LKwaG32sl87DNVq7Yz5dde4fxKr1vRRl4MuDi0xqD-0KPCDXqOHswZ_WLNcFupRVU5bnH5G0mF4.DxjECA.c2CA9IPY89rHQzmAi2IKwPa6uYY
Cf-Connecting-Ip: 185.67.237.178
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31141)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31141)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by carmandor

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'db69caa6837efbe8f225171f32780f3d51547108667', '_ga': 'GA1.2.1023975177.1547108675', '_gid': 'GA1.2.684814235.1547108675', 'session': '.eJx9UctuwjAQ_Jc9R1UCJo65tYAaaFUailRoVUVWsgRDHEe2U17i3-sgUQ6Vepyd9czs-ARpjVryCisLfasb9IDnUlTQX_HSOJSjFFLlNyxMpnSeCjcCwkISdKIgpJSybsh8Ch78w1Rp0YgyvzqVqigwbxMYVV0UO7TLPJC2UGljUFdcohPLeBsxV9ppKN7YdSc1ltuW-t6_0CyOYnvkm8E03I2b98ZnH8Nku5ktyW3fqi26o07AswyNuWK4p9Owt1fJ8zJODM-2bDITfjKaj56SeHdw73FfC40m5a6foEcoDbosCO56JIoYudFtY6FPIt_3QOPKjda_HrMRfQ0200X02JnLIZkM3qw8LKwaG32sl87DNVq7Yz5dde4fxKr1vRRl4MuDi0xqD-0KPCDXqOHswZ_WLNcFupRVU5bnH5G0mF4.DxjEDQ.bnkF0yzknU3bN2R9X9aFgj8BNZA', '_gat_gtag_UA_109131120_1': '1'}
            Endpoint: person_status
            View Args: {}
            Person: 496412816777936907
            Referrer: https://pennydreadfulmagic.com/seasons/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: IT
X-Forwarded-For: 185.67.237.178, 188.114.102.198
Cf-Ray: 496ef3958dd6430a-MXP
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
Accept: */*
Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3
Referer: https://pennydreadfulmagic.com/seasons/
X-Requested-With: XMLHttpRequest
Cookie: __cfduid=db69caa6837efbe8f225171f32780f3d51547108667; _ga=GA1.2.1023975177.1547108675; _gid=GA1.2.684814235.1547108675; session=.eJx9UctuwjAQ_Jc9R1UCJo65tYAaaFUailRoVUVWsgRDHEe2U17i3-sgUQ6Vepyd9czs-ARpjVryCisLfasb9IDnUlTQX_HSOJSjFFLlNyxMpnSeCjcCwkISdKIgpJSybsh8Ch78w1Rp0YgyvzqVqigwbxMYVV0UO7TLPJC2UGljUFdcohPLeBsxV9ppKN7YdSc1ltuW-t6_0CyOYnvkm8E03I2b98ZnH8Nku5ktyW3fqi26o07AswyNuWK4p9Owt1fJ8zJODM-2bDITfjKaj56SeHdw73FfC40m5a6foEcoDbosCO56JIoYudFtY6FPIt_3QOPKjda_HrMRfQ0200X02JnLIZkM3qw8LKwaG32sl87DNVq7Yz5dde4fxKr1vRRl4MuDi0xqD-0KPCDXqOHswZ_WLNcFupRVU5bnH5G0mF4.DxjEDQ.bnkF0yzknU3bN2R9X9aFgj8BNZA; _gat_gtag_UA_109131120_1=1
Cf-Connecting-Ip: 185.67.237.178
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31141)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31141)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by carmandor

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'db69caa6837efbe8f225171f32780f3d51547108667', '_ga': 'GA1.2.1023975177.1547108675', '_gid': 'GA1.2.684814235.1547108675', 'session': '.eJx9UctuwjAQ_Jc9R1UCJo65tYAaaFUailRoVUVWsgRDHEe2U17i3-sgUQ6Vepyd9czs-ARpjVryCisLfasb9IDnUlTQX_HSOJSjFFLlNyxMpnSeCjcCwkISdKIgpJSybsh8Ch78w1Rp0YgyvzqVqigwbxMYVV0UO7TLPJC2UGljUFdcohPLeBsxV9ppKN7YdSc1ltuW-t6_0CyOYnvkm8E03I2b98ZnH8Nku5ktyW3fqi26o07AswyNuWK4p9Owt1fJ8zJODM-2bDITfjKaj56SeHdw73FfC40m5a6foEcoDbosCO56JIoYudFtY6FPIt_3QOPKjda_HrMRfQ0200X02JnLIZkM3qw8LKwaG32sl87DNVq7Yz5dde4fxKr1vRRl4MuDi0xqD-0KPCDXqOHswZ_WLNcFupRVU5bnH5G0mF4.DxjEEg.UWGCUdTFBAECb94Mi654wK_Br8I', '_gat_gtag_UA_109131120_1': '1'}
            Endpoint: person_status
            View Args: {}
            Person: 496412816777936907
            Referrer: https://pennydreadfulmagic.com/seasons/8/league/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: IT
X-Forwarded-For: 185.67.237.178, 188.114.102.198
Cf-Ray: 496ef3b179c0430a-MXP
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
Accept: */*
Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3
Referer: https://pennydreadfulmagic.com/seasons/8/league/
X-Requested-With: XMLHttpRequest
Cookie: __cfduid=db69caa6837efbe8f225171f32780f3d51547108667; _ga=GA1.2.1023975177.1547108675; _gid=GA1.2.684814235.1547108675; session=.eJx9UctuwjAQ_Jc9R1UCJo65tYAaaFUailRoVUVWsgRDHEe2U17i3-sgUQ6Vepyd9czs-ARpjVryCisLfasb9IDnUlTQX_HSOJSjFFLlNyxMpnSeCjcCwkISdKIgpJSybsh8Ch78w1Rp0YgyvzqVqigwbxMYVV0UO7TLPJC2UGljUFdcohPLeBsxV9ppKN7YdSc1ltuW-t6_0CyOYnvkm8E03I2b98ZnH8Nku5ktyW3fqi26o07AswyNuWK4p9Owt1fJ8zJODM-2bDITfjKaj56SeHdw73FfC40m5a6foEcoDbosCO56JIoYudFtY6FPIt_3QOPKjda_HrMRfQ0200X02JnLIZkM3qw8LKwaG32sl87DNVq7Yz5dde4fxKr1vRRl4MuDi0xqD-0KPCDXqOHswZ_WLNcFupRVU5bnH5G0mF4.DxjEEg.UWGCUdTFBAECb94Mi654wK_Br8I; _gat_gtag_UA_109131120_1=1
Cf-Connecting-Ip: 185.67.237.178
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31141)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31141)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by carmandor

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'db69caa6837efbe8f225171f32780f3d51547108667', '_ga': 'GA1.2.1023975177.1547108675', '_gid': 'GA1.2.684814235.1547108675', 'session': '.eJx9UctuwjAQ_Jc9R1UCJo65tYAaaFUailRoVUVWsgRDHEe2U17i3-sgUQ6Vepyd9czs-ARpjVryCisLfasb9IDnUlTQX_HSOJSjFFLlNyxMpnSeCjcCwkISdKIgpJSybsh8Ch78w1Rp0YgyvzqVqigwbxMYVV0UO7TLPJC2UGljUFdcohPLeBsxV9ppKN7YdSc1ltuW-t6_0CyOYnvkm8E03I2b98ZnH8Nku5ktyW3fqi26o07AswyNuWK4p9Owt1fJ8zJODM-2bDITfjKaj56SeHdw73FfC40m5a6foEcoDbosCO56JIoYudFtY6FPIt_3QOPKjda_HrMRfQ0200X02JnLIZkM3qw8LKwaG32sl87DNVq7Yz5dde4fxKr1vRRl4MuDi0xqD-0KPCDXqOHswZ_WLNcFupRVU5bnH5G0mF4.DxjEGA.UL7lrgOSTMqcsufSXyWxPZb81yA', '_gat_gtag_UA_109131120_1': '1'}
            Endpoint: person_status
            View Args: {}
            Person: 496412816777936907
            Referrer: https://pennydreadfulmagic.com/league/current/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: IT
X-Forwarded-For: 185.67.237.178, 188.114.102.198
Cf-Ray: 496ef3d98fa3430a-MXP
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
Accept: */*
Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3
Referer: https://pennydreadfulmagic.com/league/current/
X-Requested-With: XMLHttpRequest
Cookie: __cfduid=db69caa6837efbe8f225171f32780f3d51547108667; _ga=GA1.2.1023975177.1547108675; _gid=GA1.2.684814235.1547108675; session=.eJx9UctuwjAQ_Jc9R1UCJo65tYAaaFUailRoVUVWsgRDHEe2U17i3-sgUQ6Vepyd9czs-ARpjVryCisLfasb9IDnUlTQX_HSOJSjFFLlNyxMpnSeCjcCwkISdKIgpJSybsh8Ch78w1Rp0YgyvzqVqigwbxMYVV0UO7TLPJC2UGljUFdcohPLeBsxV9ppKN7YdSc1ltuW-t6_0CyOYnvkm8E03I2b98ZnH8Nku5ktyW3fqi26o07AswyNuWK4p9Owt1fJ8zJODM-2bDITfjKaj56SeHdw73FfC40m5a6foEcoDbosCO56JIoYudFtY6FPIt_3QOPKjda_HrMRfQ0200X02JnLIZkM3qw8LKwaG32sl87DNVq7Yz5dde4fxKr1vRRl4MuDi0xqD-0KPCDXqOHswZ_WLNcFupRVU5bnH5G0mF4.DxjEGA.UL7lrgOSTMqcsufSXyWxPZb81yA; _gat_gtag_UA_109131120_1=1
Cf-Connecting-Ip: 185.67.237.178
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31141)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31128)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by leoking

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'd62fe1c2c8fd25e9826350e52e4218d221541210064', '_ga': 'GA1.2.167532993.1541210069', 'session': '.eJx9UctuwjAQ_Jc9R1XeCdxoKSJFpGqBVqWqIhMvwSGxU9sRL_HvdZAoh0o9zux6Zmd8gqxBWROOXENfyxYtILRmHPprUimDKNasFvSGmcqFpBkzFHh2GPhuEMWx7wVO2HN7YME_E54VLavo1akSRYG0u0AJflF0IjewoNaFyFqFkpMajViFYst4YRQEafXGzZQmuhvsHmO6EU_xtBked-XqYbv8SGU-n4_LciqWt30ttmginYDkOSp1xbCfTXvNa-K1o5cFi5t0uD_y8STx6m9H7FLzHvcNk6gyYtpxTCA7iqLAvvPtKIhc7zbvCgttP7ZtCySuDbX5NZnjaLB4Tt4XUiaczgbp5M2Tq9XwiHZY5sbEFNqYNJ-mOfMNbH0w3KUnBV8WXGQyfehW4B6JRAlnC_6Upoks0JzJ26o6_wChNJis.DxkZjA.-lqYk3X96YH9vCllAQvVq7e_xJQ', '_gid': 'GA1.2.599928363.1546878802', '_gat_gtag_UA_109131120_1': '1'}
            Endpoint: person_status
            View Args: {}
            Person: 306542578843516929
            Referrer: https://pennydreadfulmagic.com/league/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: BR
X-Forwarded-For: 177.74.113.17, 162.158.62.23
Cf-Ray: 497109f15e11c5ca-EWR
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
Accept: */*
Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.5,en;q=0.3
Referer: https://pennydreadfulmagic.com/league/
X-Requested-With: XMLHttpRequest
Cookie: __cfduid=d62fe1c2c8fd25e9826350e52e4218d221541210064; _ga=GA1.2.167532993.1541210069; session=.eJx9UctuwjAQ_Jc9R1XeCdxoKSJFpGqBVqWqIhMvwSGxU9sRL_HvdZAoh0o9zux6Zmd8gqxBWROOXENfyxYtILRmHPprUimDKNasFvSGmcqFpBkzFHh2GPhuEMWx7wVO2HN7YME_E54VLavo1akSRYG0u0AJflF0IjewoNaFyFqFkpMajViFYst4YRQEafXGzZQmuhvsHmO6EU_xtBked-XqYbv8SGU-n4_LciqWt30ttmginYDkOSp1xbCfTXvNa-K1o5cFi5t0uD_y8STx6m9H7FLzHvcNk6gyYtpxTCA7iqLAvvPtKIhc7zbvCgttP7ZtCySuDbX5NZnjaLB4Tt4XUiaczgbp5M2Tq9XwiHZY5sbEFNqYNJ-mOfMNbH0w3KUnBV8WXGQyfehW4B6JRAlnC_6Upoks0JzJ26o6_wChNJis.DxkZjA.-lqYk3X96YH9vCllAQvVq7e_xJQ; _gid=GA1.2.599928363.1546878802; _gat_gtag_UA_109131120_1=1
Cf-Connecting-Ip: 177.74.113.17
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31128)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31128)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by leoking

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'd62fe1c2c8fd25e9826350e52e4218d221541210064', '_ga': 'GA1.2.167532993.1541210069', 'session': '.eJx9UctuwjAQ_Jc9R1XeCdxoKSJFpGqBVqWqIhMvwSGxU9sRL_HvdZAoh0o9zux6Zmd8gqxBWROOXENfyxYtILRmHPprUimDKNasFvSGmcqFpBkzFHh2GPhuEMWx7wVO2HN7YME_E54VLavo1akSRYG0u0AJflF0IjewoNaFyFqFkpMajViFYst4YRQEafXGzZQmuhvsHmO6EU_xtBked-XqYbv8SGU-n4_LciqWt30ttmginYDkOSp1xbCfTXvNa-K1o5cFi5t0uD_y8STx6m9H7FLzHvcNk6gyYtpxTCA7iqLAvvPtKIhc7zbvCgttP7ZtCySuDbX5NZnjaLB4Tt4XUiaczgbp5M2Tq9XwiHZY5sbEFNqYNJ-mOfMNbH0w3KUnBV8WXGQyfehW4B6JRAlnC_6Upoks0JzJ26o6_wChNJis.DxkZkQ.nJ9_RdISpCERA4XdZQ_MVbR-5RU', '_gid': 'GA1.2.599928363.1546878802', '_gat_gtag_UA_109131120_1': '1'}
            Endpoint: person_status
            View Args: {}
            Person: 306542578843516929
            Referrer: https://pennydreadfulmagic.com/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: BR
X-Forwarded-For: 177.74.113.17, 162.158.62.23
Cf-Ray: 49710a137ed5c5ca-EWR
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
Accept: */*
Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.5,en;q=0.3
Referer: https://pennydreadfulmagic.com/
X-Requested-With: XMLHttpRequest
Cookie: __cfduid=d62fe1c2c8fd25e9826350e52e4218d221541210064; _ga=GA1.2.167532993.1541210069; session=.eJx9UctuwjAQ_Jc9R1XeCdxoKSJFpGqBVqWqIhMvwSGxU9sRL_HvdZAoh0o9zux6Zmd8gqxBWROOXENfyxYtILRmHPprUimDKNasFvSGmcqFpBkzFHh2GPhuEMWx7wVO2HN7YME_E54VLavo1akSRYG0u0AJflF0IjewoNaFyFqFkpMajViFYst4YRQEafXGzZQmuhvsHmO6EU_xtBked-XqYbv8SGU-n4_LciqWt30ttmginYDkOSp1xbCfTXvNa-K1o5cFi5t0uD_y8STx6m9H7FLzHvcNk6gyYtpxTCA7iqLAvvPtKIhc7zbvCgttP7ZtCySuDbX5NZnjaLB4Tt4XUiaczgbp5M2Tq9XwiHZY5sbEFNqYNJ-mOfMNbH0w3KUnBV8WXGQyfehW4B6JRAlnC_6Upoks0JzJ26o6_wChNJis.DxkZkQ.nJ9_RdISpCERA4XdZQ_MVbR-5RU; _gid=GA1.2.599928363.1546878802; _gat_gtag_UA_109131120_1=1
Cf-Connecting-Ip: 177.74.113.17
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31128)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31128)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by leoking

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'd62fe1c2c8fd25e9826350e52e4218d221541210064', '_ga': 'GA1.2.167532993.1541210069', 'session': '.eJx9UctuwjAQ_Jc9R1XeCdxoKSJFpGqBVqWqIhMvwSGxU9sRL_HvdZAoh0o9zux6Zmd8gqxBWROOXENfyxYtILRmHPprUimDKNasFvSGmcqFpBkzFHh2GPhuEMWx7wVO2HN7YME_E54VLavo1akSRYG0u0AJflF0IjewoNaFyFqFkpMajViFYst4YRQEafXGzZQmuhvsHmO6EU_xtBked-XqYbv8SGU-n4_LciqWt30ttmginYDkOSp1xbCfTXvNa-K1o5cFi5t0uD_y8STx6m9H7FLzHvcNk6gyYtpxTCA7iqLAvvPtKIhc7zbvCgttP7ZtCySuDbX5NZnjaLB4Tt4XUiaczgbp5M2Tq9XwiHZY5sbEFNqYNJ-mOfMNbH0w3KUnBV8WXGQyfehW4B6JRAlnC_6Upoks0JzJ26o6_wChNJis.DxkZqA.f5z7UKbHRBDNsvJrNoNtfSOSqJA', '_gid': 'GA1.2.599928363.1546878802', '_gat_gtag_UA_109131120_1': '1'}
            Endpoint: person_status
            View Args: {}
            Person: 306542578843516929
            Referrer: https://pennydreadfulmagic.com/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: BR
X-Forwarded-For: 177.74.113.17, 162.158.62.23
Cf-Ray: 49710aa4f9b0c5ca-EWR
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
Accept: */*
Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.5,en;q=0.3
Referer: https://pennydreadfulmagic.com/
X-Requested-With: XMLHttpRequest
Cache-Control: max-age=0
Cookie: __cfduid=d62fe1c2c8fd25e9826350e52e4218d221541210064; _ga=GA1.2.167532993.1541210069; session=.eJx9UctuwjAQ_Jc9R1XeCdxoKSJFpGqBVqWqIhMvwSGxU9sRL_HvdZAoh0o9zux6Zmd8gqxBWROOXENfyxYtILRmHPprUimDKNasFvSGmcqFpBkzFHh2GPhuEMWx7wVO2HN7YME_E54VLavo1akSRYG0u0AJflF0IjewoNaFyFqFkpMajViFYst4YRQEafXGzZQmuhvsHmO6EU_xtBked-XqYbv8SGU-n4_LciqWt30ttmginYDkOSp1xbCfTXvNa-K1o5cFi5t0uD_y8STx6m9H7FLzHvcNk6gyYtpxTCA7iqLAvvPtKIhc7zbvCgttP7ZtCySuDbX5NZnjaLB4Tt4XUiaczgbp5M2Tq9XwiHZY5sbEFNqYNJ-mOfMNbH0w3KUnBV8WXGQyfehW4B6JRAlnC_6Upoks0JzJ26o6_wChNJis.DxkZqA.f5z7UKbHRBDNsvJrNoNtfSOSqJA; _gid=GA1.2.599928363.1546878802; _gat_gtag_UA_109131120_1=1
Cf-Connecting-Ip: 177.74.113.17
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31128)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31128)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by leoking

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'd62fe1c2c8fd25e9826350e52e4218d221541210064', '_ga': 'GA1.2.167532993.1541210069', 'session': '.eJx9UctuwjAQ_Jc9R1XeCdxoKSJFpGqBVqWqIhMvwSGxU9sRL_HvdZAoh0o9zux6Zmd8gqxBWROOXENfyxYtILRmHPprUimDKNasFvSGmcqFpBkzFHh2GPhuEMWx7wVO2HN7YME_E54VLavo1akSRYG0u0AJflF0IjewoNaFyFqFkpMajViFYst4YRQEafXGzZQmuhvsHmO6EU_xtBked-XqYbv8SGU-n4_LciqWt30ttmginYDkOSp1xbCfTXvNa-K1o5cFi5t0uD_y8STx6m9H7FLzHvcNk6gyYtpxTCA7iqLAvvPtKIhc7zbvCgttP7ZtCySuDbX5NZnjaLB4Tt4XUiaczgbp5M2Tq9XwiHZY5sbEFNqYNJ-mOfMNbH0w3KUnBV8WXGQyfehW4B6JRAlnC_6Upoks0JzJ26o6_wChNJis.DxkaHA.UYpVsDNSy6TQFpgKa4Jxw3TpPkw', '_gid': 'GA1.2.599928363.1546878802'}
            Endpoint: person_status
            View Args: {}
            Person: 306542578843516929
            Referrer: https://pennydreadfulmagic.com/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: BR
X-Forwarded-For: 177.74.113.17, 162.158.62.23
Cf-Ray: 49710d78d95ac5ca-EWR
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
Accept: */*
Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.5,en;q=0.3
Referer: https://pennydreadfulmagic.com/
X-Requested-With: XMLHttpRequest
Cache-Control: max-age=0
Cookie: __cfduid=d62fe1c2c8fd25e9826350e52e4218d221541210064; _ga=GA1.2.167532993.1541210069; session=.eJx9UctuwjAQ_Jc9R1XeCdxoKSJFpGqBVqWqIhMvwSGxU9sRL_HvdZAoh0o9zux6Zmd8gqxBWROOXENfyxYtILRmHPprUimDKNasFvSGmcqFpBkzFHh2GPhuEMWx7wVO2HN7YME_E54VLavo1akSRYG0u0AJflF0IjewoNaFyFqFkpMajViFYst4YRQEafXGzZQmuhvsHmO6EU_xtBked-XqYbv8SGU-n4_LciqWt30ttmginYDkOSp1xbCfTXvNa-K1o5cFi5t0uD_y8STx6m9H7FLzHvcNk6gyYtpxTCA7iqLAvvPtKIhc7zbvCgttP7ZtCySuDbX5NZnjaLB4Tt4XUiaczgbp5M2Tq9XwiHZY5sbEFNqYNJ-mOfMNbH0w3KUnBV8WXGQyfehW4B6JRAlnC_6Upoks0JzJ26o6_wChNJis.DxkaHA.UYpVsDNSy6TQFpgKa4Jxw3TpPkw; _gid=GA1.2.599928363.1546878802
Cf-Connecting-Ip: 177.74.113.17
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31128)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31141)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by carmandor

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'db69caa6837efbe8f225171f32780f3d51547108667', '_ga': 'GA1.2.1023975177.1547108675', '_gid': 'GA1.2.684814235.1547108675', 'session': '.eJx9UctuwjAQ_Jc9R1UCJo65tYAaaFUailRoVUVWsgRDHEe2U17i3-sgUQ6Vepyd9czs-ARpjVryCisLfasb9IDnUlTQX_HSOJSjFFLlNyxMpnSeCjcCwkISdKIgpJSybsh8Ch78w1Rp0YgyvzqVqigwbxMYVV0UO7TLPJC2UGljUFdcohPLeBsxV9ppKN7YdSc1ltuW-t6_0CyOYnvkm8E03I2b98ZnH8Nku5ktyW3fqi26o07AswyNuWK4p9Owt1fJ8zJODM-2bDITfjKaj56SeHdw73FfC40m5a6foEcoDbosCO56JIoYudFtY6FPIt_3QOPKjda_HrMRfQ0200X02JnLIZkM3qw8LKwaG32sl87DNVq7Yz5dde4fxKr1vRRl4MuDi0xqD-0KPCDXqOHswZ_WLNcFupRVU5bnH5G0mF4.DxkaaA.9ixJAX-tG5ZUK1vMXohoi1ZUvq4'}
            Endpoint: person_status
            View Args: {}
            Person: 496412816777936907
            Referrer: https://pennydreadfulmagic.com/league/current/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: IT
X-Forwarded-For: 185.67.237.178, 172.68.198.48
Cf-Ray: 49710f504a2f6f30-FCO
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
Accept: */*
Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3
Referer: https://pennydreadfulmagic.com/league/current/
X-Requested-With: XMLHttpRequest
Cookie: __cfduid=db69caa6837efbe8f225171f32780f3d51547108667; _ga=GA1.2.1023975177.1547108675; _gid=GA1.2.684814235.1547108675; session=.eJx9UctuwjAQ_Jc9R1UCJo65tYAaaFUailRoVUVWsgRDHEe2U17i3-sgUQ6Vepyd9czs-ARpjVryCisLfasb9IDnUlTQX_HSOJSjFFLlNyxMpnSeCjcCwkISdKIgpJSybsh8Ch78w1Rp0YgyvzqVqigwbxMYVV0UO7TLPJC2UGljUFdcohPLeBsxV9ppKN7YdSc1ltuW-t6_0CyOYnvkm8E03I2b98ZnH8Nku5ktyW3fqi26o07AswyNuWK4p9Owt1fJ8zJODM-2bDITfjKaj56SeHdw73FfC40m5a6foEcoDbosCO56JIoYudFtY6FPIt_3QOPKjda_HrMRfQ0200X02JnLIZkM3qw8LKwaG32sl87DNVq7Yz5dde4fxKr1vRRl4MuDi0xqD-0KPCDXqOHswZ_WLNcFupRVU5bnH5G0mF4.DxkaaA.9ixJAX-tG5ZUK1vMXohoi1ZUvq4
Cf-Connecting-Ip: 185.67.237.178
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31141)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31141)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by carmandor

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'db69caa6837efbe8f225171f32780f3d51547108667', '_ga': 'GA1.2.1023975177.1547108675', '_gid': 'GA1.2.684814235.1547108675', 'session': '.eJx9UctuwjAQ_Jc9R1UCJo65tYAaaFUailRoVUVWsgRDHEe2U17i3-sgUQ6Vepyd9czs-ARpjVryCisLfasb9IDnUlTQX_HSOJSjFFLlNyxMpnSeCjcCwkISdKIgpJSybsh8Ch78w1Rp0YgyvzqVqigwbxMYVV0UO7TLPJC2UGljUFdcohPLeBsxV9ppKN7YdSc1ltuW-t6_0CyOYnvkm8E03I2b98ZnH8Nku5ktyW3fqi26o07AswyNuWK4p9Owt1fJ8zJODM-2bDITfjKaj56SeHdw73FfC40m5a6foEcoDbosCO56JIoYudFtY6FPIt_3QOPKjda_HrMRfQ0200X02JnLIZkM3qw8LKwaG32sl87DNVq7Yz5dde4fxKr1vRRl4MuDi0xqD-0KPCDXqOHswZ_WLNcFupRVU5bnH5G0mF4.Dxka5A.V5zsfNp8iyiU4kMgofNxfsGDyeM'}
            Endpoint: person_status
            View Args: {}
            Person: 496412816777936907
            Referrer: https://pennydreadfulmagic.com/league/current/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: IT
X-Forwarded-For: 185.67.237.178, 172.68.198.48
Cf-Ray: 4971125ad8286f30-FCO
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
Accept: */*
Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3
Referer: https://pennydreadfulmagic.com/league/current/
X-Requested-With: XMLHttpRequest
Cookie: __cfduid=db69caa6837efbe8f225171f32780f3d51547108667; _ga=GA1.2.1023975177.1547108675; _gid=GA1.2.684814235.1547108675; session=.eJx9UctuwjAQ_Jc9R1UCJo65tYAaaFUailRoVUVWsgRDHEe2U17i3-sgUQ6Vepyd9czs-ARpjVryCisLfasb9IDnUlTQX_HSOJSjFFLlNyxMpnSeCjcCwkISdKIgpJSybsh8Ch78w1Rp0YgyvzqVqigwbxMYVV0UO7TLPJC2UGljUFdcohPLeBsxV9ppKN7YdSc1ltuW-t6_0CyOYnvkm8E03I2b98ZnH8Nku5ktyW3fqi26o07AswyNuWK4p9Owt1fJ8zJODM-2bDITfjKaj56SeHdw73FfC40m5a6foEcoDbosCO56JIoYudFtY6FPIt_3QOPKjda_HrMRfQ0200X02JnLIZkM3qw8LKwaG32sl87DNVq7Yz5dde4fxKr1vRRl4MuDi0xqD-0KPCDXqOHswZ_WLNcFupRVU5bnH5G0mF4.Dxka5A.V5zsfNp8iyiU4kMgofNxfsGDyeM
Cf-Connecting-Ip: 185.67.237.178
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31141)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31141)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by carmandor

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'db69caa6837efbe8f225171f32780f3d51547108667', '_ga': 'GA1.2.1023975177.1547108675', '_gid': 'GA1.2.684814235.1547108675', 'session': '.eJx9UctuwjAQ_Jc9R1UCJo65tYAaaFUailRoVUVWsgRDHEe2U17i3-sgUQ6Vepyd9czs-ARpjVryCisLfasb9IDnUlTQX_HSOJSjFFLlNyxMpnSeCjcCwkISdKIgpJSybsh8Ch78w1Rp0YgyvzqVqigwbxMYVV0UO7TLPJC2UGljUFdcohPLeBsxV9ppKN7YdSc1ltuW-t6_0CyOYnvkm8E03I2b98ZnH8Nku5ktyW3fqi26o07AswyNuWK4p9Owt1fJ8zJODM-2bDITfjKaj56SeHdw73FfC40m5a6foEcoDbosCO56JIoYudFtY6FPIt_3QOPKjda_HrMRfQ0200X02JnLIZkM3qw8LKwaG32sl87DNVq7Yz5dde4fxKr1vRRl4MuDi0xqD-0KPCDXqOHswZ_WLNcFupRVU5bnH5G0mF4.Dxka7A.OrbS3DT2piTbg-aBRcDfqQxaztI', '_gat_gtag_UA_109131120_1': '1'}
            Endpoint: person_status
            View Args: {}
            Person: 496412816777936907
            Referrer: https://pennydreadfulmagic.com/league/current/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: IT
X-Forwarded-For: 185.67.237.178, 172.68.198.48
Cf-Ray: 4971128c7bb16f30-FCO
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
Accept: */*
Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3
Referer: https://pennydreadfulmagic.com/league/current/
X-Requested-With: XMLHttpRequest
Cookie: __cfduid=db69caa6837efbe8f225171f32780f3d51547108667; _ga=GA1.2.1023975177.1547108675; _gid=GA1.2.684814235.1547108675; session=.eJx9UctuwjAQ_Jc9R1UCJo65tYAaaFUailRoVUVWsgRDHEe2U17i3-sgUQ6Vepyd9czs-ARpjVryCisLfasb9IDnUlTQX_HSOJSjFFLlNyxMpnSeCjcCwkISdKIgpJSybsh8Ch78w1Rp0YgyvzqVqigwbxMYVV0UO7TLPJC2UGljUFdcohPLeBsxV9ppKN7YdSc1ltuW-t6_0CyOYnvkm8E03I2b98ZnH8Nku5ktyW3fqi26o07AswyNuWK4p9Owt1fJ8zJODM-2bDITfjKaj56SeHdw73FfC40m5a6foEcoDbosCO56JIoYudFtY6FPIt_3QOPKjda_HrMRfQ0200X02JnLIZkM3qw8LKwaG32sl87DNVq7Yz5dde4fxKr1vRRl4MuDi0xqD-0KPCDXqOHswZ_WLNcFupRVU5bnH5G0mF4.Dxka7A.OrbS3DT2piTbg-aBRcDfqQxaztI; _gat_gtag_UA_109131120_1=1
Cf-Connecting-Ip: 185.67.237.178
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31141)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31141)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by carmandor

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'db69caa6837efbe8f225171f32780f3d51547108667', '_ga': 'GA1.2.1023975177.1547108675', '_gid': 'GA1.2.684814235.1547108675', 'session': '.eJx9UctuwjAQ_Jc9R1UCJo65tYAaaFUailRoVUVWsgRDHEe2U17i3-sgUQ6Vepyd9czs-ARpjVryCisLfasb9IDnUlTQX_HSOJSjFFLlNyxMpnSeCjcCwkISdKIgpJSybsh8Ch78w1Rp0YgyvzqVqigwbxMYVV0UO7TLPJC2UGljUFdcohPLeBsxV9ppKN7YdSc1ltuW-t6_0CyOYnvkm8E03I2b98ZnH8Nku5ktyW3fqi26o07AswyNuWK4p9Owt1fJ8zJODM-2bDITfjKaj56SeHdw73FfC40m5a6foEcoDbosCO56JIoYudFtY6FPIt_3QOPKjda_HrMRfQ0200X02JnLIZkM3qw8LKwaG32sl87DNVq7Yz5dde4fxKr1vRRl4MuDi0xqD-0KPCDXqOHswZ_WLNcFupRVU5bnH5G0mF4.DxkcKg.M5j-ABGr0kyleObJCI-b_iek9yI'}
            Endpoint: person_status
            View Args: {}
            Person: 496412816777936907
            Referrer: https://pennydreadfulmagic.com/league/current/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: IT
X-Forwarded-For: 185.67.237.178, 172.68.198.48
Cf-Ray: 49711a49eef46f1e-FCO
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
Accept: */*
Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3
Referer: https://pennydreadfulmagic.com/league/current/
X-Requested-With: XMLHttpRequest
Cookie: __cfduid=db69caa6837efbe8f225171f32780f3d51547108667; _ga=GA1.2.1023975177.1547108675; _gid=GA1.2.684814235.1547108675; session=.eJx9UctuwjAQ_Jc9R1UCJo65tYAaaFUailRoVUVWsgRDHEe2U17i3-sgUQ6Vepyd9czs-ARpjVryCisLfasb9IDnUlTQX_HSOJSjFFLlNyxMpnSeCjcCwkISdKIgpJSybsh8Ch78w1Rp0YgyvzqVqigwbxMYVV0UO7TLPJC2UGljUFdcohPLeBsxV9ppKN7YdSc1ltuW-t6_0CyOYnvkm8E03I2b98ZnH8Nku5ktyW3fqi26o07AswyNuWK4p9Owt1fJ8zJODM-2bDITfjKaj56SeHdw73FfC40m5a6foEcoDbosCO56JIoYudFtY6FPIt_3QOPKjda_HrMRfQ0200X02JnLIZkM3qw8LKwaG32sl87DNVq7Yz5dde4fxKr1vRRl4MuDi0xqD-0KPCDXqOHswZ_WLNcFupRVU5bnH5G0mF4.DxkcKg.M5j-ABGr0kyleObJCI-b_iek9yI
Cf-Connecting-Ip: 185.67.237.178
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31141)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31141)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by carmandor

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'db69caa6837efbe8f225171f32780f3d51547108667', '_ga': 'GA1.2.1023975177.1547108675', '_gid': 'GA1.2.684814235.1547108675', 'session': '.eJx9UctuwjAQ_Jc9R1UCJo65tYAaaFUailRoVUVWsgRDHEe2U17i3-sgUQ6Vepyd9czs-ARpjVryCisLfasb9IDnUlTQX_HSOJSjFFLlNyxMpnSeCjcCwkISdKIgpJSybsh8Ch78w1Rp0YgyvzqVqigwbxMYVV0UO7TLPJC2UGljUFdcohPLeBsxV9ppKN7YdSc1ltuW-t6_0CyOYnvkm8E03I2b98ZnH8Nku5ktyW3fqi26o07AswyNuWK4p9Owt1fJ8zJODM-2bDITfjKaj56SeHdw73FfC40m5a6foEcoDbosCO56JIoYudFtY6FPIt_3QOPKjda_HrMRfQ0200X02JnLIZkM3qw8LKwaG32sl87DNVq7Yz5dde4fxKr1vRRl4MuDi0xqD-0KPCDXqOHswZ_WLNcFupRVU5bnH5G0mF4.DxkcMQ.Ic5tRtSTBRKwtVtgAXw85R0k0b0', '_gat_gtag_UA_109131120_1': '1'}
            Endpoint: person_status
            View Args: {}
            Person: 496412816777936907
            Referrer: https://pennydreadfulmagic.com/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: IT
X-Forwarded-For: 185.67.237.178, 172.68.198.48
Cf-Ray: 49711a7699f56f1e-FCO
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
Accept: */*
Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3
Referer: https://pennydreadfulmagic.com/
X-Requested-With: XMLHttpRequest
Cookie: __cfduid=db69caa6837efbe8f225171f32780f3d51547108667; _ga=GA1.2.1023975177.1547108675; _gid=GA1.2.684814235.1547108675; session=.eJx9UctuwjAQ_Jc9R1UCJo65tYAaaFUailRoVUVWsgRDHEe2U17i3-sgUQ6Vepyd9czs-ARpjVryCisLfasb9IDnUlTQX_HSOJSjFFLlNyxMpnSeCjcCwkISdKIgpJSybsh8Ch78w1Rp0YgyvzqVqigwbxMYVV0UO7TLPJC2UGljUFdcohPLeBsxV9ppKN7YdSc1ltuW-t6_0CyOYnvkm8E03I2b98ZnH8Nku5ktyW3fqi26o07AswyNuWK4p9Owt1fJ8zJODM-2bDITfjKaj56SeHdw73FfC40m5a6foEcoDbosCO56JIoYudFtY6FPIt_3QOPKjda_HrMRfQ0200X02JnLIZkM3qw8LKwaG32sl87DNVq7Yz5dde4fxKr1vRRl4MuDi0xqD-0KPCDXqOHswZ_WLNcFupRVU5bnH5G0mF4.DxkcMQ.Ic5tRtSTBRKwtVtgAXw85R0k0b0; _gat_gtag_UA_109131120_1=1
Cf-Connecting-Ip: 185.67.237.178
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31141)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31141)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by carmandor

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'db69caa6837efbe8f225171f32780f3d51547108667', '_ga': 'GA1.2.1023975177.1547108675', '_gid': 'GA1.2.684814235.1547108675', 'session': '.eJx9UctuwjAQ_Jc9R1UCJo65tYAaaFUailRoVUVWsgRDHEe2U17i3-sgUQ6Vepyd9czs-ARpjVryCisLfasb9IDnUlTQX_HSOJSjFFLlNyxMpnSeCjcCwkISdKIgpJSybsh8Ch78w1Rp0YgyvzqVqigwbxMYVV0UO7TLPJC2UGljUFdcohPLeBsxV9ppKN7YdSc1ltuW-t6_0CyOYnvkm8E03I2b98ZnH8Nku5ktyW3fqi26o07AswyNuWK4p9Owt1fJ8zJODM-2bDITfjKaj56SeHdw73FfC40m5a6foEcoDbosCO56JIoYudFtY6FPIt_3QOPKjda_HrMRfQ0200X02JnLIZkM3qw8LKwaG32sl87DNVq7Yz5dde4fxKr1vRRl4MuDi0xqD-0KPCDXqOHswZ_WLNcFupRVU5bnH5G0mF4.DxkcPg.8-r2HScL1-V3P9R-IPZ2whfpkzM', '_gat_gtag_UA_109131120_1': '1'}
            Endpoint: person_status
            View Args: {}
            Person: 496412816777936907
            Referrer: https://pennydreadfulmagic.com/resources/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: IT
X-Forwarded-For: 185.67.237.178, 172.68.198.48
Cf-Ray: 49711ac98ac86f1e-FCO
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
Accept: */*
Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3
Referer: https://pennydreadfulmagic.com/resources/
X-Requested-With: XMLHttpRequest
Cookie: __cfduid=db69caa6837efbe8f225171f32780f3d51547108667; _ga=GA1.2.1023975177.1547108675; _gid=GA1.2.684814235.1547108675; session=.eJx9UctuwjAQ_Jc9R1UCJo65tYAaaFUailRoVUVWsgRDHEe2U17i3-sgUQ6Vepyd9czs-ARpjVryCisLfasb9IDnUlTQX_HSOJSjFFLlNyxMpnSeCjcCwkISdKIgpJSybsh8Ch78w1Rp0YgyvzqVqigwbxMYVV0UO7TLPJC2UGljUFdcohPLeBsxV9ppKN7YdSc1ltuW-t6_0CyOYnvkm8E03I2b98ZnH8Nku5ktyW3fqi26o07AswyNuWK4p9Owt1fJ8zJODM-2bDITfjKaj56SeHdw73FfC40m5a6foEcoDbosCO56JIoYudFtY6FPIt_3QOPKjda_HrMRfQ0200X02JnLIZkM3qw8LKwaG32sl87DNVq7Yz5dde4fxKr1vRRl4MuDi0xqD-0KPCDXqOHswZ_WLNcFupRVU5bnH5G0mF4.DxkcPg.8-r2HScL1-V3P9R-IPZ2whfpkzM; _gat_gtag_UA_109131120_1=1
Cf-Connecting-Ip: 185.67.237.178
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31141)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31142)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by hairyfroglegs

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'_ga': 'GA1.2.2095395922.1517631367', '__cfduid': 'de05e29d5b63f99c7fcf42f5bc5748aed1530064726', 'hide_intro': 'True', '_gid': 'GA1.2.1562510254.1547069625', 'session': '.eJx9UV1rwjAU_S95LiNJP_XNlWlhoLiB041RgrmNwTZpkxSt4n9fFJywhz2ec2_OuefkjMoWTMMUKIfGzvQQIMYbqdC4YrX1iEMjG80fWNqtNryUnkJhGOERwVFKCR1FJCQhCtA_E1WKXtb87lRrIYBfL7Ba3RRjEgWocUKXvQWjWANea8ekGSqjRQ3CehnNerejpXXMXcdknru608tsIz66l-n6baUmOVvg5Wx64KvHvtN78LnOiG23YO0do0OR2WzSn5rT8YiL2BTvkM5yyiXHFZH-PRxbacCWzFdE4jCNM0wpfUp9qmSUPObX1hIcZRgHyEDlqd2vyac-JPHcLTb5vu3WlpH5QF38GiUJK_rOm_hWW5_my9fn_0JWg-duZVn0HaCbTOmG6wp6BmbAoEuA_jbnmBHgr1R9XV9-AJ_4maE.DxknyA.9b9chfFNX6gWiMc0zEY4gYqAXsM'}
            Endpoint: person_status
            View Args: {}
            Person: 334091047212941313
            Referrer: https://pennydreadfulmagic.com/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: 76.177.180.138, 162.158.79.67
Cf-Ray: 497162e88bbdc1b3-IAD
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Referer: https://pennydreadfulmagic.com/
Accept-Language: en-US,en;q=0.9
Cookie: _ga=GA1.2.2095395922.1517631367; __cfduid=de05e29d5b63f99c7fcf42f5bc5748aed1530064726; hide_intro=True; _gid=GA1.2.1562510254.1547069625; session=.eJx9UV1rwjAU_S95LiNJP_XNlWlhoLiB041RgrmNwTZpkxSt4n9fFJywhz2ec2_OuefkjMoWTMMUKIfGzvQQIMYbqdC4YrX1iEMjG80fWNqtNryUnkJhGOERwVFKCR1FJCQhCtA_E1WKXtb87lRrIYBfL7Ba3RRjEgWocUKXvQWjWANea8ekGSqjRQ3CehnNerejpXXMXcdknru608tsIz66l-n6baUmOVvg5Wx64KvHvtN78LnOiG23YO0do0OR2WzSn5rT8YiL2BTvkM5yyiXHFZH-PRxbacCWzFdE4jCNM0wpfUp9qmSUPObX1hIcZRgHyEDlqd2vyac-JPHcLTb5vu3WlpH5QF38GiUJK_rOm_hWW5_my9fn_0JWg-duZVn0HaCbTOmG6wp6BmbAoEuA_jbnmBHgr1R9XV9-AJ_4maE.DxknyA.9b9chfFNX6gWiMc0zEY4gYqAXsM
Cf-Connecting-Ip: 76.177.180.138
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31142)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31142)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by hairyfroglegs

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'_ga': 'GA1.2.2095395922.1517631367', '__cfduid': 'de05e29d5b63f99c7fcf42f5bc5748aed1530064726', 'hide_intro': 'True', '_gid': 'GA1.2.1562510254.1547069625', '_gat_gtag_UA_109131120_1': '1', 'session': '.eJx9UV1rwjAU_S95LiNJP_XNlWlhoLiB041RgrmNwTZpkxSt4n9fFJywhz2ec2_OuefkjMoWTMMUKIfGzvQQIMYbqdC4YrX1iEMjG80fWNqtNryUnkJhGOERwVFKCR1FJCQhCtA_E1WKXtb87lRrIYBfL7Ba3RRjEgWocUKXvQWjWANea8ekGSqjRQ3CehnNerejpXXMXcdknru608tsIz66l-n6baUmOVvg5Wx64KvHvtN78LnOiG23YO0do0OR2WzSn5rT8YiL2BTvkM5yyiXHFZH-PRxbacCWzFdE4jCNM0wpfUp9qmSUPObX1hIcZRgHyEDlqd2vyac-JPHcLTb5vu3WlpH5QF38GiUJK_rOm_hWW5_my9fn_0JWg-duZVn0HaCbTOmG6wp6BmbAoEuA_jbnmBHgr1R9XV9-AJ_4maE.Dxkn4Q.pSFjNh_KzNk7RuiLWQMQWOj1gzk'}
            Endpoint: person_status
            View Args: {}
            Person: 334091047212941313
            Referrer: https://pennydreadfulmagic.com/league/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: 76.177.180.138, 162.158.79.67
Cf-Ray: 497163805c6ac1b3-IAD
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Referer: https://pennydreadfulmagic.com/league/
Accept-Language: en-US,en;q=0.9
Cookie: _ga=GA1.2.2095395922.1517631367; __cfduid=de05e29d5b63f99c7fcf42f5bc5748aed1530064726; hide_intro=True; _gid=GA1.2.1562510254.1547069625; _gat_gtag_UA_109131120_1=1; session=.eJx9UV1rwjAU_S95LiNJP_XNlWlhoLiB041RgrmNwTZpkxSt4n9fFJywhz2ec2_OuefkjMoWTMMUKIfGzvQQIMYbqdC4YrX1iEMjG80fWNqtNryUnkJhGOERwVFKCR1FJCQhCtA_E1WKXtb87lRrIYBfL7Ba3RRjEgWocUKXvQWjWANea8ekGSqjRQ3CehnNerejpXXMXcdknru608tsIz66l-n6baUmOVvg5Wx64KvHvtN78LnOiG23YO0do0OR2WzSn5rT8YiL2BTvkM5yyiXHFZH-PRxbacCWzFdE4jCNM0wpfUp9qmSUPObX1hIcZRgHyEDlqd2vyac-JPHcLTb5vu3WlpH5QF38GiUJK_rOm_hWW5_my9fn_0JWg-duZVn0HaCbTOmG6wp6BmbAoEuA_jbnmBHgr1R9XV9-AJ_4maE.Dxkn4Q.pSFjNh_KzNk7RuiLWQMQWOj1gzk
Cf-Connecting-Ip: 76.177.180.138
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31142)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31123)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by forgetti

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'df4304fd25e5bf09ee307ffe3e697c9951516347108', '_ga': 'GA1.2.324696123.1538720631', '_gid': 'GA1.2.1397731460.1545268354', 'deck_id': '31123', 'session': '.eJx9kctOwzAQRf9l1hFyniTdUQRqeSkUEGkRikw8SU0du7Wdqg_133EqlUoskFczd3yv53gP5RJ1SyVKCwOrO_SAspZLGNRUGFcxbHmr2LnmplKaldy1wE-CKPAvUxKEcRaFWZiCB_8osmw6LtgpSaimQda_wCh5dAz91IPWNqrsDGpJW3RetdINWsudg6KdnQelsdT2ys0TyTEfhfqeZXW6eXyercXo6j1fkYIu2HneqgW6lfZAqwqNOdWwuRb-_FVNd0mtRFet3l5MHn8FsqHbIpm4-7hZco2mpI6OH0dRnJCI-Bdx4E58lnteTkkJ8UBj7Vrz34yI7GZTPxvePYwXBf2O06q-ZZNxVRG9ZluX4Xgu3TIfDpz7BV73vSMmA58eHG1Ku-1HYIhUo4aDB3-ZWdozgoHshDj8ACEZl-Q.Dxk5EQ.6dq1eq_-YdPebIAW8rahaLTHtVc'}
            Endpoint: person_status
            View Args: {}
            Person: 162421780235943938
            Referrer: https://pennydreadfulmagic.com/decks/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: 2601:204:d97f:9600:85b7:3ddd:2f67:7d87, 172.69.142.48
Cf-Ray: 4971ceeca996b52e-SMF
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Referer: https://pennydreadfulmagic.com/decks/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=df4304fd25e5bf09ee307ffe3e697c9951516347108; _ga=GA1.2.324696123.1538720631; _gid=GA1.2.1397731460.1545268354; deck_id=31123; session=.eJx9kctOwzAQRf9l1hFyniTdUQRqeSkUEGkRikw8SU0du7Wdqg_133EqlUoskFczd3yv53gP5RJ1SyVKCwOrO_SAspZLGNRUGFcxbHmr2LnmplKaldy1wE-CKPAvUxKEcRaFWZiCB_8osmw6LtgpSaimQda_wCh5dAz91IPWNqrsDGpJW3RetdINWsudg6KdnQelsdT2ys0TyTEfhfqeZXW6eXyercXo6j1fkYIu2HneqgW6lfZAqwqNOdWwuRb-_FVNd0mtRFet3l5MHn8FsqHbIpm4-7hZco2mpI6OH0dRnJCI-Bdx4E58lnteTkkJ8UBj7Vrz34yI7GZTPxvePYwXBf2O06q-ZZNxVRG9ZluX4Xgu3TIfDpz7BV73vSMmA58eHG1Ku-1HYIhUo4aDB3-ZWdozgoHshDj8ACEZl-Q.Dxk5EQ.6dq1eq_-YdPebIAW8rahaLTHtVc
Cf-Connecting-Ip: 2601:204:d97f:9600:85b7:3ddd:2f67:7d87
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31123)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31123)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by forgetti

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'df4304fd25e5bf09ee307ffe3e697c9951516347108', '_ga': 'GA1.2.324696123.1538720631', '_gid': 'GA1.2.1397731460.1545268354', 'deck_id': '31123', '_gat_gtag_UA_109131120_1': '1', 'session': '.eJx9kctOwzAQRf9l1hFyniTdUQRqeSkUEGkRikw8SU0du7Wdqg_133EqlUoskFczd3yv53gP5RJ1SyVKCwOrO_SAspZLGNRUGFcxbHmr2LnmplKaldy1wE-CKPAvUxKEcRaFWZiCB_8osmw6LtgpSaimQda_wCh5dAz91IPWNqrsDGpJW3RetdINWsudg6KdnQelsdT2ys0TyTEfhfqeZXW6eXyercXo6j1fkYIu2HneqgW6lfZAqwqNOdWwuRb-_FVNd0mtRFet3l5MHn8FsqHbIpm4-7hZco2mpI6OH0dRnJCI-Bdx4E58lnteTkkJ8UBj7Vrz34yI7GZTPxvePYwXBf2O06q-ZZNxVRG9ZluX4Xgu3TIfDpz7BV73vSMmA58eHG1Ku-1HYIhUo4aDB3-ZWdozgoHshDj8ACEZl-Q.Dxk5HQ.RQjBfKJmQJKKes9yBCUDSLGgsHM'}
            Endpoint: person_status
            View Args: {}
            Person: 162421780235943938
            Referrer: https://pennydreadfulmagic.com/archetypes/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: 2601:204:d97f:9600:85b7:3ddd:2f67:7d87, 172.69.142.48
Cf-Ray: 4971cf39beb0b52e-SMF
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Referer: https://pennydreadfulmagic.com/archetypes/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=df4304fd25e5bf09ee307ffe3e697c9951516347108; _ga=GA1.2.324696123.1538720631; _gid=GA1.2.1397731460.1545268354; deck_id=31123; _gat_gtag_UA_109131120_1=1; session=.eJx9kctOwzAQRf9l1hFyniTdUQRqeSkUEGkRikw8SU0du7Wdqg_133EqlUoskFczd3yv53gP5RJ1SyVKCwOrO_SAspZLGNRUGFcxbHmr2LnmplKaldy1wE-CKPAvUxKEcRaFWZiCB_8osmw6LtgpSaimQda_wCh5dAz91IPWNqrsDGpJW3RetdINWsudg6KdnQelsdT2ys0TyTEfhfqeZXW6eXyercXo6j1fkYIu2HneqgW6lfZAqwqNOdWwuRb-_FVNd0mtRFet3l5MHn8FsqHbIpm4-7hZco2mpI6OH0dRnJCI-Bdx4E58lnteTkkJ8UBj7Vrz34yI7GZTPxvePYwXBf2O06q-ZZNxVRG9ZluX4Xgu3TIfDpz7BV73vSMmA58eHG1Ku-1HYIhUo4aDB3-ZWdozgoHshDj8ACEZl-Q.Dxk5HQ.RQjBfKJmQJKKes9yBCUDSLGgsHM
Cf-Connecting-Ip: 2601:204:d97f:9600:85b7:3ddd:2f67:7d87
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31123)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31123)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by forgetti

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'df4304fd25e5bf09ee307ffe3e697c9951516347108', '_ga': 'GA1.2.324696123.1538720631', '_gid': 'GA1.2.1397731460.1545268354', 'deck_id': '31123', 'session': '.eJx9kctOwzAQRf9l1hFyniTdUQRqeSkUEGkRikw8SU0du7Wdqg_133EqlUoskFczd3yv53gP5RJ1SyVKCwOrO_SAspZLGNRUGFcxbHmr2LnmplKaldy1wE-CKPAvUxKEcRaFWZiCB_8osmw6LtgpSaimQda_wCh5dAz91IPWNqrsDGpJW3RetdINWsudg6KdnQelsdT2ys0TyTEfhfqeZXW6eXyercXo6j1fkYIu2HneqgW6lfZAqwqNOdWwuRb-_FVNd0mtRFet3l5MHn8FsqHbIpm4-7hZco2mpI6OH0dRnJCI-Bdx4E58lnteTkkJ8UBj7Vrz34yI7GZTPxvePYwXBf2O06q-ZZNxVRG9ZluX4Xgu3TIfDpz7BV73vSMmA58eHG1Ku-1HYIhUo4aDB3-ZWdozgoHshDj8ACEZl-Q.Dxk5Yg.es22K15UqNWpLY02StvRxO5DOdo'}
            Endpoint: person_status
            View Args: {}
            Person: 162421780235943938
            Referrer: https://pennydreadfulmagic.com/people/forgetti/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: 2601:204:d97f:9600:85b7:3ddd:2f67:7d87, 172.69.142.48
Cf-Ray: 4971d0e9ea05b52e-SMF
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Referer: https://pennydreadfulmagic.com/people/forgetti/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=df4304fd25e5bf09ee307ffe3e697c9951516347108; _ga=GA1.2.324696123.1538720631; _gid=GA1.2.1397731460.1545268354; deck_id=31123; session=.eJx9kctOwzAQRf9l1hFyniTdUQRqeSkUEGkRikw8SU0du7Wdqg_133EqlUoskFczd3yv53gP5RJ1SyVKCwOrO_SAspZLGNRUGFcxbHmr2LnmplKaldy1wE-CKPAvUxKEcRaFWZiCB_8osmw6LtgpSaimQda_wCh5dAz91IPWNqrsDGpJW3RetdINWsudg6KdnQelsdT2ys0TyTEfhfqeZXW6eXyercXo6j1fkYIu2HneqgW6lfZAqwqNOdWwuRb-_FVNd0mtRFet3l5MHn8FsqHbIpm4-7hZco2mpI6OH0dRnJCI-Bdx4E58lnteTkkJ8UBj7Vrz34yI7GZTPxvePYwXBf2O06q-ZZNxVRG9ZluX4Xgu3TIfDpz7BV73vSMmA58eHG1Ku-1HYIhUo4aDB3-ZWdozgoHshDj8ACEZl-Q.Dxk5Yg.es22K15UqNWpLY02StvRxO5DOdo
Cf-Connecting-Ip: 2601:204:d97f:9600:85b7:3ddd:2f67:7d87
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31123)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31139)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by gierlord

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'session': '.eJx9UctuwjAQ_Jc9R5VD3txaCSkqFJCISpuqiky8SdwmNrUdHkX8ex0kyqFSjzOzntkdn6DYouqoQGFgbFSPDlDWcQHjirbaIoYd7yS7Ya5LqVjBLQVe4oZB7PnEJXGSjIKRDw78o4ii7nnLrkmtrGtkwwZaioujR-LAgc7Usug1KkE7tGY1R9XaUGshaW-aUaENNYNyJC_fFV0_lfv7PA3yJoi7ZJI3c450spve5o38RHvTCWhZotZXDInuV_Pl_BXTR49XDc9WSJ6P5WLGa5lF9j0etlyhLqitxw38MPRIFCd3UeyGkX-Th8JC4seEOKCwslTzm7GMSPOVLUW62Olkvz6Em5y1VTr7mG5KltkMW-jWHvNmm7PfwKuj5S49aXh34GJTmOMwAg9IFSo4O_CnNENVjXZL0bft-QdseZjd.DxlDsg.-lOkaIVE_urXouFIFWt20nJu-yA', '_gid': 'GA1.2.2028865442.1545843175', '_ga': 'GA1.2.168962006.1544993212', '__cfduid': 'ddf569c574190fa4820262612b81fec821544993208'}
            Endpoint: person_status
            View Args: {}
            Person: 391658340108992524
            Referrer: https://pennydreadfulmagic.com/bugs/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: DE
X-Forwarded-For: 95.223.252.65, 162.158.90.26
Cf-Ray: 49721171ae9c63df-FRA
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Referer: https://pennydreadfulmagic.com/bugs/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134
Accept: */*
X-Requested-With: XMLHttpRequest
Accept-Language: de-DE
Cookie: session=.eJx9UctuwjAQ_Jc9R5VD3txaCSkqFJCISpuqiky8SdwmNrUdHkX8ex0kyqFSjzOzntkdn6DYouqoQGFgbFSPDlDWcQHjirbaIoYd7yS7Ya5LqVjBLQVe4oZB7PnEJXGSjIKRDw78o4ii7nnLrkmtrGtkwwZaioujR-LAgc7Usug1KkE7tGY1R9XaUGshaW-aUaENNYNyJC_fFV0_lfv7PA3yJoi7ZJI3c450spve5o38RHvTCWhZotZXDInuV_Pl_BXTR49XDc9WSJ6P5WLGa5lF9j0etlyhLqitxw38MPRIFCd3UeyGkX-Th8JC4seEOKCwslTzm7GMSPOVLUW62Olkvz6Em5y1VTr7mG5KltkMW-jWHvNmm7PfwKuj5S49aXh34GJTmOMwAg9IFSo4O_CnNENVjXZL0bft-QdseZjd.DxlDsg.-lOkaIVE_urXouFIFWt20nJu-yA; _gid=GA1.2.2028865442.1545843175; _ga=GA1.2.168962006.1544993212; __cfduid=ddf569c574190fa4820262612b81fec821544993208
Cf-Connecting-Ip: 95.223.252.65
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31139)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31135)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by paupery_poppery

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'd2f8d2bd221ff00370c90d49d4793f05d1541586381', '_ga': 'GA1.2.26037787.1541586396', 'hide_intro': 'True', 'deck_id': '31135', '_gid': 'GA1.2.650363406.1547153480', 'session': '.eJx9UV1PwjAU_S99XsxWtrHxpkKQTEIiKkZjmrqVrdK1sx9jk_DfvSNBHkx8au69p-fcc-4BkYbpmkomLZpY7ZiHaFFziSZbKgxUBat5rYpLzU2udEE4tBBO4nAcJjGO0iTEOMIp8tA_E0lKx0VxVhKqLFkxbGCUPDEGfhR4qLalIs4wLWnNgKyhDjA9aVQzvMCkqLMVJsZSOwDadvo0fvheljzL1Vcz_3QrZ13Uytl9v15c8FbtGFg7IJrnzJhzjUbrTnwsptks77Jwk6zm_nI_qzYmraSY7uE_6xqumSEUUgqiECcBGPOv0jga4Xh0mQ_BxX6Y-L6HNNtCq_oV6Vsp6BMe73Xev153rnx83t3p-e3yJetFBSIQbANu3iBBOAffDkZPeRn07qETDbH9AEE3jGqm0dFDf8KzVJcM1pROiOMPQs2dfA.DxlFxw.dQ6L4fjhmJFRjHjEjlDYSyzAw2U'}
            Endpoint: person_status
            View Args: {}
            Person: 286474862598422529
            Referrer: https://pennydreadfulmagic.com/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: BR
X-Forwarded-For: 138.99.113.123, 162.158.122.188
Cf-Ray: 49721e6ace3cc86d-MIA
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Referer: https://pennydreadfulmagic.com/
Accept-Language: en-US,en;q=0.9,pt-BR;q=0.8,pt;q=0.7
Cookie: __cfduid=d2f8d2bd221ff00370c90d49d4793f05d1541586381; _ga=GA1.2.26037787.1541586396; hide_intro=True; deck_id=31135; _gid=GA1.2.650363406.1547153480; session=.eJx9UV1PwjAU_S99XsxWtrHxpkKQTEIiKkZjmrqVrdK1sx9jk_DfvSNBHkx8au69p-fcc-4BkYbpmkomLZpY7ZiHaFFziSZbKgxUBat5rYpLzU2udEE4tBBO4nAcJjGO0iTEOMIp8tA_E0lKx0VxVhKqLFkxbGCUPDEGfhR4qLalIs4wLWnNgKyhDjA9aVQzvMCkqLMVJsZSOwDadvo0fvheljzL1Vcz_3QrZ13Uytl9v15c8FbtGFg7IJrnzJhzjUbrTnwsptks77Jwk6zm_nI_qzYmraSY7uE_6xqumSEUUgqiECcBGPOv0jga4Xh0mQ_BxX6Y-L6HNNtCq_oV6Vsp6BMe73Xev153rnx83t3p-e3yJetFBSIQbANu3iBBOAffDkZPeRn07qETDbH9AEE3jGqm0dFDf8KzVJcM1pROiOMPQs2dfA.DxlFxw.dQ6L4fjhmJFRjHjEjlDYSyzAw2U
Cf-Connecting-Ip: 138.99.113.123
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31135)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31135)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by paupery_poppery

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'd2f8d2bd221ff00370c90d49d4793f05d1541586381', '_ga': 'GA1.2.26037787.1541586396', 'hide_intro': 'True', 'deck_id': '31135', '_gid': 'GA1.2.650363406.1547153480', '_gat_gtag_UA_109131120_1': '1', 'session': '.eJx9UV1PwjAU_S99XsxWtrHxpkKQTEIiKkZjmrqVrdK1sx9jk_DfvSNBHkx8au69p-fcc-4BkYbpmkomLZpY7ZiHaFFziSZbKgxUBat5rYpLzU2udEE4tBBO4nAcJjGO0iTEOMIp8tA_E0lKx0VxVhKqLFkxbGCUPDEGfhR4qLalIs4wLWnNgKyhDjA9aVQzvMCkqLMVJsZSOwDadvo0fvheljzL1Vcz_3QrZ13Uytl9v15c8FbtGFg7IJrnzJhzjUbrTnwsptks77Jwk6zm_nI_qzYmraSY7uE_6xqumSEUUgqiECcBGPOv0jga4Xh0mQ_BxX6Y-L6HNNtCq_oV6Vsp6BMe73Xev153rnx83t3p-e3yJetFBSIQbANu3iBBOAffDkZPeRn07qETDbH9AEE3jGqm0dFDf8KzVJcM1pROiOMPQs2dfA.DxlFzw.u69IMJZ4ArgFPNc9yfRSx-oVR9M'}
            Endpoint: person_status
            View Args: {}
            Person: 286474862598422529
            Referrer: https://pennydreadfulmagic.com/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: BR
X-Forwarded-For: 138.99.113.123, 162.158.122.188
Cf-Ray: 49721e958f41c86d-MIA
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Referer: https://pennydreadfulmagic.com/
Accept-Language: en-US,en;q=0.9,pt-BR;q=0.8,pt;q=0.7
Cookie: __cfduid=d2f8d2bd221ff00370c90d49d4793f05d1541586381; _ga=GA1.2.26037787.1541586396; hide_intro=True; deck_id=31135; _gid=GA1.2.650363406.1547153480; _gat_gtag_UA_109131120_1=1; session=.eJx9UV1PwjAU_S99XsxWtrHxpkKQTEIiKkZjmrqVrdK1sx9jk_DfvSNBHkx8au69p-fcc-4BkYbpmkomLZpY7ZiHaFFziSZbKgxUBat5rYpLzU2udEE4tBBO4nAcJjGO0iTEOMIp8tA_E0lKx0VxVhKqLFkxbGCUPDEGfhR4qLalIs4wLWnNgKyhDjA9aVQzvMCkqLMVJsZSOwDadvo0fvheljzL1Vcz_3QrZ13Uytl9v15c8FbtGFg7IJrnzJhzjUbrTnwsptks77Jwk6zm_nI_qzYmraSY7uE_6xqumSEUUgqiECcBGPOv0jga4Xh0mQ_BxX6Y-L6HNNtCq_oV6Vsp6BMe73Xev153rnx83t3p-e3yJetFBSIQbANu3iBBOAffDkZPeRn07qETDbH9AEE3jGqm0dFDf8KzVJcM1pROiOMPQs2dfA.DxlFzw.u69IMJZ4ArgFPNc9yfRSx-oVR9M
Cf-Connecting-Ip: 138.99.113.123
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31135)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31117)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by jump4joy

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'd7b5a6f2ea6a99bcd824a361eb9e0b2a41543630468', '_ga': 'GA1.2.1765542125.1543630473', 'hide_intro': 'True', 'deck_id': '31117', 'session': '.eJx9UctOwzAQ_BefI-S8mx5boKIlChJFQBCK3GSTOPUjsp2IUvXfcSqVHpA4zsx6dmd8REUPihMBwqC5UQM4iFScCjSvCdMWVcApl9UVU11KVRXUUsjHnudGvuth38NRHCYBctA_iiiagbLqsonJpoFqukBLcXb0ceA7iJtGFoMGJQgHa9YNvA86ebAWkgym9QptiJkUQ9vo7jXPsny9HVcMkzJjKR3vt_2D2DbXeSP3YDMdESlL0PqC0YpA-jy83fZP7_usywX200dWm2VLON1s7Hv46qkCXRBbjxsGQTKLI8-9ScLEj6PZVZ8ai3Aww9hBCmpLtb9LQh6nJu7UjrwsN1W--K6pP9KDF-7UuJ5C2UZ7m-bDVmf_gdYTdy5Ko08HnW0Kc5hG0AKIAoVODvrTmiGqAXumGBg7_QD_EJlM.DxlgPw.ZYXHcE3GPozsXfA-P-XxvKl7T68'}
            Endpoint: person_status
            View Args: {}
            Person: 302216312032067594
            Referrer: https://pennydreadfulmagic.com/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: 173.48.59.249, 162.158.63.240
Cf-Ray: 4972c3d1b9d091ee-EWR
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
Dnt: 1
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (X11; CrOS x86_64 11151.59.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.94 Safari/537.36
Referer: https://pennydreadfulmagic.com/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=d7b5a6f2ea6a99bcd824a361eb9e0b2a41543630468; _ga=GA1.2.1765542125.1543630473; hide_intro=True; deck_id=31117; session=.eJx9UctOwzAQ_BefI-S8mx5boKIlChJFQBCK3GSTOPUjsp2IUvXfcSqVHpA4zsx6dmd8REUPihMBwqC5UQM4iFScCjSvCdMWVcApl9UVU11KVRXUUsjHnudGvuth38NRHCYBctA_iiiagbLqsonJpoFqukBLcXb0ceA7iJtGFoMGJQgHa9YNvA86ebAWkgym9QptiJkUQ9vo7jXPsny9HVcMkzJjKR3vt_2D2DbXeSP3YDMdESlL0PqC0YpA-jy83fZP7_usywX200dWm2VLON1s7Hv46qkCXRBbjxsGQTKLI8-9ScLEj6PZVZ8ai3Aww9hBCmpLtb9LQh6nJu7UjrwsN1W--K6pP9KDF-7UuJ5C2UZ7m-bDVmf_gdYTdy5Ko08HnW0Kc5hG0AKIAoVODvrTmiGqAXumGBg7_QD_EJlM.DxlgPw.ZYXHcE3GPozsXfA-P-XxvKl7T68
Cf-Connecting-Ip: 173.48.59.249
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31117)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31117)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by jump4joy

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'd7b5a6f2ea6a99bcd824a361eb9e0b2a41543630468', '_ga': 'GA1.2.1765542125.1543630473', 'hide_intro': 'True', 'deck_id': '31117', '_gid': 'GA1.2.1121477243.1547161281', '_gat_gtag_UA_109131120_1': '1', 'session': '.eJx9UctOwzAQ_BefI-S8mx5boKIlChJFQBCK3GSTOPUjsp2IUvXfcSqVHpA4zsx6dmd8REUPihMBwqC5UQM4iFScCjSvCdMWVcApl9UVU11KVRXUUsjHnudGvuth38NRHCYBctA_iiiagbLqsonJpoFqukBLcXb0ceA7iJtGFoMGJQgHa9YNvA86ebAWkgym9QptiJkUQ9vo7jXPsny9HVcMkzJjKR3vt_2D2DbXeSP3YDMdESlL0PqC0YpA-jy83fZP7_usywX200dWm2VLON1s7Hv46qkCXRBbjxsGQTKLI8-9ScLEj6PZVZ8ai3Aww9hBCmpLtb9LQh6nJu7UjrwsN1W--K6pP9KDF-7UuJ5C2UZ7m-bDVmf_gdYTdy5Ko08HnW0Kc5hG0AKIAoVODvrTmiGqAXumGBg7_QD_EJlM.DxlgSA.6NcFctHE1o1XJAwQX3FziXcI1Ms'}
            Endpoint: person_status
            View Args: {}
            Person: 302216312032067594
            Referrer: https://pennydreadfulmagic.com/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: 173.48.59.249, 162.158.63.240
Cf-Ray: 4972c408fbfb91ee-EWR
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
Dnt: 1
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (X11; CrOS x86_64 11151.59.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.94 Safari/537.36
Referer: https://pennydreadfulmagic.com/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=d7b5a6f2ea6a99bcd824a361eb9e0b2a41543630468; _ga=GA1.2.1765542125.1543630473; hide_intro=True; deck_id=31117; _gid=GA1.2.1121477243.1547161281; _gat_gtag_UA_109131120_1=1; session=.eJx9UctOwzAQ_BefI-S8mx5boKIlChJFQBCK3GSTOPUjsp2IUvXfcSqVHpA4zsx6dmd8REUPihMBwqC5UQM4iFScCjSvCdMWVcApl9UVU11KVRXUUsjHnudGvuth38NRHCYBctA_iiiagbLqsonJpoFqukBLcXb0ceA7iJtGFoMGJQgHa9YNvA86ebAWkgym9QptiJkUQ9vo7jXPsny9HVcMkzJjKR3vt_2D2DbXeSP3YDMdESlL0PqC0YpA-jy83fZP7_usywX200dWm2VLON1s7Hv46qkCXRBbjxsGQTKLI8-9ScLEj6PZVZ8ai3Aww9hBCmpLtb9LQh6nJu7UjrwsN1W--K6pP9KDF-7UuJ5C2UZ7m-bDVmf_gdYTdy5Ko08HnW0Kc5hG0AKIAoVODvrTmiGqAXumGBg7_QD_EJlM.DxlgSA.6NcFctHE1o1XJAwQX3FziXcI1Ms
Cf-Connecting-Ip: 173.48.59.249
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31117)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31117)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by jump4joy

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'd7b5a6f2ea6a99bcd824a361eb9e0b2a41543630468', '_ga': 'GA1.2.1765542125.1543630473', 'hide_intro': 'True', 'deck_id': '31117', '_gid': 'GA1.2.1121477243.1547161281', '_gat_gtag_UA_109131120_1': '1', 'session': '.eJx9UctOwzAQ_BefI-S8mx5boKIlChJFQBCK3GSTOPUjsp2IUvXfcSqVHpA4zsx6dmd8REUPihMBwqC5UQM4iFScCjSvCdMWVcApl9UVU11KVRXUUsjHnudGvuth38NRHCYBctA_iiiagbLqsonJpoFqukBLcXb0ceA7iJtGFoMGJQgHa9YNvA86ebAWkgym9QptiJkUQ9vo7jXPsny9HVcMkzJjKR3vt_2D2DbXeSP3YDMdESlL0PqC0YpA-jy83fZP7_usywX200dWm2VLON1s7Hv46qkCXRBbjxsGQTKLI8-9ScLEj6PZVZ8ai3Aww9hBCmpLtb9LQh6nJu7UjrwsN1W--K6pP9KDF-7UuJ5C2UZ7m-bDVmf_gdYTdy5Ko08HnW0Kc5hG0AKIAoVODvrTmiGqAXumGBg7_QD_EJlM.DxlgUA.9xDzH3oHy-tc9UVtUmM8KOfMLX8'}
            Endpoint: person_status
            View Args: {}
            Person: 302216312032067594
            Referrer: https://pennydreadfulmagic.com/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: 173.48.59.249, 162.158.63.240
Cf-Ray: 4972c43bf99991ee-EWR
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
Dnt: 1
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (X11; CrOS x86_64 11151.59.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.94 Safari/537.36
Referer: https://pennydreadfulmagic.com/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=d7b5a6f2ea6a99bcd824a361eb9e0b2a41543630468; _ga=GA1.2.1765542125.1543630473; hide_intro=True; deck_id=31117; _gid=GA1.2.1121477243.1547161281; _gat_gtag_UA_109131120_1=1; session=.eJx9UctOwzAQ_BefI-S8mx5boKIlChJFQBCK3GSTOPUjsp2IUvXfcSqVHpA4zsx6dmd8REUPihMBwqC5UQM4iFScCjSvCdMWVcApl9UVU11KVRXUUsjHnudGvuth38NRHCYBctA_iiiagbLqsonJpoFqukBLcXb0ceA7iJtGFoMGJQgHa9YNvA86ebAWkgym9QptiJkUQ9vo7jXPsny9HVcMkzJjKR3vt_2D2DbXeSP3YDMdESlL0PqC0YpA-jy83fZP7_usywX200dWm2VLON1s7Hv46qkCXRBbjxsGQTKLI8-9ScLEj6PZVZ8ai3Aww9hBCmpLtb9LQh6nJu7UjrwsN1W--K6pP9KDF-7UuJ5C2UZ7m-bDVmf_gdYTdy5Ko08HnW0Kc5hG0AKIAoVODvrTmiGqAXumGBg7_QD_EJlM.DxlgUA.9xDzH3oHy-tc9UVtUmM8KOfMLX8
Cf-Connecting-Ip: 173.48.59.249
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31117)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31117)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by jump4joy

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'd7b5a6f2ea6a99bcd824a361eb9e0b2a41543630468', '_ga': 'GA1.2.1765542125.1543630473', 'hide_intro': 'True', 'deck_id': '31117', '_gid': 'GA1.2.1121477243.1547161281', 'session': '.eJx9UctOwzAQ_BefI-S8mx5boKIlChJFQBCK3GSTOPUjsp2IUvXfcSqVHpA4zsx6dmd8REUPihMBwqC5UQM4iFScCjSvCdMWVcApl9UVU11KVRXUUsjHnudGvuth38NRHCYBctA_iiiagbLqsonJpoFqukBLcXb0ceA7iJtGFoMGJQgHa9YNvA86ebAWkgym9QptiJkUQ9vo7jXPsny9HVcMkzJjKR3vt_2D2DbXeSP3YDMdESlL0PqC0YpA-jy83fZP7_usywX200dWm2VLON1s7Hv46qkCXRBbjxsGQTKLI8-9ScLEj6PZVZ8ai3Aww9hBCmpLtb9LQh6nJu7UjrwsN1W--K6pP9KDF-7UuJ5C2UZ7m-bDVmf_gdYTdy5Ko08HnW0Kc5hG0AKIAoVODvrTmiGqAXumGBg7_QD_EJlM.DxlghQ.qLJ-iIA45t2QvhHVhE8vNbhNU1s'}
            Endpoint: person_status
            View Args: {}
            Person: 302216312032067594
            Referrer: https://pennydreadfulmagic.com/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: 173.48.59.249, 162.158.63.150
Cf-Ray: 4972c5896b0cc5de-EWR
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
Dnt: 1
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (X11; CrOS x86_64 11151.59.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.94 Safari/537.36
Referer: https://pennydreadfulmagic.com/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=d7b5a6f2ea6a99bcd824a361eb9e0b2a41543630468; _ga=GA1.2.1765542125.1543630473; hide_intro=True; deck_id=31117; _gid=GA1.2.1121477243.1547161281; session=.eJx9UctOwzAQ_BefI-S8mx5boKIlChJFQBCK3GSTOPUjsp2IUvXfcSqVHpA4zsx6dmd8REUPihMBwqC5UQM4iFScCjSvCdMWVcApl9UVU11KVRXUUsjHnudGvuth38NRHCYBctA_iiiagbLqsonJpoFqukBLcXb0ceA7iJtGFoMGJQgHa9YNvA86ebAWkgym9QptiJkUQ9vo7jXPsny9HVcMkzJjKR3vt_2D2DbXeSP3YDMdESlL0PqC0YpA-jy83fZP7_usywX200dWm2VLON1s7Hv46qkCXRBbjxsGQTKLI8-9ScLEj6PZVZ8ai3Aww9hBCmpLtb9LQh6nJu7UjrwsN1W--K6pP9KDF-7UuJ5C2UZ7m-bDVmf_gdYTdy5Ko08HnW0Kc5hG0AKIAoVODvrTmiGqAXumGBg7_QD_EJlM.DxlghQ.qLJ-iIA45t2QvhHVhE8vNbhNU1s
Cf-Connecting-Ip: 173.48.59.249
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31117)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31117)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by jump4joy

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'd7b5a6f2ea6a99bcd824a361eb9e0b2a41543630468', '_ga': 'GA1.2.1765542125.1543630473', 'hide_intro': 'True', 'deck_id': '31117', '_gid': 'GA1.2.1121477243.1547161281', '_gat_gtag_UA_109131120_1': '1', 'session': '.eJx9UctOwzAQ_BefI-S8mx5boKIlChJFQBCK3GSTOPUjsp2IUvXfcSqVHpA4zsx6dmd8REUPihMBwqC5UQM4iFScCjSvCdMWVcApl9UVU11KVRXUUsjHnudGvuth38NRHCYBctA_iiiagbLqsonJpoFqukBLcXb0ceA7iJtGFoMGJQgHa9YNvA86ebAWkgym9QptiJkUQ9vo7jXPsny9HVcMkzJjKR3vt_2D2DbXeSP3YDMdESlL0PqC0YpA-jy83fZP7_usywX200dWm2VLON1s7Hv46qkCXRBbjxsGQTKLI8-9ScLEj6PZVZ8ai3Aww9hBCmpLtb9LQh6nJu7UjrwsN1W--K6pP9KDF-7UuJ5C2UZ7m-bDVmf_gdYTdy5Ko08HnW0Kc5hG0AKIAoVODvrTmiGqAXumGBg7_QD_EJlM.DxlgvA.ejAJoNkRC0Vizuw3cYqt334Bt8w'}
            Endpoint: person_status
            View Args: {}
            Person: 302216312032067594
            Referrer: https://pennydreadfulmagic.com/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: 173.48.59.249, 162.158.63.78
Cf-Ray: 4972c6e20ac591dc-EWR
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
Dnt: 1
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (X11; CrOS x86_64 11151.59.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.94 Safari/537.36
Referer: https://pennydreadfulmagic.com/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=d7b5a6f2ea6a99bcd824a361eb9e0b2a41543630468; _ga=GA1.2.1765542125.1543630473; hide_intro=True; deck_id=31117; _gid=GA1.2.1121477243.1547161281; _gat_gtag_UA_109131120_1=1; session=.eJx9UctOwzAQ_BefI-S8mx5boKIlChJFQBCK3GSTOPUjsp2IUvXfcSqVHpA4zsx6dmd8REUPihMBwqC5UQM4iFScCjSvCdMWVcApl9UVU11KVRXUUsjHnudGvuth38NRHCYBctA_iiiagbLqsonJpoFqukBLcXb0ceA7iJtGFoMGJQgHa9YNvA86ebAWkgym9QptiJkUQ9vo7jXPsny9HVcMkzJjKR3vt_2D2DbXeSP3YDMdESlL0PqC0YpA-jy83fZP7_usywX200dWm2VLON1s7Hv46qkCXRBbjxsGQTKLI8-9ScLEj6PZVZ8ai3Aww9hBCmpLtb9LQh6nJu7UjrwsN1W--K6pP9KDF-7UuJ5C2UZ7m-bDVmf_gdYTdy5Ko08HnW0Kc5hG0AKIAoVODvrTmiGqAXumGBg7_QD_EJlM.DxlgvA.ejAJoNkRC0Vizuw3cYqt334Bt8w
Cf-Connecting-Ip: 173.48.59.249
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31117)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31117)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by jump4joy

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'd7b5a6f2ea6a99bcd824a361eb9e0b2a41543630468', '_ga': 'GA1.2.1765542125.1543630473', 'hide_intro': 'True', 'deck_id': '31117', '_gid': 'GA1.2.1121477243.1547161281', 'session': '.eJx9UctOwzAQ_BefI-S8mx5boKIlChJFQBCK3GSTOPUjsp2IUvXfcSqVHpA4zsx6dmd8REUPihMBwqC5UQM4iFScCjSvCdMWVcApl9UVU11KVRXUUsjHnudGvuth38NRHCYBctA_iiiagbLqsonJpoFqukBLcXb0ceA7iJtGFoMGJQgHa9YNvA86ebAWkgym9QptiJkUQ9vo7jXPsny9HVcMkzJjKR3vt_2D2DbXeSP3YDMdESlL0PqC0YpA-jy83fZP7_usywX200dWm2VLON1s7Hv46qkCXRBbjxsGQTKLI8-9ScLEj6PZVZ8ai3Aww9hBCmpLtb9LQh6nJu7UjrwsN1W--K6pP9KDF-7UuJ5C2UZ7m-bDVmf_gdYTdy5Ko08HnW0Kc5hG0AKIAoVODvrTmiGqAXumGBg7_QD_EJlM.Dxlgwg.c0ox0ycBT5RAsAMFyOQCpCj_ugY'}
            Endpoint: person_status
            View Args: {}
            Person: 302216312032067594
            Referrer: https://pennydreadfulmagic.com/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: 173.48.59.249, 162.158.63.78
Cf-Ray: 4972c7043ab291dc-EWR
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
Dnt: 1
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (X11; CrOS x86_64 11151.59.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.94 Safari/537.36
Referer: https://pennydreadfulmagic.com/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=d7b5a6f2ea6a99bcd824a361eb9e0b2a41543630468; _ga=GA1.2.1765542125.1543630473; hide_intro=True; deck_id=31117; _gid=GA1.2.1121477243.1547161281; session=.eJx9UctOwzAQ_BefI-S8mx5boKIlChJFQBCK3GSTOPUjsp2IUvXfcSqVHpA4zsx6dmd8REUPihMBwqC5UQM4iFScCjSvCdMWVcApl9UVU11KVRXUUsjHnudGvuth38NRHCYBctA_iiiagbLqsonJpoFqukBLcXb0ceA7iJtGFoMGJQgHa9YNvA86ebAWkgym9QptiJkUQ9vo7jXPsny9HVcMkzJjKR3vt_2D2DbXeSP3YDMdESlL0PqC0YpA-jy83fZP7_usywX200dWm2VLON1s7Hv46qkCXRBbjxsGQTKLI8-9ScLEj6PZVZ8ai3Aww9hBCmpLtb9LQh6nJu7UjrwsN1W--K6pP9KDF-7UuJ5C2UZ7m-bDVmf_gdYTdy5Ko08HnW0Kc5hG0AKIAoVODvrTmiGqAXumGBg7_QD_EJlM.Dxlgwg.c0ox0ycBT5RAsAMFyOQCpCj_ugY
Cf-Connecting-Ip: 173.48.59.249
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31117)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31117)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by jump4joy

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'd7b5a6f2ea6a99bcd824a361eb9e0b2a41543630468', '_ga': 'GA1.2.1765542125.1543630473', 'hide_intro': 'True', 'deck_id': '31117', '_gid': 'GA1.2.1121477243.1547161281', '_gat_gtag_UA_109131120_1': '1', 'session': '.eJx9UctOwzAQ_BefI-S8mx5boKIlChJFQBCK3GSTOPUjsp2IUvXfcSqVHpA4zsx6dmd8REUPihMBwqC5UQM4iFScCjSvCdMWVcApl9UVU11KVRXUUsjHnudGvuth38NRHCYBctA_iiiagbLqsonJpoFqukBLcXb0ceA7iJtGFoMGJQgHa9YNvA86ebAWkgym9QptiJkUQ9vo7jXPsny9HVcMkzJjKR3vt_2D2DbXeSP3YDMdESlL0PqC0YpA-jy83fZP7_usywX200dWm2VLON1s7Hv46qkCXRBbjxsGQTKLI8-9ScLEj6PZVZ8ai3Aww9hBCmpLtb9LQh6nJu7UjrwsN1W--K6pP9KDF-7UuJ5C2UZ7m-bDVmf_gdYTdy5Ko08HnW0Kc5hG0AKIAoVODvrTmiGqAXumGBg7_QD_EJlM.Dxlgxw.gXf8ObQ_V3i4E23Y2hXRj88AxTE'}
            Endpoint: person_status
            View Args: {}
            Person: 302216312032067594
            Referrer: https://pennydreadfulmagic.com/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: 173.48.59.249, 162.158.63.78
Cf-Ray: 4972c720aaea91dc-EWR
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
Dnt: 1
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (X11; CrOS x86_64 11151.59.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.94 Safari/537.36
Referer: https://pennydreadfulmagic.com/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=d7b5a6f2ea6a99bcd824a361eb9e0b2a41543630468; _ga=GA1.2.1765542125.1543630473; hide_intro=True; deck_id=31117; _gid=GA1.2.1121477243.1547161281; _gat_gtag_UA_109131120_1=1; session=.eJx9UctOwzAQ_BefI-S8mx5boKIlChJFQBCK3GSTOPUjsp2IUvXfcSqVHpA4zsx6dmd8REUPihMBwqC5UQM4iFScCjSvCdMWVcApl9UVU11KVRXUUsjHnudGvuth38NRHCYBctA_iiiagbLqsonJpoFqukBLcXb0ceA7iJtGFoMGJQgHa9YNvA86ebAWkgym9QptiJkUQ9vo7jXPsny9HVcMkzJjKR3vt_2D2DbXeSP3YDMdESlL0PqC0YpA-jy83fZP7_usywX200dWm2VLON1s7Hv46qkCXRBbjxsGQTKLI8-9ScLEj6PZVZ8ai3Aww9hBCmpLtb9LQh6nJu7UjrwsN1W--K6pP9KDF-7UuJ5C2UZ7m-bDVmf_gdYTdy5Ko08HnW0Kc5hG0AKIAoVODvrTmiGqAXumGBg7_QD_EJlM.Dxlgxw.gXf8ObQ_V3i4E23Y2hXRj88AxTE
Cf-Connecting-Ip: 173.48.59.249
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31117)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31117)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by jump4joy

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'd7b5a6f2ea6a99bcd824a361eb9e0b2a41543630468', '_ga': 'GA1.2.1765542125.1543630473', 'hide_intro': 'True', 'deck_id': '31117', '_gid': 'GA1.2.1121477243.1547161281', '_gat_gtag_UA_109131120_1': '1', 'session': '.eJx9UctOwzAQ_BefI-S8mx5boKIlChJFQBCK3GSTOPUjsp2IUvXfcSqVHpA4zsx6dmd8REUPihMBwqC5UQM4iFScCjSvCdMWVcApl9UVU11KVRXUUsjHnudGvuth38NRHCYBctA_iiiagbLqsonJpoFqukBLcXb0ceA7iJtGFoMGJQgHa9YNvA86ebAWkgym9QptiJkUQ9vo7jXPsny9HVcMkzJjKR3vt_2D2DbXeSP3YDMdESlL0PqC0YpA-jy83fZP7_usywX200dWm2VLON1s7Hv46qkCXRBbjxsGQTKLI8-9ScLEj6PZVZ8ai3Aww9hBCmpLtb9LQh6nJu7UjrwsN1W--K6pP9KDF-7UuJ5C2UZ7m-bDVmf_gdYTdy5Ko08HnW0Kc5hG0AKIAoVODvrTmiGqAXumGBg7_QD_EJlM.Dxlgyw.n7ruG6qVsCaFrPqYAh1w9dvW8sU'}
            Endpoint: person_status
            View Args: {}
            Person: 302216312032067594
            Referrer: https://pennydreadfulmagic.com/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: 173.48.59.249, 162.158.63.78
Cf-Ray: 4972c73c6f2091dc-EWR
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
Dnt: 1
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (X11; CrOS x86_64 11151.59.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.94 Safari/537.36
Referer: https://pennydreadfulmagic.com/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=d7b5a6f2ea6a99bcd824a361eb9e0b2a41543630468; _ga=GA1.2.1765542125.1543630473; hide_intro=True; deck_id=31117; _gid=GA1.2.1121477243.1547161281; _gat_gtag_UA_109131120_1=1; session=.eJx9UctOwzAQ_BefI-S8mx5boKIlChJFQBCK3GSTOPUjsp2IUvXfcSqVHpA4zsx6dmd8REUPihMBwqC5UQM4iFScCjSvCdMWVcApl9UVU11KVRXUUsjHnudGvuth38NRHCYBctA_iiiagbLqsonJpoFqukBLcXb0ceA7iJtGFoMGJQgHa9YNvA86ebAWkgym9QptiJkUQ9vo7jXPsny9HVcMkzJjKR3vt_2D2DbXeSP3YDMdESlL0PqC0YpA-jy83fZP7_usywX200dWm2VLON1s7Hv46qkCXRBbjxsGQTKLI8-9ScLEj6PZVZ8ai3Aww9hBCmpLtb9LQh6nJu7UjrwsN1W--K6pP9KDF-7UuJ5C2UZ7m-bDVmf_gdYTdy5Ko08HnW0Kc5hG0AKIAoVODvrTmiGqAXumGBg7_QD_EJlM.Dxlgyw.n7ruG6qVsCaFrPqYAh1w9dvW8sU
Cf-Connecting-Ip: 173.48.59.249
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31117)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31131)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by emobrian

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'decf5e4a0cac2b8a86ca1a6c9feb1d27b1546889067', '_ga': 'GA1.2.1120360529.1546889076', 'session': '.eJx9UdFqwjAU_Zc8l9HGtrY-KgpzylTcQMYosbkm0SapSSpW8d-XCs6HwR7PuTfn3HNyRUUNRhIFyqGBMw0EiFApFBrsSGU9oiCF1PSJhS21oYXwFMJZFsV5jHtpL4rCNIwzFKB_Jqpgjajow6nSjAHtLrBa3RVxmvcCJB3TRWPBKCLBi4HUWyOI8hKaNI7jwjriusl0OVsvF_0N13y_x7OExZuStKl9W1M-mT_3nT6Az3RFpCzB2gdGHyst1HG4phZWh9OIHZu6PfHXaSZgIxf-PZxrYcAWxNcTJXE_wTlO4pe0h3EeZc9511iXMgwDZGDnKf5rMivHU3HZzt8v22oyYn1u8OewzduGn_PxxZv4Rmuf5stX5_9B7FrP3Yuy6DtAd5nCtd0KGgIxYNAtQH9ac8Qw8GeqpqpuP32GmfI.DxljJw.t2OxueZfRCmfEorHoRh3GZIu6aQ'}
            Endpoint: person_status
            View Args: {}
            Person: 288149423631106048
            Referrer: https://pennydreadfulmagic.com/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: 98.115.104.9, 162.158.79.109
Cf-Ray: 4972d5faeefac17c-IAD
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Referer: https://pennydreadfulmagic.com/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=decf5e4a0cac2b8a86ca1a6c9feb1d27b1546889067; _ga=GA1.2.1120360529.1546889076; session=.eJx9UdFqwjAU_Zc8l9HGtrY-KgpzylTcQMYosbkm0SapSSpW8d-XCs6HwR7PuTfn3HNyRUUNRhIFyqGBMw0EiFApFBrsSGU9oiCF1PSJhS21oYXwFMJZFsV5jHtpL4rCNIwzFKB_Jqpgjajow6nSjAHtLrBa3RVxmvcCJB3TRWPBKCLBi4HUWyOI8hKaNI7jwjriusl0OVsvF_0N13y_x7OExZuStKl9W1M-mT_3nT6Az3RFpCzB2gdGHyst1HG4phZWh9OIHZu6PfHXaSZgIxf-PZxrYcAWxNcTJXE_wTlO4pe0h3EeZc9511iXMgwDZGDnKf5rMivHU3HZzt8v22oyYn1u8OewzduGn_PxxZv4Rmuf5stX5_9B7FrP3Yuy6DtAd5nCtd0KGgIxYNAtQH9ac8Qw8GeqpqpuP32GmfI.DxljJw.t2OxueZfRCmfEorHoRh3GZIu6aQ
Cf-Connecting-Ip: 98.115.104.9
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31131)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31131)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by emobrian

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'decf5e4a0cac2b8a86ca1a6c9feb1d27b1546889067', '_ga': 'GA1.2.1120360529.1546889076', '_gid': 'GA1.2.1829607804.1547162027', 'session': '.eJx9UdFqwjAU_Zc8l9HGtrY-KgpzylTcQMYosbkm0SapSSpW8d-XCs6HwR7PuTfn3HNyRUUNRhIFyqGBMw0EiFApFBrsSGU9oiCF1PSJhS21oYXwFMJZFsV5jHtpL4rCNIwzFKB_Jqpgjajow6nSjAHtLrBa3RVxmvcCJB3TRWPBKCLBi4HUWyOI8hKaNI7jwjriusl0OVsvF_0N13y_x7OExZuStKl9W1M-mT_3nT6Az3RFpCzB2gdGHyst1HG4phZWh9OIHZu6PfHXaSZgIxf-PZxrYcAWxNcTJXE_wTlO4pe0h3EeZc9511iXMgwDZGDnKf5rMivHU3HZzt8v22oyYn1u8OewzduGn_PxxZv4Rmuf5stX5_9B7FrP3Yuy6DtAd5nCtd0KGgIxYNAtQH9ac8Qw8GeqpqpuP32GmfI.Dxljsg.s4APqDN7El2qYux49XLS8n1Z-fM'}
            Endpoint: person_status
            View Args: {}
            Person: 288149423631106048
            Referrer: https://pennydreadfulmagic.com/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: 98.115.104.9, 162.158.79.109
Cf-Ray: 4972d95ab9f1c17c-IAD
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Referer: https://pennydreadfulmagic.com/
Accept-Language: en-US,en;q=0.9
Cookie: __cfduid=decf5e4a0cac2b8a86ca1a6c9feb1d27b1546889067; _ga=GA1.2.1120360529.1546889076; _gid=GA1.2.1829607804.1547162027; session=.eJx9UdFqwjAU_Zc8l9HGtrY-KgpzylTcQMYosbkm0SapSSpW8d-XCs6HwR7PuTfn3HNyRUUNRhIFyqGBMw0EiFApFBrsSGU9oiCF1PSJhS21oYXwFMJZFsV5jHtpL4rCNIwzFKB_Jqpgjajow6nSjAHtLrBa3RVxmvcCJB3TRWPBKCLBi4HUWyOI8hKaNI7jwjriusl0OVsvF_0N13y_x7OExZuStKl9W1M-mT_3nT6Az3RFpCzB2gdGHyst1HG4phZWh9OIHZu6PfHXaSZgIxf-PZxrYcAWxNcTJXE_wTlO4pe0h3EeZc9511iXMgwDZGDnKf5rMivHU3HZzt8v22oyYn1u8OewzduGn_PxxZv4Rmuf5stX5_9B7FrP3Yuy6DtAd5nCtd0KGgIxYNAtQH9ac8Qw8GeqpqpuP32GmfI.Dxljsg.s4APqDN7El2qYux49XLS8n1Z-fM
Cf-Connecting-Ip: 98.115.104.9
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31131)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31141)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by carmandor

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'__cfduid': 'dec49fd534b1cdca1ad3a0531ec7ab5d61541226167', '_ga': 'GA1.2.2066688966.1541226174', 'session': '.eJx9UdFugkAQ_Jd7Jg1wyIlvNaltjdHGRq02DTlgOZCDw7vD1Bj_vYuJ9aFJH2d2dnd29kziFnTNG2gsGVndgUN4VpcNGeVcGkQZ1GWtsjsuTap0FpdIkSAKA88feiFjLKJh5DLikH8qTSy6Uma3TVKlXAKqsaVHQkDW-zGquc73GY0cUluh4s6Abnjdi1PeG86Uxh7FO1v4sbHcXuckx8N2EEzVLK88MYZJtC5WT7R4TKbLQ3rXW1UBnngmPE3BmBsm7VZW3et83642RZEetnsjF-_8bblz5wPIsR--21KDiTmm5Q0Cn0aMDtmDRynz6L3c5xe6wdB1HaIhR6r43TE_VXYjZvXL0ozXu4_nZCGSY1HaZEJX4QZ3YL4tHvOJqeBXyvyE3DU2Q74cch0T21MvIWPgGjS5OORPapZrAeiy6aS8_ACJr54Y.Dxl7xw.drFQAfx8_5yhhvpk-O2GsmAUfDI', '_gid': 'GA1.2.1886727277.1546160218'}
            Endpoint: person_status
            View Args: {}
            Person: 496412816777936907
            Referrer: https://pennydreadfulmagic.com/people/2739/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: IT
X-Forwarded-For: 176.200.183.170, 141.101.88.36
Cf-Ray: 49736feaeebdb7b9-CDG
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Android 7.0; Mobile; rv:64.0) Gecko/64.0 Firefox/64.0
Accept: */*
Accept-Language: it,it-IT;q=0.8,en-US;q=0.5,en;q=0.3
X-Requested-With: XMLHttpRequest
Referer: https://pennydreadfulmagic.com/people/2739/
Cookie: __cfduid=dec49fd534b1cdca1ad3a0531ec7ab5d61541226167; _ga=GA1.2.2066688966.1541226174; session=.eJx9UdFugkAQ_Jd7Jg1wyIlvNaltjdHGRq02DTlgOZCDw7vD1Bj_vYuJ9aFJH2d2dnd29kziFnTNG2gsGVndgUN4VpcNGeVcGkQZ1GWtsjsuTap0FpdIkSAKA88feiFjLKJh5DLikH8qTSy6Uma3TVKlXAKqsaVHQkDW-zGquc73GY0cUluh4s6Abnjdi1PeG86Uxh7FO1v4sbHcXuckx8N2EEzVLK88MYZJtC5WT7R4TKbLQ3rXW1UBnngmPE3BmBsm7VZW3et83642RZEetnsjF-_8bblz5wPIsR--21KDiTmm5Q0Cn0aMDtmDRynz6L3c5xe6wdB1HaIhR6r43TE_VXYjZvXL0ozXu4_nZCGSY1HaZEJX4QZ3YL4tHvOJqeBXyvyE3DU2Q74cch0T21MvIWPgGjS5OORPapZrAeiy6aS8_ACJr54Y.Dxl7xw.drFQAfx8_5yhhvpk-O2GsmAUfDI; _gid=GA1.2.1886727277.1546160218
Cf-Connecting-Ip: 176.200.183.170
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31141)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31049)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by silasary

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'hide_intro': 'True', 'session': '.eJx9UdluwjAQ_Jd9jqocztU3DlGgXKIlbVVVkZVsgiFxqO0UAuLf6yABUh_6ODvrmZ3xCeIdipJy5AoelajRAJqWjF9BiiUrq_QGmUwqkcZMT8ByieM5AbGJa_kOce0ADPiH4XFes-KmVVR5jmnrLyt-UbRCz4BS5VVcSxSclqi1JCuopKLRChWt1dqOpaKqZfjmqR_I8WZ16NakWUyboylWYToc_6RZr3PfV9UWdaAT0CRBKa8Y2HxvhcX7fEGiMlviNuLzZLpyh9_Ph9Fqrd_jYccEypjqbnQk4nte6IcPrmOT0PLvfFuXZ5LANA0QmOnR-mZiLfsDO4q6s8ki9D46r7OXvVq-HQfRJBnte9pEF7rTaT51c_oTWNYGvfQk4cuAi0ysmnYFukgFCjgb8Lc0RUWO-kpeF8X5F5nSlzI.Dxl_dw.GX2KGY58NjzT-TfmdbD7KESI5oE', '_ga': 'GA1.2.224319916.1532064855', '__cfduid': 'd428a576a73d3d72e85fc5786719d31761545990167', 'deck_id': '31049', '_gid': 'GA1.2.281155403.1547167712'}
            Endpoint: person_status
            View Args: {}
            Person: 154363842451734528
            Referrer: https://pennydreadfulmagic.com/league/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: AU
X-Forwarded-For: 101.180.165.202, 108.162.215.144
Cf-Ray: 497386ed8efb992b-LAX
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
Accept: */*
Accept-Language: en-AU,en-GB;q=0.8,en-US;q=0.5,en;q=0.3
Referer: https://pennydreadfulmagic.com/league/
X-Requested-With: XMLHttpRequest
Cookie: hide_intro=True; session=.eJx9UdluwjAQ_Jd9jqocztU3DlGgXKIlbVVVkZVsgiFxqO0UAuLf6yABUh_6ODvrmZ3xCeIdipJy5AoelajRAJqWjF9BiiUrq_QGmUwqkcZMT8ByieM5AbGJa_kOce0ADPiH4XFes-KmVVR5jmnrLyt-UbRCz4BS5VVcSxSclqi1JCuopKLRChWt1dqOpaKqZfjmqR_I8WZ16NakWUyboylWYToc_6RZr3PfV9UWdaAT0CRBKa8Y2HxvhcX7fEGiMlviNuLzZLpyh9_Ph9Fqrd_jYccEypjqbnQk4nte6IcPrmOT0PLvfFuXZ5LANA0QmOnR-mZiLfsDO4q6s8ki9D46r7OXvVq-HQfRJBnte9pEF7rTaT51c_oTWNYGvfQk4cuAi0ysmnYFukgFCjgb8Lc0RUWO-kpeF8X5F5nSlzI.Dxl_dw.GX2KGY58NjzT-TfmdbD7KESI5oE; _ga=GA1.2.224319916.1532064855; __cfduid=d428a576a73d3d72e85fc5786719d31761545990167; deck_id=31049; _gid=GA1.2.281155403.1547167712
Cf-Connecting-Ip: 101.180.165.202
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31049)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /api/status/

Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31049)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

Reported on decksite by silasary

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /api/status/?
            Cookies: {'hide_intro': 'True', 'session': '.eJx9UdluwjAQ_Jd9jqocztU3DlGgXKIlbVVVkZVsgiFxqO0UAuLf6yABUh_6ODvrmZ3xCeIdipJy5AoelajRAJqWjF9BiiUrq_QGmUwqkcZMT8ByieM5AbGJa_kOce0ADPiH4XFes-KmVVR5jmnrLyt-UbRCz4BS5VVcSxSclqi1JCuopKLRChWt1dqOpaKqZfjmqR_I8WZ16NakWUyboylWYToc_6RZr3PfV9UWdaAT0CRBKa8Y2HxvhcX7fEGiMlviNuLzZLpyh9_Ph9Fqrd_jYccEypjqbnQk4nte6IcPrmOT0PLvfFuXZ5LANA0QmOnR-mZiLfsDO4q6s8ki9D46r7OXvVq-HQfRJBnte9pEF7rTaT51c_oTWNYGvfQk4cuAi0ysmnYFukgFCjgb8Lc0RUWO-kpeF8X5F5nSlzI.Dxl_fQ.DsNC28QwCn4Oa1PAlvvO25VOHKc', '_ga': 'GA1.2.224319916.1532064855', '__cfduid': 'd428a576a73d3d72e85fc5786719d31761545990167', 'deck_id': '31049', '_gid': 'GA1.2.281155403.1547167712', '_gat_gtag_UA_109131120_1': '1'}
            Endpoint: person_status
            View Args: {}
            Person: 154363842451734528
            Referrer: https://pennydreadfulmagic.com/league/
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: AU
X-Forwarded-For: 101.180.165.202, 108.162.215.144
Cf-Ray: 497387131ba8992b-LAX
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
Accept: */*
Accept-Language: en-AU,en-GB;q=0.8,en-US;q=0.5,en;q=0.3
Referer: https://pennydreadfulmagic.com/league/
X-Requested-With: XMLHttpRequest
Cookie: hide_intro=True; session=.eJx9UdluwjAQ_Jd9jqocztU3DlGgXKIlbVVVkZVsgiFxqO0UAuLf6yABUh_6ODvrmZ3xCeIdipJy5AoelajRAJqWjF9BiiUrq_QGmUwqkcZMT8ByieM5AbGJa_kOce0ADPiH4XFes-KmVVR5jmnrLyt-UbRCz4BS5VVcSxSclqi1JCuopKLRChWt1dqOpaKqZfjmqR_I8WZ16NakWUyboylWYToc_6RZr3PfV9UWdaAT0CRBKa8Y2HxvhcX7fEGiMlviNuLzZLpyh9_Ph9Fqrd_jYccEypjqbnQk4nte6IcPrmOT0PLvfFuXZ5LANA0QmOnR-mZiLfsDO4q6s8ki9D46r7OXvVq-HQfRJBnte9pEF7rTaT51c_oTWNYGvfQk4cuAi0ysmnYFukgFCjgb8Lc0RUWO-kpeF8X5F5nSlzI.Dxl_fQ.DsNC28QwCn4Oa1PAlvvO25VOHKc; _ga=GA1.2.224319916.1532064855; __cfduid=d428a576a73d3d72e85fc5786719d31761545990167; deck_id=31049; _gid=GA1.2.281155403.1547167712; _gat_gtag_UA_109131120_1=1
Cf-Connecting-Ip: 101.180.165.202
Cdn-Loop: cloudflare
X-Forwarded-Host: pennydreadfulmagic.com
X-Forwarded-Server: pennydreadfulmagic.com
Connection: Keep-Alive

DatabaseException Failed to execute ` SELECT d.id, d.name AS original_name, d.created_date, d.updated_date, SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses, SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws, d.finish, d.archetype_id, d.url AS source_url, d.competition_id, c.name AS competition_name, c.end_date AS competition_end_date, c.top_n AS competition_top_n, ct.name AS competition_type_name, d.identifier, LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person, p.id AS person_id, p.banned, p.discord_id, d.decklist_hash, d.retired, d.reviewed, s.name AS source_name, IFNULL(a.name, '') AS archetype_name, cache.normalized_name AS name, cache.colors, cache.colored_symbols, cache.legal_formats, ROUND(cache.omw * 100, 2) AS omw, season.id AS season_id, IFNULL(MAX(m.date), d.created_date) AS active_date FROM deck AS d LEFT JOIN person AS p ON d.person_id = p.id LEFT JOIN source AS s ON d.source_id = s.id LEFT JOIN archetype AS a ON d.archetype_id = a.id

    LEFT JOIN
        competition AS c ON d.competition_id = c.id
    LEFT JOIN
        competition_series AS cs ON cs.id = c.competition_series_id
    LEFT JOIN
        competition_type AS ct ON ct.id = cs.competition_type_id

    LEFT JOIN
        deck_cache AS cache ON d.id = cache.deck_id
    LEFT JOIN
        deck_match AS dm ON d.id = dm.deck_id
    LEFT JOIN
        `match` AS m ON dm.match_id = m.id
    LEFT JOIN
        deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_id

    LEFT JOIN
        (
            SELECT
                `start`.id,
                `start`.code,
                `start`.start_date AS start_date,
                `end`.start_date AS end_date
            FROM
                season AS `start`
            LEFT JOIN
                season AS `end` ON `end`.id = `start`.id + 1
        ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)

    WHERE
        (d.id IN (31049)) AND (TRUE)
    GROUP BY
        d.id,
        d.competition_id, -- Every deck has only one competition_id but if we want to use competition_id in the HAVING clause we need this.
        season.id -- In theory this is not necessary as all decks are in a single season and we join on the date but MySQL cannot work that out so give it the hint it needs.
    HAVING
        1 = 1
    ORDER BY
        active_date DESC, d.finish IS NULL, d.finish

` with `[]` because of `(1021, 'Disk full (/tmp/#sql_4513_5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")')`

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_functions[rule.endpoint](**req.view_args)
  File "./decksite/auth.py", line 70, in decorated_function
    return f(*args, **kwargs)
  File "./decksite/api.py", line 197, in person_status
    d = guarantee_at_most_one_or_retire(league.active_decks_by(username))
  File "./decksite/league.py", line 217, in active_decks_by
    return active_decks('p.mtgo_username = {mtgo_username}'.format(mtgo_username=sqlescape(mtgo_username, force_string=True)))
  File "./decksite/league.py", line 213, in active_decks
    decks = deck.load_decks(where)
  File "./decksite/data/deck.py", line 104, in load_decks
    loaded_decks = load_decks_heavy(where)
  File "./decksite/data/deck.py", line 201, in load_decks_heavy
    rows = db().select(sql)
  File "./shared/database.py", line 41, in select
    [_, rows] = self.execute_anything(sql, args)
  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))

Exception_hash: 5a83bfce876cd888209125b3564dc0428585f6eb

Labels: decksite; DatabaseException