PennyDreadfulMTG / perf-reports

2 stars 7 forks source link

500 error at /news/ #42556

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 (31105, 31062, 31048, 31027, 30984, 30757, 30745, 30739, 30719, 30694, 30644, 30603, 30585, 30571, 30532, 30454, 30412, 30401, 30368, 30319, 30219, 30150, 30116, 30087, 29991, 29894, 29824, 29798, 29783, 29691, 29484, 29414, 29364, 29337, 29248, 29048, 28947, 28921, 28876, 28749, 28584, 28490, 28438, 28387, 28250, 28068, 27991, 27954, 27892, 27480, 27282, 27170, 27118, 27056, 26920, 26682, 26543, 26472, 26421, 26233, 25978, 25799, 25691, 25585, 25228, 25168, 25124, 25098, 25084, 25018, 24882, 24824, 24768, 24721, 24599, 24369, 24232, 24171, 24119, 23989, 23816, 23740, 23702, 23656, 23533, 23341, 23230, 23186, 23152, 22992, 22774, 22674, 22630, 22581, 22445, 22254, 22152, 22114, 22049, 21909, 21751, 21635, 21569, 21513, 21359, 21099, 20983, 20927, 20873, 20756, 20581, 20521, 20474, 20436, 20306, 20148, 20048, 19984, 19923, 19785, 19484, 19271, 19193, 19088, 18828, 18742, 18691, 18667, 18560, 18571, 18587, 18607, 18617, 18632, 18637, 17734, 17675, 17625, 17567, 17471, 17341, 17280, 17263, 17231, 17150, 17047, 16988, 16959, 16922, 16826, 16611, 16473, 16438, 16367, 16253, 16132, 16038, 16003, 15966, 15875, 15657, 15563, 15531, 15480, 15380, 15206, 15085, 15036, 15004, 14877, 14694, 14549, 14502, 14441, 14299, 14100, 13971, 13909, 22516, 13618, 13546, 13513, 13476, 13449, 13420, 13379, 22882, 13256, 13214, 13174, 13118, 13094, 12979, 12904, 12884, 12846, 12791, 12754, 12629, 12425, 12503, 12381, 12335, 12268, 12079, 11986, 12026, 11966, 11853, 11702, 11588, 11626, 11557, 11466, 11349, 11242, 11281, 11213, 11095, 10886, 10795, 10758, 10730, 10623, 10474, 10420, 10359, 10325, 10221, 10113, 10034, 9974, 9967, 9931, 9829, 9678, 9605, 9568, 9528, 9439, 9202, 9111, 9040, 8924, 8769, 8701, 8628, 8549, 8294, 8184, 8049, 7907, 7828, 7782, 7764, 7696, 7610, 7545, 7489, 7411, 7306, 7211, 7180, 7129, 7047, 6996, 6963, 6907, 6813, 6750, 6726, 6671, 6598, 6560, 6507, 6467, 6341, 6256, 6211, 6139, 6093, 6063, 6008, 5968, 5867, 5844, 5795, 5760, 5659, 5601, 5548, 5477, 5409, 5370, 5324, 5286, 5182, 5158, 5121, 5087, 5029, 4994, 4931, 4853, 4815, 4756, 4718, 4653, 4584, 4493, 4425, 4327, 4309, 4280, 4263, 4221, 4189, 4165, 4134, 4106, 4083, 4026, 4000, 3934, 3902, 3887, 3852, 3812, 3771, 3723, 3669, 3623, 3582, 3531, 3476, 3401, 3272, 3217, 3127, 3059, 3029, 2500, 2429, 2383, 2344, 2333, 2306, 2210, 2185, 2161, 2130, 2109, 2082, 2062, 2047, 2010, 1971, 1931, 1890, 1848, 1827, 1760, 1699, 1672, 1644, 1605, 1582, 1554, 1537, 1518, 1502, 1487, 1462, 1445, 1421, 1406, 1391, 1372, 1361, 1346, 1338, 1314, 1232, 1246, 1258, 1290, 1215, 1192, 1176, 1140, 1107, 1082, 1065, 1007, 978, 946, 912, 879, 852, 808, 791, 753, 724, 708, 685, 649, 618, 561, 521, 474, 396, 348, 131, 1, 56)) 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 logged_out

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /news/?locale=es'"
            Cookies: {}
            Endpoint: news
            View Args: {}
            Person: logged_out
            Referrer: None
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: DE
X-Forwarded-For: 78.46.52.232, 162.158.90.26
Cf-Ray: 49722ea15d7796ac-FRA
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
Cf-Connecting-Ip: 78.46.52.232
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 (31105, 31062, 31048, 31027, 30984, 30757, 30745, 30739, 30719, 30694, 30644, 30603, 30585, 30571, 30532, 30454, 30412, 30401, 30368, 30319, 30219, 30150, 30116, 30087, 29991, 29894, 29824, 29798, 29783, 29691, 29484, 29414, 29364, 29337, 29248, 29048, 28947, 28921, 28876, 28749, 28584, 28490, 28438, 28387, 28250, 28068, 27991, 27954, 27892, 27480, 27282, 27170, 27118, 27056, 26920, 26682, 26543, 26472, 26421, 26233, 25978, 25799, 25691, 25585, 25228, 25168, 25124, 25098, 25084, 25018, 24882, 24824, 24768, 24721, 24599, 24369, 24232, 24171, 24119, 23989, 23816, 23740, 23702, 23656, 23533, 23341, 23230, 23186, 23152, 22992, 22774, 22674, 22630, 22581, 22445, 22254, 22152, 22114, 22049, 21909, 21751, 21635, 21569, 21513, 21359, 21099, 20983, 20927, 20873, 20756, 20581, 20521, 20474, 20436, 20306, 20148, 20048, 19984, 19923, 19785, 19484, 19271, 19193, 19088, 18828, 18742, 18691, 18667, 18560, 18571, 18587, 18607, 18617, 18632, 18637, 17734, 17675, 17625, 17567, 17471, 17341, 17280, 17263, 17231, 17150, 17047, 16988, 16959, 16922, 16826, 16611, 16473, 16438, 16367, 16253, 16132, 16038, 16003, 15966, 15875, 15657, 15563, 15531, 15480, 15380, 15206, 15085, 15036, 15004, 14877, 14694, 14549, 14502, 14441, 14299, 14100, 13971, 13909, 22516, 13618, 13546, 13513, 13476, 13449, 13420, 13379, 22882, 13256, 13214, 13174, 13118, 13094, 12979, 12904, 12884, 12846, 12791, 12754, 12629, 12425, 12503, 12381, 12335, 12268, 12079, 11986, 12026, 11966, 11853, 11702, 11588, 11626, 11557, 11466, 11349, 11242, 11281, 11213, 11095, 10886, 10795, 10758, 10730, 10623, 10474, 10420, 10359, 10325, 10221, 10113, 10034, 9974, 9967, 9931, 9829, 9678, 9605, 9568, 9528, 9439, 9202, 9111, 9040, 8924, 8769, 8701, 8628, 8549, 8294, 8184, 8049, 7907, 7828, 7782, 7764, 7696, 7610, 7545, 7489, 7411, 7306, 7211, 7180, 7129, 7047, 6996, 6963, 6907, 6813, 6750, 6726, 6671, 6598, 6560, 6507, 6467, 6341, 6256, 6211, 6139, 6093, 6063, 6008, 5968, 5867, 5844, 5795, 5760, 5659, 5601, 5548, 5477, 5409, 5370, 5324, 5286, 5182, 5158, 5121, 5087, 5029, 4994, 4931, 4853, 4815, 4756, 4718, 4653, 4584, 4493, 4425, 4327, 4309, 4280, 4263, 4221, 4189, 4165, 4134, 4106, 4083, 4026, 4000, 3934, 3902, 3887, 3852, 3812, 3771, 3723, 3669, 3623, 3582, 3531, 3476, 3401, 3272, 3217, 3127, 3059, 3029, 2500, 2429, 2383, 2344, 2333, 2306, 2210, 2185, 2161, 2130, 2109, 2082, 2062, 2047, 2010, 1971, 1931, 1890, 1848, 1827, 1760, 1699, 1672, 1644, 1605, 1582, 1554, 1537, 1518, 1502, 1487, 1462, 1445, 1421, 1406, 1391, 1372, 1361, 1346, 1338, 1314, 1232, 1246, 1258, 1290, 1215, 1192, 1176, 1140, 1107, 1082, 1065, 1007, 978, 946, 912, 879, 852, 808, 791, 753, 724, 708, 685, 649, 618, 561, 521, 474, 396, 348, 131, 1, 56)) 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/cache.py", line 79, in decorated_function
    response = make_response(f(*args, **kwargs))
  File "./decksite/main.py", line 278, in news
    news_items = ns.all_news()
  File "./decksite/data/news.py", line 23, in all_news
    news += tournament_winners(start_date, end_date, max_items)
  File "./decksite/data/news.py", line 91, in tournament_winners
    ds = deck.load_decks(where, limit=f'LIMIT {max_items}')
  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: 91b4d2319f45aa95b7f74130e0d57d74fec7c052

