Cannot release a lock that's no longer owned #660

Closed
opened 2026-02-16 10:20:06 -05:00 by yindo · 1 comment
Owner

Originally created by @31000023 on GitHub (Sep 19, 2025).

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 Dify issues & Dify Official Plugins, 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.8.1

Plugin version

0.1.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Cannot release a lock that's no longer owned

Image

✔️ Error log

No response

Originally created by @31000023 on GitHub (Sep 19, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.8.1 ### Plugin version 0.1.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Cannot release a lock that's no longer owned <img width="726" height="265" alt="Image" src="https://github.com/user-attachments/assets/642c4dad-60f7-4907-83d8-946eba4682af" /> ### ✔️ Error log _No response_
yindo added the bug label 2026-02-16 10:20:06 -05:00
yindo closed this issue 2026-02-16 10:20:06 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Sep 19, 2025):

Hi @31000023! I'm Dosu and I’m helping the dify-official-plugins team.

This error comes from Dify's core lock management, specifically in the sandbox_lock.py file, which handles concurrency for code execution. The message means a process is trying to release a lock it no longer owns—usually because the lock expired, was released elsewhere, or there’s a concurrency misconfiguration. In self-hosted Docker setups, this can happen if Celery workers, Redis, or other distributed components lose sync or restart unexpectedly.

Recent workflow and Celery changes in Dify may affect how locks are managed, especially with async tasks and queue configuration, but there’s no direct fix for this error in recent updates. The plugins themselves don’t manage locks; they rely on the core platform for this functionality.

To troubleshoot: check your Redis and Celery configuration for timeouts, worker restarts, and network stability. Make sure all containers use the same Redis instance and that Celery workers aren’t restarting or losing connection during task execution. If the error persists, enabling debug logs for the sandbox and lock components may help pinpoint where ownership is lost.

For more details on the relevant code, see the lock management logic in Dify’s sandbox_lock.py and recent workflow changes here.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Sep 19, 2025): <!-- Greeting --> Hi @31000023! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify-official-plugins team. <!-- Answer --> This error comes from Dify's core lock management, specifically in the sandbox_lock.py file, which handles concurrency for code execution. The message means a process is trying to release a lock it no longer owns—usually because the lock expired, was released elsewhere, or there’s a concurrency misconfiguration. In self-hosted Docker setups, this can happen if Celery workers, Redis, or other distributed components lose sync or restart unexpectedly. Recent workflow and Celery changes in Dify may affect how locks are managed, especially with async tasks and queue configuration, but there’s no direct fix for this error in recent updates. The plugins themselves don’t manage locks; they rely on the core platform for this functionality. To troubleshoot: check your Redis and Celery configuration for timeouts, worker restarts, and network stability. Make sure all containers use the same Redis instance and that Celery workers aren’t restarting or losing connection during task execution. If the error persists, enabling debug logs for the sandbox and lock components may help pinpoint where ownership is lost. For more details on the relevant code, see the lock management logic in Dify’s sandbox_lock.py and recent workflow changes [here](https://github.com/langgenius/dify/pull/24358). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/a2b9c09b-905b-4998-8f7a-dbfea0411e60?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/a2b9c09b-905b-4998-8f7a-dbfea0411e60?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/a2b9c09b-905b-4998-8f7a-dbfea0411e60?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/a2b9c09b-905b-4998-8f7a-dbfea0411e60?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/a2b9c09b-905b-4998-8f7a-dbfea0411e60?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/a2b9c09b-905b-4998-8f7a-dbfea0411e60?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/a2b9c09b-905b-4998-8f7a-dbfea0411e60?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/1737)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#660