Add missing fields to prevent SQLAlchemy error - #99
Merged
Merged
Conversation
This was the error:
[2026-08-04 09:06:10,143] [ERROR] flask_server app.py:875 log_exception Exception on /admin/runs/ [GET]
Traceback (most recent call last):
File /root/.local/lib/python3.12/site-packages/flask/app.py, line 1511, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File /root/.local/lib/python3.12/site-packages/flask/app.py, line 919, in full_dispatch_request
rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File /root/.local/lib/python3.12/site-packages/flask/app.py, line 917, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File /root/.local/lib/python3.12/site-packages/flask/app.py, line 902, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File /opt/scheduler/flask_server.py, line 460, in list_runs
runs = [r.to_dict(include_context_data=False, include_output=False) for r in runs]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File /opt/scheduler/faas_scheduler/models.py, line 76, in to_dict
state: self.state,
^^^^^^^^^^
File /root/.local/lib/python3.12/site-packages/sqlalchemy/orm/attributes.py, line 569, in __get__
return self.impl.get(state, dict_) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File /root/.local/lib/python3.12/site-packages/sqlalchemy/orm/attributes.py, line 1096, in get
value = self._fire_loader_callables(state, key, passive)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File /root/.local/lib/python3.12/site-packages/sqlalchemy/orm/attributes.py, line 1129, in _fire_loader_callables
return callable_(state, passive)
^^^^^^^^^^^^^^^^^^^^^^^^^
File /root/.local/lib/python3.12/site-packages/sqlalchemy/orm/strategies.py, line 578, in __call__
return strategy._load_for_state(state, passive)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File /root/.local/lib/python3.12/site-packages/sqlalchemy/orm/strategies.py, line 536, in _load_for_state
raise orm_exc.DetachedInstanceError(
sqlalchemy.orm.exc.DetachedInstanceError: Parent instance <ScriptLog at 0x7f366da33200> is not bound to a Session; deferred load operation of attribute 'state' cannot proceed (Background on this error at: https://sqlalche.me/e/20/bhk3)
AlexCXC
approved these changes
Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
/admin/runsendpoint of thepython-schedulerreturnsHTTP 500sinceScriptLog.to_dict()tries to access fields that were not included inside the SQL query.This was the error: