Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Staffjoy cron bug
Staffjoy Suite Cron Docs:
curl --user API_KEY:
Server Error on cron run:
ERROR Exception on /api/v2/organizations/1/locations/2/roles/3/users/182
[GET] Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/flask/", line 1473, in full_dispatch_request rv = self.preprocess_request()
File "/usr/local/lib/python2.7/dist-packages/flask/", line 1666, in preprocess_request rv = func()
File "./app/apiv2/", line 152, in authenticate api_key_user = ApiKey.get_user(token)
File "./app/models/", line 60, in get_user apikey = ApiKey.query.get(data.get("id"))
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/", line 831, in get
return self._get_impl(ident, loading.load_on_ident) F
ile "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/", line 864, in _get_impl r
eturn fallback_fn(self, key)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/", line 219, in load_on_ident
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/", line 2693, in one
ret = list(self)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/", line 2736, in __iter__ return self._execute_and_instances(context)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/", line 2749, in _execute_and_instances close_with_result=True)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/", line 2740, in _connection_from_session **kw)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/", line 893, in connection execution_options=execution_options)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/", line 898, in _connection_for_bind engine, execution_options)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/", line 313, in _connection_for_bind self._assert_active()
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/", line 214, in _assert_active % self._rollback_exception
InvalidRequestError: This Session's transaction has been rolled back due to a previous exception during flush.
To begin a new transaction with this Session, first issue Session.rollback().
Original exception was: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely)
(_mysql_exceptions.OperationalError) (1205, 'Lock wait timeout exceeded; try restarting transaction')
[SQL: u'UPDATE apikeys SET last_used=%s WHERE = %s'] [parameters: (datetime.datetime(2017, 7, 20, 1, 5, 43, 394650), 6L)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.