Opened 10 years ago

Closed 8 years ago

#5076 closed defect (cant-reproduce)

OperationalError: (OperationalError) database is locked None None

Reported by: davidak Owned by:
Priority: major Milestone:
Component: programming Keywords:
Cc: Parent Tickets:

Description

i uploaded a jpg and want to delete it now.

i clicked to delete it and get an internal server error page:

URL: http://hipsterpunk.com/u/davidak/m/454/confirm-delete/
File '/var/www/mediagoblin/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 '/var/www/mediagoblin/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 '/var/www/mediagoblin/lib/python2.7/site-packages/Beaker-1.6.4-py2.7.egg/beaker/middleware.py', line 155 in __call__
  return self.wrap_app(environ, session_start_response)
File '/var/www/mediagoblin/mediagoblin/app.py', line 236 in __call__
  return self.call_backend(environ, start_response)
File '/var/www/mediagoblin/mediagoblin/app.py', line 216 in call_backend
  response = controller(request)
File '/var/www/mediagoblin/mediagoblin/decorators.py', line 224 in wrapper
  return controller(request, media=media, *args, **kwargs)
File '/var/www/mediagoblin/mediagoblin/decorators.py', line 48 in new_controller_func
  return controller(request, *args, **kwargs)
File '/var/www/mediagoblin/mediagoblin/decorators.py', line 78 in wrapper
  return controller(request, *args, **kwargs)
File '/var/www/mediagoblin/mediagoblin/user_pages/views.py', line 284 in media_confirm_delete
  media.delete()
File '/var/www/mediagoblin/mediagoblin/db/models.py', line 261 in delete
  super(MediaEntry, self).delete(**kwargs)
File '/var/www/mediagoblin/mediagoblin/db/base.py', line 59 in delete
  sess.commit()
File '/var/www/mediagoblin/lib/python2.7/site-packages/SQLAlchemy-0.7.9-py2.7-linux-i686.egg/sqlalchemy/orm/session.py', line 703 in commit
  self.transaction.commit()
File '/var/www/mediagoblin/lib/python2.7/site-packages/SQLAlchemy-0.7.9-py2.7-linux-i686.egg/sqlalchemy/orm/session.py', line 365 in commit
  t[1].commit()
File '/var/www/mediagoblin/lib/python2.7/site-packages/SQLAlchemy-0.7.9-py2.7-linux-i686.egg/sqlalchemy/engine/base.py', line 2045 in commit
  self._do_commit()
File '/var/www/mediagoblin/lib/python2.7/site-packages/SQLAlchemy-0.7.9-py2.7-linux-i686.egg/sqlalchemy/engine/base.py', line 2075 in _do_commit
  self.connection._commit_impl()
File '/var/www/mediagoblin/lib/python2.7/site-packages/SQLAlchemy-0.7.9-py2.7-linux-i686.egg/sqlalchemy/engine/base.py', line 1280 in _commit_impl
  self._handle_dbapi_exception(e, None, None, None, None)
File '/var/www/mediagoblin/lib/python2.7/site-packages/SQLAlchemy-0.7.9-py2.7-linux-i686.egg/sqlalchemy/engine/base.py', line 1277 in _commit_impl
  self.engine.dialect.do_commit(self.connection)
File '/var/www/mediagoblin/lib/python2.7/site-packages/SQLAlchemy-0.7.9-py2.7-linux-i686.egg/sqlalchemy/engine/default.py', line 307 in do_commit
  connection.commit()
OperationalError: (OperationalError) database is locked None None

SERVER_SOFTWARE 'Apache/2.2.17 (Ubuntu)'
HTTP_USER_AGENT 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.122 Safari/537.36'

after that, the image was deleted but the database entry is still there: http://hipsterpunk.com/u/davidak/m/foto-am-20-03-15-um-21-54/

Change History (5)

comment:1 by davidak, 10 years ago

i uploaded another jpg and deleted it succesfully. i think it was a temporary problem with the database.
that shouldn't happen neither the user should see such an error page.

an administrator should get informed about it.

comment:2 by Loic Dachary, 9 years ago

@davidak was it with sqlite or postgres ?

comment:3 by Aeva, 9 years ago

@loic is sqlite

comment:4 by Ben Sturmfels, 8 years ago

Hi David,

Thanks for raising this issue and sorry for the slow response on this. I've tried this myself on the default SQLite database, but wasn't able to repeat the issue. Would you mind trying again and letting us know if it still occurs for you? If not, we might close the issue and assume it was just a temporary problem.

(Also worth noting that we should probably delete from the database before deleting the file.)

Cheers,
Ben

comment:5 by Ben Sturmfels, 8 years ago

Resolution: worksforme
Status: newclosed

David, I'll tentatively close this ticket as we haven't had a response from you yet. Please don't hesitate to re-open this if you find the locked database error is still occurring for you.

Note: See TracTickets for help on using tickets.