You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/fields.py", line 57, in get_value_for_key
return getattr(obj, key, default)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/orm/attributes.py", line 566, in get
return self.impl.get(state, dict) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/orm/attributes.py", line 1086, in get
value = self._fire_loader_callables(state, key, passive)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/orm/attributes.py", line 1116, in _fire_loader_callables
return state._load_expired(state, passive)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/orm/state.py", line 803, in _load_expired
self.manager.expired_attribute_loader(self, toload, passive)
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/orm/loading.py", line 1603, in load_scalar_attributes
raise orm_exc.DetachedInstanceError(
sqlalchemy.orm.exc.DetachedInstanceError: Instance <Site at 0x7fe41fe95dc0> is not bound to a Session; attribute refresh operation cannot proceed (Background on this error at: https://sqlalche.me/e/20/bhk3)
✔️ Expected Behavior
No response
❌ Actual Behavior
No response
The text was updated successfully, but these errors were encountered:
A similar issue was reported in the Dify repository, where a DetachedInstanceError occurred during workflow response generation. This issue was closed after a fix was implemented to handle document fetching from a URL in the Anthropic LLM model, which solved a base64 decoding error [1].
For your specific issue with the DetachedInstanceError when saving workflow settings in a self-hosted Dify version 1.0.0 using Docker, a common resolution is to ensure that the SQLAlchemy session management is correctly handled. One approach is to set expire_on_commit to False in your SQLAlchemy session configuration. This prevents instances from being expired after a commit, which can help avoid the DetachedInstanceError[2].
Additionally, if you are experiencing this issue in an ARM Docker environment, a temporary workaround is to remove the knowledge base, which has been reported to resolve similar errors [3]. However, it's advisable to verify if this workaround is suitable for your specific setup.
Self Checks
Dify version
1.0.0
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
When saving settings under monitoring:
File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/fields.py", line 57, in get_value_for_key
return getattr(obj, key, default)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/orm/attributes.py", line 566, in get
return self.impl.get(state, dict) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/orm/attributes.py", line 1086, in get
value = self._fire_loader_callables(state, key, passive)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/orm/attributes.py", line 1116, in _fire_loader_callables
return state._load_expired(state, passive)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/orm/state.py", line 803, in _load_expired
self.manager.expired_attribute_loader(self, toload, passive)
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/orm/loading.py", line 1603, in load_scalar_attributes
raise orm_exc.DetachedInstanceError(
sqlalchemy.orm.exc.DetachedInstanceError: Instance <Site at 0x7fe41fe95dc0> is not bound to a Session; attribute refresh operation cannot proceed (Background on this error at: https://sqlalche.me/e/20/bhk3)
✔️ Expected Behavior
No response
❌ Actual Behavior
No response
The text was updated successfully, but these errors were encountered: