Skip to content

Instantly share code, notes, and snippets.

@silasary
Last active May 13, 2018 14:05
Show Gist options
  • Save silasary/057f6dafa8c235909ea42bb72a1f6171 to your computer and use it in GitHub Desktop.
Save silasary/057f6dafa8c235909ea42bb72a1f6171 to your computer and use it in GitHub Desktop.
Traceback (most recent call last):
File "/home/jenkins/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/jenkins/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/jenkins/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/jenkins/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/jenkins/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/jenkins/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/jenkins/.jenkins/workspace/Penny Dreadful/Penny Dreadful Tools/decksite/auth.py", line 51, in decorated_function
return f(*args, **kwargs)
File "/home/jenkins/.jenkins/workspace/Penny Dreadful/Penny Dreadful Tools/decksite/main.py", line 269, in signup
view = SignUp(form, auth.person_id())
File "/home/jenkins/.jenkins/workspace/Penny Dreadful/Penny Dreadful Tools/decksite/views/signup.py", line 9, in __init__
super().__init__(form)
File "/home/jenkins/.jenkins/workspace/Penny Dreadful/Penny Dreadful Tools/decksite/views/league_form.py", line 10, in __init__
self.league = league.active_league()
File "/home/jenkins/.jenkins/workspace/Penny Dreadful/Penny Dreadful Tools/decksite/league.py", line 285, in active_league
leagues = competition.load_competitions(where)
File "/home/jenkins/.jenkins/workspace/Penny Dreadful/Penny Dreadful Tools/decksite/data/competition.py", line 82, in load_competitions
competitions = [Competition(r) for r in db().execute(sql)]
File "/home/jenkins/.jenkins/workspace/Penny Dreadful/Penny Dreadful Tools/shared/database.py", line 49, in execute
raise DatabaseException('Failed to execute `{sql}` with `{args}` because of `{e}`'.format(sql=sql, args=args, e=e))
shared.pd_exception.DatabaseException: Failed to execute `
SELECT c.id, c.name, c.start_date, c.end_date, c.url,
COUNT(d.id) AS num_decks,
sp.name AS sponsor_name,
ct.name AS type
FROM competition AS c
LEFT JOIN deck AS d ON c.id = d.competition_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 sponsor AS sp ON cs.sponsor_id = sp.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 (c.id = (
SELECT id FROM competition
WHERE
start_date < 1526219121
AND
end_date > 1526219121
AND
id IN (
SELECT
id
FROM
competition
WHERE
competition_series_id IN
(
SELECT
id
FROM
competition_series
WHERE
competition_type_id
IN (
SELECT
id
FROM
competition_type
WHERE
name = 'League'
)
)
)
)) AND (TRUE)
GROUP BY c.id
ORDER BY c.start_date DESC, c.name
` with `[]` because of `(1242, 'Subquery returns more than 1 row')`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment