We just encountered this error when using the formgrader:
First, it does not show any useful information - even the administrator of the course has a hard time understanding what is the problem.
We had to contact the k8s admin who found more details in the logs of the pod where the nbgrader service is running:
[E 2024-11-15 05:15:46.668 ServerApp] Uncaught exception GET /services/course123/formgrader/submissions/392a41a720bb4019b5ac6a7fbc58987b ([redacted])
HTTPServerRequest(protocol='https', host='[redacted]', method='GET', uri='/services/course123/formgrader/submissions/392a41a720bb4019b5ac6a7fbc58987b', version='HTTP/1.1', remote_ip='[redacted]')
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/tornado/web.py", line 1788, in _execute
result = method(*self.path_args, **self.path_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/tornado/web.py", line 3301, in wrapper
return method(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/nbgrader/server_extensions/formgrader/base.py", line 113, in wrapper
return f(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/nbgrader/server_extensions/formgrader/base.py", line 122, in wrapper
return f(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/nbgrader/server_extensions/formgrader/handlers.py", line 119, in get
submission = self.gradebook.find_submission_notebook_by_id(submission_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/nbgrader/api.py", line 2558, in find_submission_notebook_by_id
.one()
^^^^^
File "/usr/lib/python3.12/site-packages/sqlalchemy/orm/query.py", line 2778, in one
return self._iter().one() # type: ignore
^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/sqlalchemy/orm/query.py", line 2827, in _iter
result: Union[ScalarResult[_T], Result[_T]] = self.session.execute(
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2362, in execute
return self._execute_internal(
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2237, in _execute_internal
conn = self._connection_for_bind(bind)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2106, in _connection_for_bind
return trans._connection_for_bind(engine, execution_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<string>", line 2, in _connection_for_bind
File "/usr/lib/python3.12/site-packages/sqlalchemy/orm/state_changes.py", line 103, in _go
self._raise_for_prerequisite_state(fn.__name__, current_state)
File "/usr/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 973, in _raise_for_prerequisite_state
raise sa_exc.PendingRollbackError(
sqlalchemy.exc.PendingRollbackError: 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: (sqlite3.OperationalError) attempt to write a readonly database
[SQL: UPDATE comment SET manual_comment=? WHERE comment.id = ?]
[parameters: ('[redacted]', '77577e8299a24c76bf482a37171db0bc')]
(Background on this error at: https://sqlalche.me/e/20/e3q8) (Background on this error at: https://sqlalche.me/e/20/7s2a)
Now we have to solve the problem with the database, but that is another issue...
We just encountered this error when using the formgrader:
First, it does not show any useful information - even the administrator of the course has a hard time understanding what is the problem.
We had to contact the k8s admin who found more details in the logs of the pod where the nbgrader service is running:
Now we have to solve the problem with the database, but that is another issue...