Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error saving workflow settings #14571

Open
5 tasks done
djav1985 opened this issue Feb 28, 2025 · 1 comment
Open
5 tasks done

Error saving workflow settings #14571

djav1985 opened this issue Feb 28, 2025 · 1 comment
Labels
🐞 bug Something isn't working

Comments

@djav1985
Copy link

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.0.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When saving settings under monitoring:

return _get_value_for_key(keys[0], obj, default)
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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

@dosubot dosubot bot added the 🐞 bug Something isn't working label Feb 28, 2025
Copy link

dosubot bot commented Feb 28, 2025

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.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant