{"action":"closed","issue":{"url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/20632","repository_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports","labels_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/20632/labels{/name}","comments_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/20632/comments","events_url":"https://api.github.com/repos/PennyDreadfulMTG/perf-reports/issues/20632/events","html_url":"https://github.com/PennyDreadfulMTG/perf-reports/issues/20632","id":321517940,"node_id":"MDU6SXNzdWUzMjE1MTc5NDA=","number":20632,"title":"500 error at /decks/9968/","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-05-09T10:34:57Z","updated_at":"2018-07-15T11:01:07Z","closed_at":"2018-07-15T11:01:07Z","author_association":"NONE","body":" Failed to execute `\n        SELECT\n            d.id,\n            d.name AS original_name,\n            d.created_date,\n            d.updated_date,\n            SUM(CASE WHEN dm.games > IFNULL(odm.games, 0) THEN 1 ELSE 0 END) 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            d.finish,\n            d.archetype_id,\n            d.url AS source_url,\n            d.competition_id,\n            c.name AS competition_name,\n            c.end_date AS competition_end_date,\n            c.top_n AS competition_top_n,\n            ct.name AS competition_type_name,\n            d.identifier,\n            LOWER(IFNULL(IFNULL(IFNULL(p.name, p.mtgo_username), p.mtggoldfish_username), p.tappedout_username)) AS person,\n            p.id AS person_id,\n            p.banned,\n            p.discord_id,\n            d.decklist_hash,\n            d.retired,\n            s.name AS source_name,\n            IFNULL(a.name, '') AS archetype_name,\n            cache.normalized_name AS name,\n            cache.colors,\n            cache.colored_symbols,\n            cache.legal_formats,\n            season.id AS season_id,\n            IFNULL(MAX(m.date), d.created_date) AS active_date\n        FROM\n            deck AS d\n        LEFT JOIN\n            person AS p ON d.person_id = p.id\n        LEFT JOIN\n            source AS s ON d.source_id = s.id\n        LEFT JOIN\n            archetype AS a ON d.archetype_id = a.id\n        \n        LEFT JOIN\n            competition AS c ON d.competition_id = c.id\n        LEFT JOIN\n            competition_series AS cs ON cs.id = c.competition_series_id\n        LEFT JOIN\n            competition_type AS ct ON ct.id = cs.competition_type_id\n    \n        LEFT JOIN\n            deck_cache AS cache ON d.id = cache.deck_id\n        LEFT JOIN\n            deck_match AS dm ON d.id = dm.deck_id\n        LEFT JOIN\n            `match` AS m ON dm.match_id = m.id\n        LEFT JOIN\n            deck_match AS odm ON odm.deck_id <> d.id AND dm.match_id = odm.match_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        WHERE (d.id IN (SELECT deck_id FROM deck_card WHERE card IN ())) AND (TRUE)\n        GROUP BY\n            d.id,\n            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.\n        ORDER BY\n            active_date DESC, d.finish IS NULL, d.finish\n        \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 '))) AND (TRUE)\\n        GROUP BY\\n            d.id,\\n            season.id -- In th' at line 70\")`\n\nReported on decksite by logged_out\n--------------------------------------------------------------------------------\nRequest Method: GET\nPath: /decks/9968/?\nCookies: {}\nEndpoint: deck\nView Args: {'deck_id': '9968'}\nPerson: logged_out\nReferrer: None\nRequest Data: {}\nHost: pennydreadfulmagic.com\nAccept-Encoding: gzip\nCf-Ipcountry: US\nX-Forwarded-For: 216.244.66.226, 172.68.174.96\nCf-Ray: 41838439dc1f8d35-PDX\nX-Forwarded-Proto: https\nCf-Visitor: {\"scheme\":\"https\"}\nAccept: */*\nUser-Agent: Mozilla/5.0 (compatible; DotBot/1.1; http://www.opensiteexplorer.org/dotbot, help@moz.com)\nAccept-Charset: utf-8;q=0.7,iso-8859-1;q=0.2,*;q=0.1\nCf-Connecting-Ip: 216.244.66.226\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 2309, in __call__\n    return self.wsgi_app(environ, start_response)\n  File \"/home/discord/.local/lib/python3.6/site-packages/flask/app.py\", line 2295, in wsgi_app\n    response = self.handle_exception(e)\n  File \"/home/discord/.local/lib/python3.6/site-packages/flask/app.py\", line 2292, in wsgi_app\n    response = self.full_dispatch_request()\n  File \"/home/discord/.local/lib/python3.6/site-packages/flask/app.py\", line 1815, 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 1718, 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 35, in reraise\n    raise value\n  File \"/home/discord/.local/lib/python3.6/site-packages/flask/app.py\", line 1813, in full_dispatch_request\n    rv = self.dispatch_request()\n  File \"/home/discord/.local/lib/python3.6/site-packages/flask/app.py\", line 1799, in dispatch_request\n    return self.view_functions[rule.endpoint](**req.view_args)\n  File \"./decksite/auth.py\", line 51, in decorated_function\n    return f(*args, **kwargs)\n  File \"./decksite/main.py\", line 52, in deck\n    view = Deck(d, auth.person_id(), auth.discord_id())\n  File \"./decksite/views/deck.py\", line 23, in __init__\n    deck.load_similar_decks([d])\n  File \"./decksite/data/deck.py\", line 311, in load_similar_decks\n    potentially_similar = load_decks('d.id IN (SELECT deck_id FROM deck_card WHERE card IN ({cards_escaped}))'.format(cards_escaped=cards_escaped))\n  File \"./decksite/data/deck.py\", line 134, in load_decks\n    rows = db().execute(sql)\n  File \"./shared/database.py\", line 49, 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"}}