{"action":"closed","issue":{"url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/18977","repository_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports","labels_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/18977/labels{/name}","comments_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/18977/comments","events_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/18977/events","html_url":"https://github.com/PennyDreadfulMTG/perf-reports/issues/18977","id":316469559,"node_id":"MDU6SXNzdWUzMTY0Njk1NTk=","number":18977,"title":"500 error at /seasons/all/archetypes/151/","user":{"login":"vorpal-buildbot","id":23072004,"node_id":"MDQ6VXNlcjIzMDcyMDA0","avatar_url":"https://avatars2.githubusercontent.com/u/23072004?v=4","gravatar_id":"","url":"https://api.github.com/users/vorpal-buildbot","html_url":"https://github.com/vorpal-buildbot","followers_url":"https://api.github.com/users/vorpal-buildbot/followers","following_url":"https://api.github.com/users/vorpal-buildbot/following{/other_user}","gists_url":"https://api.github.com/users/vorpal-buildbot/gists{/gist_id}","starred_url":"https://api.github.com/users/vorpal-buildbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vorpal-buildbot/subscriptions","organizations_url":"https://api.github.com/users/vorpal-buildbot/orgs","repos_url":"https://api.github.com/users/vorpal-buildbot/repos","events_url":"https://api.github.com/users/vorpal-buildbot/events{/privacy}","received_events_url":"https://api.github.com/users/vorpal-buildbot/received_events","type":"User","site_admin":false},"labels":[{"id":763867617,"node_id":"MDU6TGFiZWw3NjM4Njc2MTc=","url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/labels/wontfix","name":"wontfix","color":"ffffff","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-21T07:19:52Z","updated_at":"2018-07-19T07:06:03Z","closed_at":"2018-07-19T07:06:03Z","author_association":"NONE","body":" Failed to execute `\n        SELECT\n            a.id,\n            a.name,\n            aca.ancestor AS parent_id,\n            \n        SUM(CASE WHEN TRUE THEN 1 ELSE 0 END) AS `all_num_decks`,\n        SUM(CASE WHEN TRUE THEN wins ELSE 0 END) AS `all_wins`,\n        SUM(CASE WHEN TRUE THEN losses ELSE 0 END) AS `all_losses`,\n        SUM(CASE WHEN TRUE THEN draws ELSE 0 END) AS `all_draws`,\n        SUM(CASE WHEN TRUE AND wins >= 5 AND losses = 0 AND d.source_id IN (SELECT id FROM source WHERE name = 'League') THEN 1 ELSE 0 END) AS all_perfect_runs,\n        SUM(CASE WHEN TRUE AND dsum.finish = 1 THEN 1 ELSE 0 END) AS `all_tournament_wins`,\n        SUM(CASE WHEN TRUE AND dsum.finish <= 8 THEN 1 ELSE 0 END) AS `all_tournament_top8s`,\n        IFNULL(ROUND((SUM(CASE WHEN TRUE THEN wins ELSE 0 END) / NULLIF(SUM(CASE WHEN TRUE THEN wins + losses ELSE 0 END), 0)) * 100, 1), '') AS `all_win_percent`\n    \n        FROM\n            archetype AS a\n        LEFT JOIN\n            archetype_closure AS aca ON a.id = aca.descendant AND aca.depth = 1\n        LEFT JOIN\n            archetype_closure AS acd ON a.id = acd.ancestor\n        LEFT JOIN\n            deck AS d ON acd.descendant = d.archetype_id\n        \n        LEFT JOIN\n            (\n        SELECT\n            `start`.id,\n            `start`.code,\n            `start`.start_date AS start_date,\n            `end`.start_date AS end_date\n        FROM\n            season AS `start`\n        LEFT JOIN\n            season AS `end` ON `end`.id = `start`.id + 1\n    ) AS season ON season.start_date <= d.created_date AND (season.end_date IS NULL OR season.end_date > d.created_date)\n    \n        \n        LEFT JOIN\n            (\n                SELECT\n                    d.id,\n                    d.created_date,\n                    d.finish,\n                    SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) AS wins, -- IFNULL so we still count byes as wins.\n                    SUM(CASE WHEN dm.games < odm.games THEN 1 ELSE 0 END) AS losses,\n                    SUM(CASE WHEN dm.games = odm.games THEN 1 ELSE 0 END) AS draws\n                FROM\n                    deck_match AS dm\n                INNER JOIN\n                    deck_match AS odm ON dm.match_id = odm.match_id AND dm.deck_id <> odm.deck_id\n                INNER JOIN\n                    deck AS d ON d.id = dm.deck_id\n                GROUP BY\n                    d.id\n            ) AS dsum ON d.id = dsum.id\n    \n        WHERE (all) AND (TRUE)\n        GROUP BY\n            a.id,\n            aca.ancestor -- aca.ancestor will be unique per a.id because of integrity constraints enforced elsewhere (each archetype has one ancestor) but we let the database know here.\n        ORDER BY\n            `all_num_decks` DESC, `all_wins` DESC, name\n    ` with `[]` because of `(1064, \"You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'all) AND (TRUE)\\n        GROUP BY\\n            a.id,\\n            aca.ancestor -- a' at line 57\")`\n\nReported on decksite by logged_out\n--------------------------------------------------------------------------------\nRequest Method: GET\nPath: /seasons/all/archetypes/151/?\nCookies: {}\nEndpoint: seasons.archetype\nView Args: {'archetype_id': '151'}\nPerson: logged_out\nReferrer: None\nRequest Data: {}\nHost: pennydreadfulmagic.com\nAccept-Encoding: gzip\nCf-Ipcountry: US\nX-Forwarded-For: 77.88.47.42, 172.68.182.156\nCf-Ray: 40ee15ac4d3b8691-ARN\nX-Forwarded-Proto: https\nCf-Visitor: {\"scheme\":\"https\"}\nUser-Agent: Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)\nFrom: support@search.yandex.ru\nAccept: */*\nAccept-Language: en, *;q=0.01\nCf-Connecting-Ip: 77.88.47.42\nX-Forwarded-Host: pennydreadfulmagic.com\nX-Forwarded-Server: pennydreadfulmagic.com\nConnection: Keep-Alive--------------------------------------------------------------------------------\nDatabaseException\nStack Trace:\n  File \"/home/discord/.local/lib/python3.6/site-packages/flask/app.py\", line 1997, in __call__\n    return self.wsgi_app(environ, start_response)\n  File \"/home/discord/.local/lib/python3.6/site-packages/flask/app.py\", line 1985, in wsgi_app\n    response = self.handle_exception(e)\n  File \"/home/discord/.local/lib/python3.6/site-packages/flask/app.py\", line 1982, in wsgi_app\n    response = self.full_dispatch_request()\n  File \"/home/discord/.local/lib/python3.6/site-packages/flask/app.py\", line 1614, in full_dispatch_request\n    rv = self.handle_user_exception(e)\n  File \"/home/discord/.local/lib/python3.6/site-packages/flask/app.py\", line 1517, in handle_user_exception\n    reraise(exc_type, exc_value, tb)\n  File \"/home/discord/.local/lib/python3.6/site-packages/flask/_compat.py\", line 33, in reraise\n    raise value\n  File \"/home/discord/.local/lib/python3.6/site-packages/flask/app.py\", line 1612, in full_dispatch_request\n    rv = self.dispatch_request()\n  File \"/home/discord/.local/lib/python3.6/site-packages/flask/app.py\", line 1598, in dispatch_request\n    return self.view_functions[rule.endpoint](**req.view_args)\n  File \"./decksite/cache.py\", line 71, in decorated_function\n    response = make_response(f(*args, **kwargs))\n  File \"./decksite/main.py\", line 136, in archetype\n    view = Archetype(a, archs.load_archetypes_deckless_for(a.id, season_id=g.get('season_id', rot.current_season_num())), archs.load_matchups(a.id, season_id=g.get('season_id', rot.current_season_num())), g.get('season_id', rot.current_season_num()))\n  File \"./decksite/views/archetype.py\", line 20, in __init__\n    matchup_archetypes = archs.load_archetypes_deckless(season_id)\n  File \"./decksite/data/archetype.py\", line 96, in load_archetypes_deckless\n    archetypes = [Archetype(a) for a in db().execute(sql)]\n  File \"./shared/database.py\", line 51, in execute\n    raise DatabaseException('Failed to execute `{sql}` with `{args}` because of `{e}`'.format(sql=sql, args=args, e=e))\n\n"}}
{"actor":{"display_login":"stale"}}