When upgrading to the latest version of dify from 1.9.2, an error occurred during the build #21116

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

Originally created by @z942588879 on GitHub (Dec 17, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.11.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Perform docker compose up-d

✔️ Expected Behavior

success

Actual Behavior

docker compose up -d
WARN[0000] The "CERTBOT_EMAIL" variable is not set. Defaulting to a blank string.
WARN[0000] The "CERTBOT_DOMAIN" variable is not set. Defaulting to a blank string.
[+] Running 13/17
⠸ api [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿] 748.8MB / 750.9MB Pulling 213.3s
✔ 8a4a7306158c Pull complete 18.5s
✔ 9e3c710b82ea Pull complete 18.6s
✔ adf964b56266 Pull complete 19.0s
⠸ 7101479101ef Extracting [==================================================>] 249B/249B 201.5s
✔ 38c24b09f0e7 Download complete 6.1s
✔ 2e0c0565b157 Download complete 14.4s
✔ 4f4fb700ef54 Download complete 15.2s
✔ 4f0ea0f19b46 Download complete 15.7s
✔ 1d6151e28c6a Download complete 87.4s
✔ 4a6a2df95fd8 Download complete 201.4s
✔ 9b5dc06561f5 Download complete 63.4s
✔ 1cf3d9612d53 Download complete 69.3s
✔ 1e3b3f3509b7 Download complete 79.5s
✔ 059ce95d8fac Download complete 81.0s
⠸ worker Pulling 213.3s
⠸ worker_beat Pulling 213.3s
failed to register layer: rename /var/lib/docker/image/overlay2/layerdb/tmp/write-set-2991664516 /var/lib/docker/image/overlay2/layerdb/sha256/13ac6c6a0d63553d0838e71a25df6ce2f3977dfe4a3449d31a510d0e19a6fb15: file exists

Originally created by @z942588879 on GitHub (Dec 17, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [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 [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.11.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Perform docker compose up-d ### ✔️ Expected Behavior success ### ❌ Actual Behavior docker compose up -d WARN[0000] The "CERTBOT_EMAIL" variable is not set. Defaulting to a blank string. WARN[0000] The "CERTBOT_DOMAIN" variable is not set. Defaulting to a blank string. [+] Running 13/17 ⠸ api [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿] 748.8MB / 750.9MB Pulling 213.3s ✔ 8a4a7306158c Pull complete 18.5s ✔ 9e3c710b82ea Pull complete 18.6s ✔ adf964b56266 Pull complete 19.0s ⠸ 7101479101ef Extracting [==================================================>] 249B/249B 201.5s ✔ 38c24b09f0e7 Download complete 6.1s ✔ 2e0c0565b157 Download complete 14.4s ✔ 4f4fb700ef54 Download complete 15.2s ✔ 4f0ea0f19b46 Download complete 15.7s ✔ 1d6151e28c6a Download complete 87.4s ✔ 4a6a2df95fd8 Download complete 201.4s ✔ 9b5dc06561f5 Download complete 63.4s ✔ 1cf3d9612d53 Download complete 69.3s ✔ 1e3b3f3509b7 Download complete 79.5s ✔ 059ce95d8fac Download complete 81.0s ⠸ worker Pulling 213.3s ⠸ worker_beat Pulling 213.3s failed to register layer: rename /var/lib/docker/image/overlay2/layerdb/tmp/write-set-2991664516 /var/lib/docker/image/overlay2/layerdb/sha256/13ac6c6a0d63553d0838e71a25df6ce2f3977dfe4a3449d31a510d0e19a6fb15: file exists
yindo added the 🐞 bug label 2026-02-21 20:10:50 -05:00
yindo closed this issue 2026-02-21 20:10:50 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 17, 2025):

The Docker error you're seeing (failed to register layer: ... file exists) usually points to a conflict or corruption in Docker's overlay2 storage, often triggered by leftover data from previous containers or images. This can happen during upgrades when persistent volumes or image layers aren't cleaned up properly.

Here are steps you can try to resolve it:

  1. Clean up Docker artifacts:
    Run these commands to remove unused containers, images, and volumes:

    docker system prune -af
    docker volume prune -f
    

    If you want to target only Dify-related containers/images, use docker ps -a and docker images to list and remove them individually.

  2. Check permissions:
    Make sure your Docker commands have the necessary permissions. If you previously ran Docker as root or with sudo, continue doing so to avoid permission mismatches on volumes.

  3. Remove problematic overlay2 layers:
    If the error persists, you may need to manually remove the conflicting layer directory.

    • Stop Docker: sudo systemctl stop docker
    • Remove the problematic layer (be careful—this affects all Docker images):
      sudo rm -rf /var/lib/docker/image/overlay2/layerdb/tmp/write-set-2991664516
      
    • Start Docker: sudo systemctl start docker
  4. Backup and verify volumes:
    Before upgrading, always back up your persistent volumes (like ./volumes/db/data, ./volumes/app/storage). Double-check that your .env file is present and correctly configured, as it's now required for Dify deployments and upgrades (docker/README.md).

  5. Try a clean install:
    If none of the above works, move your existing volumes directory elsewhere and try deploying Dify in a fresh directory. If the error disappears, it's likely tied to old Docker data.

For more details on migration and persistent storage, see the Dify Docker README and review your docker-compose.yaml for correct volume mounts and environment variables.

Let me know if you need more specific steps for your environment!

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 17, 2025): <!-- Answer --> The Docker error you're seeing (`failed to register layer: ... file exists`) usually points to a conflict or corruption in Docker's overlay2 storage, often triggered by leftover data from previous containers or images. This can happen during upgrades when persistent volumes or image layers aren't cleaned up properly. Here are steps you can try to resolve it: 1. **Clean up Docker artifacts**: Run these commands to remove unused containers, images, and volumes: ```bash docker system prune -af docker volume prune -f ``` If you want to target only Dify-related containers/images, use `docker ps -a` and `docker images` to list and remove them individually. 2. **Check permissions**: Make sure your Docker commands have the necessary permissions. If you previously ran Docker as root or with `sudo`, continue doing so to avoid permission mismatches on volumes. 3. **Remove problematic overlay2 layers**: If the error persists, you may need to manually remove the conflicting layer directory. - Stop Docker: `sudo systemctl stop docker` - Remove the problematic layer (be careful—this affects all Docker images): ```bash sudo rm -rf /var/lib/docker/image/overlay2/layerdb/tmp/write-set-2991664516 ``` - Start Docker: `sudo systemctl start docker` 4. **Backup and verify volumes**: Before upgrading, always back up your persistent volumes (like `./volumes/db/data`, `./volumes/app/storage`). Double-check that your `.env` file is present and correctly configured, as it's now required for Dify deployments and upgrades ([docker/README.md](https://github.com/langgenius/dify/blob/df2f1eb028f9e7c7083e96b2c90ee28cb7f53a6d/docker/README.md#L10-L55)). 5. **Try a clean install**: If none of the above works, move your existing `volumes` directory elsewhere and try deploying Dify in a fresh directory. If the error disappears, it's likely tied to old Docker data. For more details on migration and persistent storage, see the [Dify Docker README](https://github.com/langgenius/dify/blob/df2f1eb028f9e7c7083e96b2c90ee28cb7f53a6d/docker/README.md#L10-L55) and review your `docker-compose.yaml` for correct volume mounts and environment variables. Let me know if you need more specific steps for your environment! <!-- 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/ea34882a-9ce4-4087-b6fb-9134727ffb89?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/ea34882a-9ce4-4087-b6fb-9134727ffb89?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/ea34882a-9ce4-4087-b6fb-9134727ffb89?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/ea34882a-9ce4-4087-b6fb-9134727ffb89?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/ea34882a-9ce4-4087-b6fb-9134727ffb89?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/ea34882a-9ce4-4087-b6fb-9134727ffb89?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/ea34882a-9ce4-4087-b6fb-9134727ffb89?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%20Docker%20error%20you%27re%20seeing%20%28%60failed%20to%20register%20layer%3A%20...%20file%20exists%60%29%20usually%20points%20to%20a%20conflict%20or%20corruption%20in%20Docker%27s%20overlay2%20storage%2C%20often%20triggered%20by%20leftover%20data%20from%20previous%20containers%20or%20images.%20This%20can%20happen%20during%20upgrades%20when%20persistent%20volumes%20or%20image%20layers%20aren%27t%20cleaned%20up%20properly.%0A%0AHere%20are%20steps%20you%20can%20try%20to%20resolve%20it%3A%0A%0A1.%20%2A%2AClean%20up%20Docker%20artifacts%2A%2A%3A%20%20%0A%20%20%20Run%20these%20commands%20to%20remove%20unused%20containers%2C%20images%2C%20and%20volumes%3A%0A%20%20%20%60%60%60bash%0A%20%20%20docker%20system%20prune%20-af%0A%20%20%20docker%20volume%20prune%20-f%0A%20%20%20%60%60%60%0A%20%20%20If%20you%20want%20to%20target%20only%20Dify-related%20containers/images%2C%20use%20%60docker%20ps%20-a%60%20and%20%60docker%20images%60%20to%20list%20and%20remove%20them%20individually.%0A%0A2.%20%2A%2ACheck%20permissions%2A%2A%3A%20%20%0A%20%20%20Make%20sure%20your%20Docker%20commands%20have%20the%20necessary%20permissions.%20If%20you%20previously%20ran%20Docker%20as%20root%20or%20with%20%60sudo%60%2C%20continue%20doing%20so%20to%20avoid%20permission%20mismatches%20on%20volumes.%0A%0A3.%20%2A%2ARemove%20problematic%20overlay2%20layers%2A%2A%3A%20%20%0A%20%20%20If%20the%20error%20persists%2C%20you%20may%20need%20to%20manually%20remove%20the%20conflicting%20layer%20directory.%20%20%0A%20%20%20-%20Stop%20Docker%3A%20%60sudo%20systemctl%20stop%20docker%60%0A%20%20%20-%20Remove%20the%20problematic%20layer%20%28be%20careful%E2%80%94this%20affects%20all%20Docker%20images%29%3A%20%20%0A%20%20%20%20%20%60%60%60bash%0A%20%20%20%20%20sudo%20rm%20-rf%20/var/lib/docker/image/overlay2/layerdb/tmp/write-set-2991664516%0A%20%20%20%20%20%60%60%60%0A%20%20%20-%20Start%20Docker%3A%20%60sudo%20systemctl%20start%20docker%60%0A%0A4.%20%2A%2ABackup%20and%20verify%20volumes%2A%2A%3A%20%20%0A%20%20%20Before%20upgrading%2C%20always%20back%20up%20your%20persistent%20volumes%20%28like%20%60./volumes/db/data%60%2C%20%60./volumes/app/storage%60%29.%20Double-check%20that%20your%20%60.env%60%20file%20is%20present%20and%20correctly%20configured%2C%20as%20it%27s%20now%20required%20for%20Dify%20deployments%20and%20upgrades%20%28%5Bdocker/README.md%5D%28https%3A//github.com/langgenius/dify/blob/df2f1eb028f9e7c7083e96b2c90ee28cb7f53a6d/docker/README.md%23L10-L55%29%29.%0A%0A5.%20%2A%2ATry%20a%20clean%20install%2A%2A%3A%20%20%0A%20%20%20If%20none%20of%20the%20above%20works%2C%20move%20your%20existing%20%60volumes%60%20directory%20elsewhere%20and%20try%20deploying%20Dify%20in%20a%20fresh%20directory.%20If%20the%20error%20disappears%2C%20it%27s%20likely%20tied%20to%20old%20Docker%20data.%0A%0AFor%20more%20details%20on%20migration%20and%20persistent%20storage%2C%20see%20the%20%5BDify%20Docker%20README%5D%28https%3A//github.com/langgenius/dify/blob/df2f1eb028f9e7c7083e96b2c90ee28cb7f53a6d/docker/README.md%23L10-L55%29%20and%20review%20your%20%60docker-compose.yaml%60%20for%20correct%20volume%20mounts%20and%20environment%20variables.%0A%0ALet%20me%20know%20if%20you%20need%20more%20specific%20steps%20for%20your%20environment%21)&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/issues/29806)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21116