vorpal-buildbot commented 5 years ago

500 error at /news/

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 (31105, 31062, 31048, 31027, 30984, 30757, 30745, 30739, 30719, 30694, 30644, 30603, 30585, 30571, 30532, 30454, 30412, 30401, 30368, 30319, 30219, 30150, 30116, 30087, 29991, 29894, 29824, 29798, 29783, 29691, 29484, 29414, 29364, 29337, 29248, 29048, 28947, 28921, 28876, 28749, 28584, 28490, 28438, 28387, 28250, 28068, 27991, 27954, 27892, 27480, 27282, 27170, 27118, 27056, 26920, 26682, 26543, 26472, 26421, 26233, 25978, 25799, 25691, 25585, 25228, 25168, 25124, 25098, 25084, 25018, 24882, 24824, 24768, 24721, 24599, 24369, 24232, 24171, 24119, 23989, 23816, 23740, 23702, 23656, 23533, 23341, 23230, 23186, 23152, 22992, 22774, 22674, 22630, 22581, 22445, 22254, 22152, 22114, 22049, 21909, 21751, 21635, 21569, 21513, 21359, 21099, 20983, 20927, 20873, 20756, 20581, 20521, 20474, 20436, 20306, 20148, 20048, 19984, 19923, 19785, 19484, 19271, 19193, 19088, 18828, 18742, 18691, 18667, 18560, 18571, 18587, 18607, 18617, 18632, 18637, 17734, 17675, 17625, 17567, 17471, 17341, 17280, 17263, 17231, 17150, 17047, 16988, 16959, 16922, 16826, 16611, 16473, 16438, 16367, 16253, 16132, 16038, 16003, 15966, 15875, 15657, 15563, 15531, 15480, 15380, 15206, 15085, 15036, 15004, 14877, 14694, 14549, 14502, 14441, 14299, 14100, 13971, 13909, 22516, 13618, 13546, 13513, 13476, 13449, 13420, 13379, 22882, 13256, 13214, 13174, 13118, 13094, 12979, 12904, 12884, 12846, 12791, 12754, 12629, 12425, 12503, 12381, 12335, 12268, 12079, 12026, 11986, 11966, 11853, 11702, 11626, 11588, 11557, 11466, 11349, 11242, 11281, 11213, 11095, 10886, 10758, 10795, 10730, 10623, 10474, 10359, 10420, 10325, 10221, 10113, 10034, 9974, 9967, 9931, 9829, 9678, 9568, 9605, 9528, 9439, 9202, 9111, 9040, 8924, 8769, 8701, 8628, 8549, 8294, 8184, 8049, 7907, 7828, 7782, 7764, 7696, 7610, 7545, 7489, 7411, 7306, 7211, 7180, 7129, 7047, 6996, 6963, 6907, 6813, 6750, 6726, 6671, 6598, 6560, 6507, 6467, 6341, 6256, 6211, 6139, 6093, 6063, 6008, 5968, 5867, 5844, 5795, 5760, 5659, 5601, 5548, 5477, 5409, 5370, 5324, 5286, 5182, 5158, 5121, 5087, 5029, 4994, 4931, 4853, 4815, 4756, 4718, 4653, 4584, 4493, 4425, 4327, 4309, 4280, 4263, 4221, 4189, 4165, 4134, 4106, 4083, 4026, 4000, 3934, 3902, 3887, 3852, 3812, 3771, 3723, 3669, 3623, 3582, 3531, 3476, 3401, 3272, 3217, 3127, 3059, 3029, 2500, 2429, 2383, 2344, 2333, 2306, 2210, 2185, 2161, 2130, 2109, 2082, 2062, 2047, 2010, 1971, 1931, 1890, 1848, 1827, 1760, 1699, 1672, 1644, 1605, 1582, 1554, 1537, 1518, 1502, 1487, 1462, 1445, 1421, 1406, 1391, 1372, 1361, 1346, 1338, 1314, 1232, 1246, 1258, 1290, 1215, 1192, 1176, 1140, 1107, 1082, 1065, 1007, 978, 946, 912, 879, 852, 808, 791, 753, 724, 708, 685, 649, 618, 561, 521, 474, 396, 348, 131, 1, 56)) 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 logged_out

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /news/?locale=es1111111111111'%20UNION%20SELECT%20CHAR(45,120,49,45,81,45)--%20%20
            Cookies: {}
            Endpoint: news
            View Args: {}
            Person: logged_out
            Referrer: None
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: 68.65.121.149, 172.68.47.254
Cf-Ray: 4972365f9bad793c-LAX
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
Cf-Connecting-Ip: 68.65.121.149
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 (31105, 31062, 31048, 31027, 30984, 30757, 30745, 30739, 30719, 30694, 30644, 30603, 30585, 30571, 30532, 30454, 30412, 30401, 30368, 30319, 30219, 30150, 30116, 30087, 29991, 29894, 29824, 29798, 29783, 29691, 29484, 29414, 29364, 29337, 29248, 29048, 28947, 28921, 28876, 28749, 28584, 28490, 28438, 28387, 28250, 28068, 27991, 27954, 27892, 27480, 27282, 27170, 27118, 27056, 26920, 26682, 26543, 26472, 26421, 26233, 25978, 25799, 25691, 25585, 25228, 25168, 25124, 25098, 25084, 25018, 24882, 24824, 24768, 24721, 24599, 24369, 24232, 24171, 24119, 23989, 23816, 23740, 23702, 23656, 23533, 23341, 23230, 23186, 23152, 22992, 22774, 22674, 22630, 22581, 22445, 22254, 22152, 22114, 22049, 21909, 21751, 21635, 21569, 21513, 21359, 21099, 20983, 20927, 20873, 20756, 20581, 20521, 20474, 20436, 20306, 20148, 20048, 19984, 19923, 19785, 19484, 19271, 19193, 19088, 18828, 18742, 18691, 18667, 18560, 18571, 18587, 18607, 18617, 18632, 18637, 17734, 17675, 17625, 17567, 17471, 17341, 17280, 17263, 17231, 17150, 17047, 16988, 16959, 16922, 16826, 16611, 16473, 16438, 16367, 16253, 16132, 16038, 16003, 15966, 15875, 15657, 15563, 15531, 15480, 15380, 15206, 15085, 15036, 15004, 14877, 14694, 14549, 14502, 14441, 14299, 14100, 13971, 13909, 22516, 13618, 13546, 13513, 13476, 13449, 13420, 13379, 22882, 13256, 13214, 13174, 13118, 13094, 12979, 12904, 12884, 12846, 12791, 12754, 12629, 12425, 12503, 12381, 12335, 12268, 12079, 12026, 11986, 11966, 11853, 11702, 11626, 11588, 11557, 11466, 11349, 11242, 11281, 11213, 11095, 10886, 10758, 10795, 10730, 10623, 10474, 10359, 10420, 10325, 10221, 10113, 10034, 9974, 9967, 9931, 9829, 9678, 9568, 9605, 9528, 9439, 9202, 9111, 9040, 8924, 8769, 8701, 8628, 8549, 8294, 8184, 8049, 7907, 7828, 7782, 7764, 7696, 7610, 7545, 7489, 7411, 7306, 7211, 7180, 7129, 7047, 6996, 6963, 6907, 6813, 6750, 6726, 6671, 6598, 6560, 6507, 6467, 6341, 6256, 6211, 6139, 6093, 6063, 6008, 5968, 5867, 5844, 5795, 5760, 5659, 5601, 5548, 5477, 5409, 5370, 5324, 5286, 5182, 5158, 5121, 5087, 5029, 4994, 4931, 4853, 4815, 4756, 4718, 4653, 4584, 4493, 4425, 4327, 4309, 4280, 4263, 4221, 4189, 4165, 4134, 4106, 4083, 4026, 4000, 3934, 3902, 3887, 3852, 3812, 3771, 3723, 3669, 3623, 3582, 3531, 3476, 3401, 3272, 3217, 3127, 3059, 3029, 2500, 2429, 2383, 2344, 2333, 2306, 2210, 2185, 2161, 2130, 2109, 2082, 2062, 2047, 2010, 1971, 1931, 1890, 1848, 1827, 1760, 1699, 1672, 1644, 1605, 1582, 1554, 1537, 1518, 1502, 1487, 1462, 1445, 1421, 1406, 1391, 1372, 1361, 1346, 1338, 1314, 1232, 1246, 1258, 1290, 1215, 1192, 1176, 1140, 1107, 1082, 1065, 1007, 978, 946, 912, 879, 852, 808, 791, 753, 724, 708, 685, 649, 618, 561, 521, 474, 396, 348, 131, 1, 56)) 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/cache.py", line 79, in decorated_function
    response = make_response(f(*args, **kwargs))
  File "./decksite/main.py", line 278, in news
    news_items = ns.all_news()
  File "./decksite/data/news.py", line 23, in all_news
    news += tournament_winners(start_date, end_date, max_items)
  File "./decksite/data/news.py", line 91, in tournament_winners
    ds = deck.load_decks(where, limit=f'LIMIT {max_items}')
  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: 91b4d2319f45aa95b7f74130e0d57d74fec7c052

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /news/

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 (31105, 31062, 31048, 31027, 30984, 30757, 30745, 30739, 30719, 30694, 30644, 30603, 30585, 30571, 30532, 30454, 30412, 30401, 30368, 30319, 30219, 30150, 30116, 30087, 29991, 29894, 29824, 29798, 29783, 29691, 29484, 29414, 29364, 29337, 29248, 29048, 28947, 28921, 28876, 28749, 28584, 28490, 28438, 28387, 28250, 28068, 27991, 27954, 27892, 27480, 27282, 27170, 27118, 27056, 26920, 26682, 26543, 26472, 26421, 26233, 25978, 25799, 25691, 25585, 25228, 25168, 25124, 25098, 25084, 25018, 24882, 24824, 24768, 24721, 24599, 24369, 24232, 24171, 24119, 23989, 23816, 23740, 23702, 23656, 23533, 23341, 23230, 23186, 23152, 22992, 22774, 22674, 22630, 22581, 22445, 22254, 22152, 22114, 22049, 21909, 21751, 21635, 21569, 21513, 21359, 21099, 20983, 20927, 20873, 20756, 20581, 20521, 20474, 20436, 20306, 20148, 20048, 19984, 19923, 19785, 19484, 19271, 19193, 19088, 18828, 18742, 18691, 18667, 18560, 18571, 18587, 18607, 18617, 18632, 18637, 17734, 17675, 17625, 17567, 17471, 17341, 17280, 17263, 17231, 17150, 17047, 16988, 16959, 16922, 16826, 16611, 16473, 16438, 16367, 16253, 16132, 16038, 16003, 15966, 15875, 15657, 15563, 15531, 15480, 15380, 15206, 15085, 15036, 15004, 14877, 14694, 14549, 14502, 14441, 14299, 14100, 13971, 13909, 22516, 13618, 13546, 13513, 13476, 13449, 13420, 13379, 22882, 13256, 13214, 13174, 13118, 13094, 12979, 12904, 12884, 12846, 12791, 12754, 12629, 12503, 12425, 12381, 12335, 12268, 12079, 12026, 11986, 11966, 11853, 11702, 11626, 11588, 11557, 11466, 11349, 11281, 11242, 11213, 11095, 10886, 10795, 10758, 10730, 10623, 10474, 10420, 10359, 10325, 10221, 10113, 10034, 9974, 9967, 9931, 9829, 9678, 9605, 9568, 9528, 9439, 9202, 9111, 9040, 8924, 8769, 8701, 8628, 8549, 8294, 8184, 8049, 7907, 7828, 7782, 7764, 7696, 7610, 7545, 7489, 7411, 7306, 7211, 7180, 7129, 7047, 6996, 6963, 6907, 6813, 6750, 6726, 6671, 6598, 6560, 6507, 6467, 6341, 6256, 6211, 6139, 6093, 6063, 6008, 5968, 5867, 5844, 5795, 5760, 5659, 5601, 5548, 5477, 5409, 5370, 5324, 5286, 5182, 5158, 5121, 5087, 5029, 4994, 4931, 4853, 4815, 4756, 4718, 4653, 4584, 4493, 4425, 4327, 4309, 4280, 4263, 4221, 4189, 4165, 4134, 4106, 4083, 4026, 4000, 3934, 3902, 3887, 3852, 3812, 3771, 3723, 3669, 3623, 3582, 3531, 3476, 3401, 3272, 3217, 3127, 3059, 3029, 2500, 2429, 2383, 2344, 2333, 2306, 2210, 2185, 2161, 2130, 2109, 2082, 2062, 2047, 2010, 1971, 1931, 1890, 1848, 1827, 1760, 1699, 1672, 1644, 1605, 1582, 1554, 1537, 1518, 1502, 1487, 1462, 1445, 1421, 1406, 1391, 1372, 1361, 1346, 1338, 1314, 1232, 1246, 1258, 1290, 1215, 1192, 1176, 1140, 1107, 1082, 1065, 1007, 978, 946, 912, 879, 852, 808, 791, 753, 724, 708, 685, 649, 618, 561, 521, 474, 396, 348, 131, 1, 56)) 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 logged_out

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /news/?locale=es1111111111111'%20UNION%20SELECT%20CHAR(45,120,49,45,81,45),CHAR(45,120,50,45,81,45)--%20%20
            Cookies: {}
            Endpoint: news
            View Args: {}
            Person: logged_out
            Referrer: None
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: 68.65.121.149, 162.158.59.84
Cf-Ray: 4972366d9ea87942-LAX
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
Cf-Connecting-Ip: 68.65.121.149
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 (31105, 31062, 31048, 31027, 30984, 30757, 30745, 30739, 30719, 30694, 30644, 30603, 30585, 30571, 30532, 30454, 30412, 30401, 30368, 30319, 30219, 30150, 30116, 30087, 29991, 29894, 29824, 29798, 29783, 29691, 29484, 29414, 29364, 29337, 29248, 29048, 28947, 28921, 28876, 28749, 28584, 28490, 28438, 28387, 28250, 28068, 27991, 27954, 27892, 27480, 27282, 27170, 27118, 27056, 26920, 26682, 26543, 26472, 26421, 26233, 25978, 25799, 25691, 25585, 25228, 25168, 25124, 25098, 25084, 25018, 24882, 24824, 24768, 24721, 24599, 24369, 24232, 24171, 24119, 23989, 23816, 23740, 23702, 23656, 23533, 23341, 23230, 23186, 23152, 22992, 22774, 22674, 22630, 22581, 22445, 22254, 22152, 22114, 22049, 21909, 21751, 21635, 21569, 21513, 21359, 21099, 20983, 20927, 20873, 20756, 20581, 20521, 20474, 20436, 20306, 20148, 20048, 19984, 19923, 19785, 19484, 19271, 19193, 19088, 18828, 18742, 18691, 18667, 18560, 18571, 18587, 18607, 18617, 18632, 18637, 17734, 17675, 17625, 17567, 17471, 17341, 17280, 17263, 17231, 17150, 17047, 16988, 16959, 16922, 16826, 16611, 16473, 16438, 16367, 16253, 16132, 16038, 16003, 15966, 15875, 15657, 15563, 15531, 15480, 15380, 15206, 15085, 15036, 15004, 14877, 14694, 14549, 14502, 14441, 14299, 14100, 13971, 13909, 22516, 13618, 13546, 13513, 13476, 13449, 13420, 13379, 22882, 13256, 13214, 13174, 13118, 13094, 12979, 12904, 12884, 12846, 12791, 12754, 12629, 12503, 12425, 12381, 12335, 12268, 12079, 12026, 11986, 11966, 11853, 11702, 11626, 11588, 11557, 11466, 11349, 11281, 11242, 11213, 11095, 10886, 10795, 10758, 10730, 10623, 10474, 10420, 10359, 10325, 10221, 10113, 10034, 9974, 9967, 9931, 9829, 9678, 9605, 9568, 9528, 9439, 9202, 9111, 9040, 8924, 8769, 8701, 8628, 8549, 8294, 8184, 8049, 7907, 7828, 7782, 7764, 7696, 7610, 7545, 7489, 7411, 7306, 7211, 7180, 7129, 7047, 6996, 6963, 6907, 6813, 6750, 6726, 6671, 6598, 6560, 6507, 6467, 6341, 6256, 6211, 6139, 6093, 6063, 6008, 5968, 5867, 5844, 5795, 5760, 5659, 5601, 5548, 5477, 5409, 5370, 5324, 5286, 5182, 5158, 5121, 5087, 5029, 4994, 4931, 4853, 4815, 4756, 4718, 4653, 4584, 4493, 4425, 4327, 4309, 4280, 4263, 4221, 4189, 4165, 4134, 4106, 4083, 4026, 4000, 3934, 3902, 3887, 3852, 3812, 3771, 3723, 3669, 3623, 3582, 3531, 3476, 3401, 3272, 3217, 3127, 3059, 3029, 2500, 2429, 2383, 2344, 2333, 2306, 2210, 2185, 2161, 2130, 2109, 2082, 2062, 2047, 2010, 1971, 1931, 1890, 1848, 1827, 1760, 1699, 1672, 1644, 1605, 1582, 1554, 1537, 1518, 1502, 1487, 1462, 1445, 1421, 1406, 1391, 1372, 1361, 1346, 1338, 1314, 1232, 1246, 1258, 1290, 1215, 1192, 1176, 1140, 1107, 1082, 1065, 1007, 978, 946, 912, 879, 852, 808, 791, 753, 724, 708, 685, 649, 618, 561, 521, 474, 396, 348, 131, 1, 56)) 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/cache.py", line 79, in decorated_function
    response = make_response(f(*args, **kwargs))
  File "./decksite/main.py", line 278, in news
    news_items = ns.all_news()
  File "./decksite/data/news.py", line 23, in all_news
    news += tournament_winners(start_date, end_date, max_items)
  File "./decksite/data/news.py", line 91, in tournament_winners
    ds = deck.load_decks(where, limit=f'LIMIT {max_items}')
  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: 91b4d2319f45aa95b7f74130e0d57d74fec7c052

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /news/

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 (31105, 31062, 31048, 31027, 30984, 30757, 30745, 30739, 30719, 30694, 30644, 30603, 30585, 30571, 30532, 30454, 30412, 30401, 30368, 30319, 30219, 30150, 30116, 30087, 29991, 29894, 29824, 29798, 29783, 29691, 29484, 29414, 29364, 29337, 29248, 29048, 28947, 28921, 28876, 28749, 28584, 28490, 28438, 28387, 28250, 28068, 27991, 27954, 27892, 27480, 27282, 27170, 27118, 27056, 26920, 26682, 26543, 26472, 26421, 26233, 25978, 25799, 25691, 25585, 25228, 25168, 25124, 25098, 25084, 25018, 24882, 24824, 24768, 24721, 24599, 24369, 24232, 24171, 24119, 23989, 23816, 23740, 23702, 23656, 23533, 23341, 23230, 23186, 23152, 22992, 22774, 22674, 22630, 22581, 22445, 22254, 22152, 22114, 22049, 21909, 21751, 21635, 21569, 21513, 21359, 21099, 20983, 20927, 20873, 20756, 20581, 20521, 20474, 20436, 20306, 20148, 20048, 19984, 19923, 19785, 19484, 19271, 19193, 19088, 18828, 18742, 18691, 18667, 18560, 18571, 18587, 18607, 18617, 18632, 18637, 17734, 17675, 17625, 17567, 17471, 17341, 17280, 17263, 17231, 17150, 17047, 16988, 16959, 16922, 16826, 16611, 16473, 16438, 16367, 16253, 16132, 16038, 16003, 15966, 15875, 15657, 15563, 15531, 15480, 15380, 15206, 15085, 15036, 15004, 14877, 14694, 14549, 14502, 14441, 14299, 14100, 13971, 13909, 22516, 13618, 13546, 13513, 13476, 13449, 13420, 13379, 22882, 13256, 13214, 13174, 13118, 13094, 12979, 12904, 12884, 12846, 12791, 12754, 12629, 12425, 12503, 12381, 12335, 12268, 12079, 12026, 11986, 11966, 11853, 11702, 11588, 11626, 11557, 11466, 11349, 11242, 11281, 11213, 11095, 10886, 10758, 10795, 10730, 10623, 10474, 10420, 10359, 10325, 10221, 10113, 10034, 9974, 9967, 9931, 9829, 9678, 9568, 9605, 9528, 9439, 9202, 9111, 9040, 8924, 8769, 8701, 8628, 8549, 8294, 8184, 8049, 7907, 7828, 7782, 7764, 7696, 7610, 7545, 7489, 7411, 7306, 7211, 7180, 7129, 7047, 6996, 6963, 6907, 6813, 6750, 6726, 6671, 6598, 6560, 6507, 6467, 6341, 6256, 6211, 6139, 6093, 6063, 6008, 5968, 5867, 5844, 5795, 5760, 5659, 5601, 5548, 5477, 5409, 5370, 5324, 5286, 5182, 5158, 5121, 5087, 5029, 4994, 4931, 4853, 4815, 4756, 4718, 4653, 4584, 4493, 4425, 4327, 4309, 4280, 4263, 4221, 4189, 4165, 4134, 4106, 4083, 4026, 4000, 3934, 3902, 3887, 3852, 3812, 3771, 3723, 3669, 3623, 3582, 3531, 3476, 3401, 3272, 3217, 3127, 3059, 3029, 2500, 2429, 2383, 2344, 2333, 2306, 2210, 2185, 2161, 2130, 2109, 2082, 2062, 2047, 2010, 1971, 1931, 1890, 1848, 1827, 1760, 1699, 1672, 1644, 1605, 1582, 1554, 1537, 1518, 1502, 1487, 1462, 1445, 1421, 1406, 1391, 1372, 1361, 1346, 1338, 1314, 1232, 1246, 1258, 1290, 1215, 1192, 1176, 1140, 1107, 1082, 1065, 1007, 978, 946, 912, 879, 852, 808, 791, 753, 724, 708, 685, 649, 618, 561, 521, 474, 396, 348, 131, 1, 56)) 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 logged_out

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /news/?locale=es1111111111111'%20UNION%20SELECT%20CHAR(45,120,49,45,81,45),CHAR(45,120,50,45,81,45),CHAR(45,120,51,45,81,45)--%20%20
            Cookies: {}
            Endpoint: news
            View Args: {}
            Person: logged_out
            Referrer: None
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: 68.65.121.149, 108.162.215.42
Cf-Ray: 4972367ba9b076d6-LAX
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
Cf-Connecting-Ip: 68.65.121.149
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 (31105, 31062, 31048, 31027, 30984, 30757, 30745, 30739, 30719, 30694, 30644, 30603, 30585, 30571, 30532, 30454, 30412, 30401, 30368, 30319, 30219, 30150, 30116, 30087, 29991, 29894, 29824, 29798, 29783, 29691, 29484, 29414, 29364, 29337, 29248, 29048, 28947, 28921, 28876, 28749, 28584, 28490, 28438, 28387, 28250, 28068, 27991, 27954, 27892, 27480, 27282, 27170, 27118, 27056, 26920, 26682, 26543, 26472, 26421, 26233, 25978, 25799, 25691, 25585, 25228, 25168, 25124, 25098, 25084, 25018, 24882, 24824, 24768, 24721, 24599, 24369, 24232, 24171, 24119, 23989, 23816, 23740, 23702, 23656, 23533, 23341, 23230, 23186, 23152, 22992, 22774, 22674, 22630, 22581, 22445, 22254, 22152, 22114, 22049, 21909, 21751, 21635, 21569, 21513, 21359, 21099, 20983, 20927, 20873, 20756, 20581, 20521, 20474, 20436, 20306, 20148, 20048, 19984, 19923, 19785, 19484, 19271, 19193, 19088, 18828, 18742, 18691, 18667, 18560, 18571, 18587, 18607, 18617, 18632, 18637, 17734, 17675, 17625, 17567, 17471, 17341, 17280, 17263, 17231, 17150, 17047, 16988, 16959, 16922, 16826, 16611, 16473, 16438, 16367, 16253, 16132, 16038, 16003, 15966, 15875, 15657, 15563, 15531, 15480, 15380, 15206, 15085, 15036, 15004, 14877, 14694, 14549, 14502, 14441, 14299, 14100, 13971, 13909, 22516, 13618, 13546, 13513, 13476, 13449, 13420, 13379, 22882, 13256, 13214, 13174, 13118, 13094, 12979, 12904, 12884, 12846, 12791, 12754, 12629, 12425, 12503, 12381, 12335, 12268, 12079, 12026, 11986, 11966, 11853, 11702, 11588, 11626, 11557, 11466, 11349, 11242, 11281, 11213, 11095, 10886, 10758, 10795, 10730, 10623, 10474, 10420, 10359, 10325, 10221, 10113, 10034, 9974, 9967, 9931, 9829, 9678, 9568, 9605, 9528, 9439, 9202, 9111, 9040, 8924, 8769, 8701, 8628, 8549, 8294, 8184, 8049, 7907, 7828, 7782, 7764, 7696, 7610, 7545, 7489, 7411, 7306, 7211, 7180, 7129, 7047, 6996, 6963, 6907, 6813, 6750, 6726, 6671, 6598, 6560, 6507, 6467, 6341, 6256, 6211, 6139, 6093, 6063, 6008, 5968, 5867, 5844, 5795, 5760, 5659, 5601, 5548, 5477, 5409, 5370, 5324, 5286, 5182, 5158, 5121, 5087, 5029, 4994, 4931, 4853, 4815, 4756, 4718, 4653, 4584, 4493, 4425, 4327, 4309, 4280, 4263, 4221, 4189, 4165, 4134, 4106, 4083, 4026, 4000, 3934, 3902, 3887, 3852, 3812, 3771, 3723, 3669, 3623, 3582, 3531, 3476, 3401, 3272, 3217, 3127, 3059, 3029, 2500, 2429, 2383, 2344, 2333, 2306, 2210, 2185, 2161, 2130, 2109, 2082, 2062, 2047, 2010, 1971, 1931, 1890, 1848, 1827, 1760, 1699, 1672, 1644, 1605, 1582, 1554, 1537, 1518, 1502, 1487, 1462, 1445, 1421, 1406, 1391, 1372, 1361, 1346, 1338, 1314, 1232, 1246, 1258, 1290, 1215, 1192, 1176, 1140, 1107, 1082, 1065, 1007, 978, 946, 912, 879, 852, 808, 791, 753, 724, 708, 685, 649, 618, 561, 521, 474, 396, 348, 131, 1, 56)) 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/cache.py", line 79, in decorated_function
    response = make_response(f(*args, **kwargs))
  File "./decksite/main.py", line 278, in news
    news_items = ns.all_news()
  File "./decksite/data/news.py", line 23, in all_news
    news += tournament_winners(start_date, end_date, max_items)
  File "./decksite/data/news.py", line 91, in tournament_winners
    ds = deck.load_decks(where, limit=f'LIMIT {max_items}')
  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: 91b4d2319f45aa95b7f74130e0d57d74fec7c052

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /news/

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 (31105, 31062, 31048, 31027, 30984, 30757, 30745, 30739, 30719, 30694, 30644, 30603, 30585, 30571, 30532, 30454, 30412, 30401, 30368, 30319, 30219, 30150, 30116, 30087, 29991, 29894, 29824, 29798, 29783, 29691, 29484, 29414, 29364, 29337, 29248, 29048, 28947, 28921, 28876, 28749, 28584, 28490, 28438, 28387, 28250, 28068, 27991, 27954, 27892, 27480, 27282, 27170, 27118, 27056, 26920, 26682, 26543, 26472, 26421, 26233, 25978, 25799, 25691, 25585, 25228, 25168, 25124, 25098, 25084, 25018, 24882, 24824, 24768, 24721, 24599, 24369, 24232, 24171, 24119, 23989, 23816, 23740, 23702, 23656, 23533, 23341, 23230, 23186, 23152, 22992, 22774, 22674, 22630, 22581, 22445, 22254, 22152, 22114, 22049, 21909, 21751, 21635, 21569, 21513, 21359, 21099, 20983, 20927, 20873, 20756, 20581, 20521, 20474, 20436, 20306, 20148, 20048, 19984, 19923, 19785, 19484, 19271, 19193, 19088, 18828, 18742, 18691, 18667, 18560, 18571, 18587, 18607, 18617, 18632, 18637, 17734, 17675, 17625, 17567, 17471, 17341, 17280, 17263, 17231, 17150, 17047, 16988, 16959, 16922, 16826, 16611, 16473, 16438, 16367, 16253, 16132, 16038, 16003, 15966, 15875, 15657, 15563, 15531, 15480, 15380, 15206, 15085, 15036, 15004, 14877, 14694, 14549, 14502, 14441, 14299, 14100, 13971, 13909, 22516, 13618, 13546, 13513, 13476, 13449, 13420, 13379, 22882, 13256, 13214, 13174, 13118, 13094, 12979, 12904, 12884, 12846, 12791, 12754, 12629, 12503, 12425, 12381, 12335, 12268, 12079, 12026, 11986, 11966, 11853, 11702, 11626, 11588, 11557, 11466, 11349, 11281, 11242, 11213, 11095, 10886, 10795, 10758, 10730, 10623, 10474, 10420, 10359, 10325, 10221, 10113, 9974, 10034, 9967, 9931, 9829, 9678, 9605, 9568, 9528, 9439, 9202, 9111, 9040, 8924, 8769, 8701, 8628, 8549, 8294, 8184, 8049, 7907, 7828, 7782, 7764, 7696, 7610, 7545, 7489, 7411, 7306, 7211, 7180, 7129, 7047, 6996, 6963, 6907, 6813, 6750, 6726, 6671, 6598, 6560, 6507, 6467, 6341, 6256, 6211, 6139, 6093, 6063, 6008, 5968, 5867, 5844, 5795, 5760, 5659, 5601, 5548, 5477, 5409, 5370, 5324, 5286, 5182, 5158, 5121, 5087, 5029, 4994, 4931, 4853, 4815, 4756, 4718, 4653, 4584, 4493, 4425, 4327, 4309, 4280, 4263, 4221, 4189, 4165, 4134, 4106, 4083, 4026, 4000, 3934, 3902, 3887, 3852, 3812, 3771, 3723, 3669, 3623, 3582, 3531, 3476, 3401, 3272, 3217, 3127, 3059, 3029, 2500, 2429, 2383, 2344, 2333, 2306, 2210, 2185, 2161, 2130, 2109, 2082, 2062, 2047, 2010, 1971, 1931, 1890, 1848, 1827, 1760, 1699, 1672, 1644, 1605, 1582, 1554, 1537, 1518, 1502, 1487, 1462, 1445, 1421, 1406, 1391, 1372, 1361, 1346, 1338, 1314, 1232, 1246, 1258, 1290, 1215, 1192, 1176, 1140, 1107, 1082, 1065, 1007, 978, 946, 912, 879, 852, 808, 791, 753, 724, 708, 685, 649, 618, 561, 521, 474, 396, 348, 131, 1, 56)) 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 logged_out

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /news/?locale=es1111111111111'%20UNION%20SELECT%20CHAR(45,120,49,45,81,45),CHAR(45,120,50,45,81,45),CHAR(45,120,51,45,81,45),CHAR(45,120,52,45,81,45)--%20%20
            Cookies: {}
            Endpoint: news
            View Args: {}
            Person: logged_out
            Referrer: None
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: 68.65.121.149, 162.158.59.84
Cf-Ray: 49723689ae3d7942-LAX
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
Cf-Connecting-Ip: 68.65.121.149
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 (31105, 31062, 31048, 31027, 30984, 30757, 30745, 30739, 30719, 30694, 30644, 30603, 30585, 30571, 30532, 30454, 30412, 30401, 30368, 30319, 30219, 30150, 30116, 30087, 29991, 29894, 29824, 29798, 29783, 29691, 29484, 29414, 29364, 29337, 29248, 29048, 28947, 28921, 28876, 28749, 28584, 28490, 28438, 28387, 28250, 28068, 27991, 27954, 27892, 27480, 27282, 27170, 27118, 27056, 26920, 26682, 26543, 26472, 26421, 26233, 25978, 25799, 25691, 25585, 25228, 25168, 25124, 25098, 25084, 25018, 24882, 24824, 24768, 24721, 24599, 24369, 24232, 24171, 24119, 23989, 23816, 23740, 23702, 23656, 23533, 23341, 23230, 23186, 23152, 22992, 22774, 22674, 22630, 22581, 22445, 22254, 22152, 22114, 22049, 21909, 21751, 21635, 21569, 21513, 21359, 21099, 20983, 20927, 20873, 20756, 20581, 20521, 20474, 20436, 20306, 20148, 20048, 19984, 19923, 19785, 19484, 19271, 19193, 19088, 18828, 18742, 18691, 18667, 18560, 18571, 18587, 18607, 18617, 18632, 18637, 17734, 17675, 17625, 17567, 17471, 17341, 17280, 17263, 17231, 17150, 17047, 16988, 16959, 16922, 16826, 16611, 16473, 16438, 16367, 16253, 16132, 16038, 16003, 15966, 15875, 15657, 15563, 15531, 15480, 15380, 15206, 15085, 15036, 15004, 14877, 14694, 14549, 14502, 14441, 14299, 14100, 13971, 13909, 22516, 13618, 13546, 13513, 13476, 13449, 13420, 13379, 22882, 13256, 13214, 13174, 13118, 13094, 12979, 12904, 12884, 12846, 12791, 12754, 12629, 12503, 12425, 12381, 12335, 12268, 12079, 12026, 11986, 11966, 11853, 11702, 11626, 11588, 11557, 11466, 11349, 11281, 11242, 11213, 11095, 10886, 10795, 10758, 10730, 10623, 10474, 10420, 10359, 10325, 10221, 10113, 9974, 10034, 9967, 9931, 9829, 9678, 9605, 9568, 9528, 9439, 9202, 9111, 9040, 8924, 8769, 8701, 8628, 8549, 8294, 8184, 8049, 7907, 7828, 7782, 7764, 7696, 7610, 7545, 7489, 7411, 7306, 7211, 7180, 7129, 7047, 6996, 6963, 6907, 6813, 6750, 6726, 6671, 6598, 6560, 6507, 6467, 6341, 6256, 6211, 6139, 6093, 6063, 6008, 5968, 5867, 5844, 5795, 5760, 5659, 5601, 5548, 5477, 5409, 5370, 5324, 5286, 5182, 5158, 5121, 5087, 5029, 4994, 4931, 4853, 4815, 4756, 4718, 4653, 4584, 4493, 4425, 4327, 4309, 4280, 4263, 4221, 4189, 4165, 4134, 4106, 4083, 4026, 4000, 3934, 3902, 3887, 3852, 3812, 3771, 3723, 3669, 3623, 3582, 3531, 3476, 3401, 3272, 3217, 3127, 3059, 3029, 2500, 2429, 2383, 2344, 2333, 2306, 2210, 2185, 2161, 2130, 2109, 2082, 2062, 2047, 2010, 1971, 1931, 1890, 1848, 1827, 1760, 1699, 1672, 1644, 1605, 1582, 1554, 1537, 1518, 1502, 1487, 1462, 1445, 1421, 1406, 1391, 1372, 1361, 1346, 1338, 1314, 1232, 1246, 1258, 1290, 1215, 1192, 1176, 1140, 1107, 1082, 1065, 1007, 978, 946, 912, 879, 852, 808, 791, 753, 724, 708, 685, 649, 618, 561, 521, 474, 396, 348, 131, 1, 56)) 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/cache.py", line 79, in decorated_function
    response = make_response(f(*args, **kwargs))
  File "./decksite/main.py", line 278, in news
    news_items = ns.all_news()
  File "./decksite/data/news.py", line 23, in all_news
    news += tournament_winners(start_date, end_date, max_items)
  File "./decksite/data/news.py", line 91, in tournament_winners
    ds = deck.load_decks(where, limit=f'LIMIT {max_items}')
  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: 91b4d2319f45aa95b7f74130e0d57d74fec7c052

Labels: decksite; DatabaseException

vorpal-buildbot commented 5 years ago

500 error at /news/

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 (31105, 31062, 31048, 31027, 30984, 30757, 30745, 30739, 30719, 30694, 30644, 30603, 30585, 30571, 30532, 30454, 30412, 30401, 30368, 30319, 30219, 30150, 30116, 30087, 29991, 29894, 29824, 29798, 29783, 29691, 29484, 29414, 29364, 29337, 29248, 29048, 28947, 28921, 28876, 28749, 28584, 28490, 28438, 28387, 28250, 28068, 27991, 27954, 27892, 27480, 27282, 27170, 27118, 27056, 26920, 26682, 26543, 26472, 26421, 26233, 25978, 25799, 25691, 25585, 25228, 25168, 25124, 25098, 25084, 25018, 24882, 24824, 24768, 24721, 24599, 24369, 24232, 24171, 24119, 23989, 23816, 23740, 23702, 23656, 23533, 23341, 23230, 23186, 23152, 22992, 22774, 22674, 22630, 22581, 22445, 22254, 22152, 22114, 22049, 21909, 21751, 21635, 21569, 21513, 21359, 21099, 20983, 20927, 20873, 20756, 20581, 20521, 20474, 20436, 20306, 20148, 20048, 19984, 19923, 19785, 19484, 19271, 19193, 19088, 18828, 18742, 18691, 18667, 18560, 18571, 18587, 18607, 18617, 18632, 18637, 17734, 17675, 17625, 17567, 17471, 17341, 17280, 17263, 17231, 17150, 17047, 16988, 16959, 16922, 16826, 16611, 16473, 16438, 16367, 16253, 16132, 16038, 16003, 15966, 15875, 15657, 15563, 15531, 15480, 15380, 15206, 15085, 15036, 15004, 14877, 14694, 14549, 14502, 14441, 14299, 14100, 13971, 13909, 22516, 13618, 13546, 13513, 13476, 13449, 13420, 13379, 22882, 13256, 13214, 13174, 13118, 13094, 12979, 12904, 12884, 12846, 12791, 12754, 12629, 12503, 12425, 12381, 12335, 12268, 12079, 12026, 11986, 11966, 11853, 11702, 11626, 11588, 11557, 11466, 11349, 11281, 11242, 11213, 11095, 10886, 10795, 10758, 10730, 10623, 10474, 10420, 10359, 10325, 10221, 10113, 10034, 9974, 9967, 9931, 9829, 9678, 9605, 9568, 9528, 9439, 9202, 9111, 9040, 8924, 8769, 8701, 8628, 8549, 8294, 8184, 8049, 7907, 7828, 7782, 7764, 7696, 7610, 7545, 7489, 7411, 7306, 7211, 7180, 7129, 7047, 6996, 6963, 6907, 6813, 6750, 6726, 6671, 6598, 6560, 6507, 6467, 6341, 6256, 6211, 6139, 6093, 6063, 6008, 5968, 5867, 5844, 5795, 5760, 5659, 5601, 5548, 5477, 5409, 5370, 5324, 5286, 5182, 5158, 5121, 5087, 5029, 4994, 4931, 4853, 4815, 4756, 4718, 4653, 4584, 4493, 4425, 4327, 4309, 4280, 4263, 4221, 4189, 4165, 4134, 4106, 4083, 4026, 4000, 3934, 3902, 3887, 3852, 3812, 3771, 3723, 3669, 3623, 3582, 3531, 3476, 3401, 3272, 3217, 3127, 3059, 3029, 2500, 2429, 2383, 2344, 2333, 2306, 2210, 2185, 2161, 2130, 2109, 2082, 2062, 2047, 2010, 1971, 1931, 1890, 1848, 1827, 1760, 1699, 1672, 1644, 1605, 1582, 1554, 1537, 1518, 1502, 1487, 1462, 1445, 1421, 1406, 1391, 1372, 1361, 1346, 1338, 1314, 1232, 1246, 1258, 1290, 1215, 1192, 1176, 1140, 1107, 1082, 1065, 1007, 978, 946, 912, 879, 852, 808, 791, 753, 724, 708, 685, 649, 618, 561, 521, 474, 396, 348, 131, 1, 56)) 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 logged_out

            --------------------------------------------------------------------------------
            Request Method: GET
            Path: /news/?locale=es1111111111111'%20UNION%20SELECT%20CHAR(45,120,49,45,81,45),CHAR(45,120,50,45,81,45),CHAR(45,120,51,45,81,45),CHAR(45,120,52,45,81,45),CHAR(45,120,53,45,81,45)--%20%20
            Cookies: {}
            Endpoint: news
            View Args: {}
            Person: logged_out
            Referrer: None
            Request Data: {}
