Opened 9 years ago

Closed 9 years ago

#587 closed defect (fixed)

Removed MediaEntry returns 500 instead of 404

Reported by: joar Owned by:
Priority: critical Milestone: 0.3.3
Component: programming Keywords:
Cc: Elrond Parent Tickets:

Description

Navigating to https://gobblin.se/u/avrs/m/mozilla-firefox-manifesto-v0-2-640/ returns

Stack trace:

Error - <class 'sqlalchemy.exc.DataError'>: (DataError) invalid input syntax for integer: "mozilla-firefox-manifesto-v0-2-640"

LINE 3: ....state = 'processed' AND core__media_entries.id = 'mozilla-f...

^

'SELECT core__media_entries.id AS core__media_entries_id, core__media_entries.uploader AS core__media_entries_uploader, core__media_entries.title AS core__media_entries_title, core__media_entries.slug AS core__media_entries_slug, core__media_entries.created AS core__media_entries_created, core__media_entries.description AS core__media_entries_description, core__media_entries.media_type AS core__media_entries_media_type, core__media_entries.state AS core__media_entries_state, core__media_entries.license AS core__media_entries_license, core__media_entries.collected AS core__media_entries_collected, core__media_entries.fail_error AS core__media_entries_fail_error, core__media_entries.fail_metadata AS core__media_entries_fail_metadata, core__media_entries.transcoding_progress AS core__media_entries_transcoding_progress, core__media_entries.queued_media_file AS core__media_entries_queued_media_file, core__media_entries.queued_task_id AS core__media_entries_queued_task_id \nFROM core__media_entries \nWHERE core__media_entries.state = %(state_1)s AND core__media_entries.id = %(id_1)s AND core__media_entries.uploader = %(uploader_1)s \n LIMIT %(param_1)s' {'state_1': u'processed', 'param_1': 1, 'id_1': u'mozilla-firefox-manifesto-v0-2-640', 'uploader_1': 29}

URL: https://gobblin.se/u/avrs/m/mozilla-firefox-manifesto-v0-2-640/

File '/srv/mg.wandborg.se/mediagoblin/local/lib/python2.7/site-packages/Paste-1.7.5.1-py2.7.egg/paste/exceptions/errormiddleware.py', line 144 in __call__

app_iter = self.application(environ, sr_checker)

File '/srv/mg.wandborg.se/mediagoblin/local/lib/python2.7/site-packages/Paste-1.7.5.1-py2.7.egg/paste/urlmap.py', line 203 in __call__

return app(environ, start_response)

File '/srv/mg.wandborg.se/mediagoblin/local/lib/python2.7/site-packages/Beaker-1.6.3-py2.7.egg/beaker/middleware.py', line 155 in __call__

return self.wrap_app(environ, session_start_response)

File '/srv/mg.wandborg.se/mediagoblin/mediagoblin/app.py', line 232 in __call__

return self.call_backend(environ, start_response)

File '/srv/mg.wandborg.se/mediagoblin/mediagoblin/app.py', line 212 in call_backend

response = controller(request)

File '/srv/mg.wandborg.se/mediagoblin/mediagoblin/decorators.py', line 138 in wrapper

uploader=user.id).first()

File '/srv/mg.wandborg.se/mediagoblin/local/lib/python2.7/site-packages/SQLAlchemy-0.7.6-py2.7-linux-x86_64.egg/sqlalchemy/orm/query.py', line 2107 in first

ret = list(self[0:1])

File '/srv/mg.wandborg.se/mediagoblin/local/lib/python2.7/site-packages/SQLAlchemy-0.7.6-py2.7-linux-x86_64.egg/sqlalchemy/orm/query.py', line 2001 in __getitem__

return list(res)

File '/srv/mg.wandborg.se/mediagoblin/local/lib/python2.7/site-packages/SQLAlchemy-0.7.6-py2.7-linux-x86_64.egg/sqlalchemy/orm/query.py', line 2176 in __iter__

return self._execute_and_instances(context)

File '/srv/mg.wandborg.se/mediagoblin/local/lib/python2.7/site-packages/SQLAlchemy-0.7.6-py2.7-linux-x86_64.egg/sqlalchemy/orm/query.py', line 2191 in _execute_and_instances

result = conn.execute(querycontext.statement, self._params)

File '/srv/mg.wandborg.se/mediagoblin/local/lib/python2.7/site-packages/SQLAlchemy-0.7.6-py2.7-linux-x86_64.egg/sqlalchemy/engine/base.py', line 1450 in execute

params)

File '/srv/mg.wandborg.se/mediagoblin/local/lib/python2.7/site-packages/SQLAlchemy-0.7.6-py2.7-linux-x86_64.egg/sqlalchemy/engine/base.py', line 1583 in _execute_clauseelement

compiled_sql, distilled_params

File '/srv/mg.wandborg.se/mediagoblin/local/lib/python2.7/site-packages/SQLAlchemy-0.7.6-py2.7-linux-x86_64.egg/sqlalchemy/engine/base.py', line 1697 in _execute_context

context)

File '/srv/mg.wandborg.se/mediagoblin/local/lib/python2.7/site-packages/SQLAlchemy-0.7.6-py2.7-linux-x86_64.egg/sqlalchemy/engine/base.py', line 1690 in _execute_context

context)

File '/srv/mg.wandborg.se/mediagoblin/local/lib/python2.7/site-packages/SQLAlchemy-0.7.6-py2.7-linux-x86_64.egg/sqlalchemy/engine/default.py', line 335 in do_execute

cursor.execute(statement, parameters)

DataError: (DataError) invalid input syntax for integer: "mozilla-firefox-manifesto-v0-2-640"

LINE 3: ....state = 'processed' AND core__media_entries.id = 'mozilla-f...

^

'SELECT core__media_entries.id AS core__media_entries_id, core__media_entries.uploader AS core__media_entries_uploader, core__media_entries.title AS core__media_entries_title, core__media_entries.slug AS core__media_entries_slug, core__media_entries.created AS core__media_entries_created, core__media_entries.description AS core__media_entries_description, core__media_entries.media_type AS core__media_entries_media_type, core__media_entries.state AS core__media_entries_state, core__media_entries.license AS core__media_entries_license, core__media_entries.collected AS core__media_entries_collected, core__media_entries.fail_error AS core__media_entries_fail_error, core__media_entries.fail_metadata AS core__media_entries_fail_metadata, core__media_entries.transcoding_progress AS core__media_entries_transcoding_progress, core__media_entries.queued_media_file AS core__media_entries_queued_media_file, core__media_entries.queued_task_id AS core__media_entries_queued_task_id \nFROM core__media_entries \nWHERE core__media_entries.state = %(state_1)s AND core__media_entries.id = %(id_1)s AND core__media_entries.uploader = %(uploader_1)s \n LIMIT %(param_1)s' {'state_1': u'processed', 'param_1': 1, 'id_1': u'mozilla-firefox-manifesto-v0-2-640', 'uploader_1': 29}

(https://gist.github.com/adb5dd5cea7f96f965e0)

Subtickets

Change History (1)

comment:1 Changed 9 years ago by spaetz

Resolution: fixed
Status: newclosed

Fallout from the ObjectId/InvalidID removal in the MongoDB code. Fixed in master in commit: 7f4e42b

Note: See TracTickets for help on using tickets.