Host: pennydreadfulmagic.com
Accept-Encoding: gzip
Cf-Ipcountry: US
X-Forwarded-For: 68.65.121.149, 108.162.215.144
Cf-Ray: 49723697baec77e4-LAX
X-Forwarded-Proto: https
Cf-Visitor: {"scheme":"https"}
Accept: */*
Cf-Connecting-Ip: 68.65.121.149
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 (31105, 31062, 31048, 31027, 30984, 30757, 30745, 30739, 30719, 30694, 30644, 30603, 30585, 30571, 30532, 30454, 30412, 30401, 30368, 30319, 30219, 30150, 30116, 30087, 29991, 29894, 29824, 29798, 29783, 29691, 29484, 29414, 29364, 29337, 29248, 29048, 28947, 28921, 28876, 28749, 28584, 28490, 28438, 28387, 28250, 28068, 27991, 27954, 27892, 27480, 27282, 27170, 27118, 27056, 26920, 26682, 26543, 26472, 26421, 26233, 25978, 25799, 25691, 25585, 25228, 25168, 25124, 25098, 25084, 25018, 24882, 24824, 24768, 24721, 24599, 24369, 24232, 24171, 24119, 23989, 23816, 23740, 23702, 23656, 23533, 23341, 23230, 23186, 23152, 22992, 22774, 22674, 22630, 22581, 22445, 22254, 22152, 22114, 22049, 21909, 21751, 21635, 21569, 21513, 21359, 21099, 20983, 20927, 20873, 20756, 20581, 20521, 20474, 20436, 20306, 20148, 20048, 19984, 19923, 19785, 19484, 19271, 19193, 19088, 18828, 18742, 18691, 18667, 18560, 18571, 18587, 18607, 18617, 18632, 18637, 17734, 17675, 17625, 17567, 17471, 17341, 17280, 17263, 17231, 17150, 17047, 16988, 16959, 16922, 16826, 16611, 16473, 16438, 16367, 16253, 16132, 16038, 16003, 15966, 15875, 15657, 15563, 15531, 15480, 15380, 15206, 15085, 15036, 15004, 14877, 14694, 14549, 14502, 14441, 14299, 14100, 13971, 13909, 22516, 13618, 13546, 13513, 13476, 13449, 13420, 13379, 22882, 13256, 13214, 13174, 13118, 13094, 12979, 12904, 12884, 12846, 12791, 12754, 12629, 12503, 12425, 12381, 12335, 12268, 12079, 12026, 11986, 11966, 11853, 11702, 11626, 11588, 11557, 11466, 11349, 11281, 11242, 11213, 11095, 10886, 10795, 10758, 10730, 10623, 10474, 10420, 10359, 10325, 10221, 10113, 10034, 9974, 9967, 9931, 9829, 9678, 9605, 9568, 9528, 9439, 9202, 9111, 9040, 8924, 8769, 8701, 8628, 8549, 8294, 8184, 8049, 7907, 7828, 7782, 7764, 7696, 7610, 7545, 7489, 7411, 7306, 7211, 7180, 7129, 7047, 6996, 6963, 6907, 6813, 6750, 6726, 6671, 6598, 6560, 6507, 6467, 6341, 6256, 6211, 6139, 6093, 6063, 6008, 5968, 5867, 5844, 5795, 5760, 5659, 5601, 5548, 5477, 5409, 5370, 5324, 5286, 5182, 5158, 5121, 5087, 5029, 4994, 4931, 4853, 4815, 4756, 4718, 4653, 4584, 4493, 4425, 4327, 4309, 4280, 4263, 4221, 4189, 4165, 4134, 4106, 4083, 4026, 4000, 3934, 3902, 3887, 3852, 3812, 3771, 3723, 3669, 3623, 3582, 3531, 3476, 3401, 3272, 3217, 3127, 3059, 3029, 2500, 2429, 2383, 2344, 2333, 2306, 2210, 2185, 2161, 2130, 2109, 2082, 2062, 2047, 2010, 1971, 1931, 1890, 1848, 1827, 1760, 1699, 1672, 1644, 1605, 1582, 1554, 1537, 1518, 1502, 1487, 1462, 1445, 1421, 1406, 1391, 1372, 1361, 1346, 1338, 1314, 1232, 1246, 1258, 1290, 1215, 1192, 1176, 1140, 1107, 1082, 1065, 1007, 978, 946, 912, 879, 852, 808, 791, 753, 724, 708, 685, 649, 618, 561, 521, 474, 396, 348, 131, 1, 56)) 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/cache.py", line 79, in decorated_function
    response = make_response(f(*args, **kwargs))
  File "./decksite/main.py", line 278, in news
    news_items = ns.all_news()
  File "./decksite/data/news.py", line 23, in all_news
    news += tournament_winners(start_date, end_date, max_items)
  File "./decksite/data/news.py", line 91, in tournament_winners
    ds = deck.load_decks(where, limit=f'LIMIT {max_items}')
  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: 91b4d2319f45aa95b7f74130e0d57d74fec7c052

Labels: decksite; DatabaseException