allocated size is greater than max storage size #130

Open
opened 2026-02-16 00:20:01 -05:00 by yindo · 3 comments
Owner

Originally created by @hefeinantongjulebu on GitHub (Jun 5, 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 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.4.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

plugin use Persistent Storage,error is:

Image
we find this code :

Image

then we modify plugin_daemon environment variable PERSISTENCE_STORAGE_MAX_SIZE=104857600000,this is a big enough number and far more than I need to store, but still tell me allocated size is greater than max storage size

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @hefeinantongjulebu on GitHub (Jun 5, 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 [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 (我已阅读并同意 [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.4.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce plugin use Persistent Storage,error is: ![Image](https://github.com/user-attachments/assets/e65fd89c-d4ed-48cb-8548-f0dd011ec06c) we find this code : ![Image](https://github.com/user-attachments/assets/ac11fd53-ff41-45bb-b495-1c9751faf43e) then we modify plugin_daemon environment variable PERSISTENCE_STORAGE_MAX_SIZE=104857600000,this is a big enough number and far more than I need to store, but still tell me allocated size is greater than max storage size ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
Author
Owner

@hanqingwu commented on GitHub (Jun 6, 2025):

Image

Hi @hefeinantongjulebu , maybe should check storage.Size in db ?

@hanqingwu commented on GitHub (Jun 6, 2025): ![Image](https://github.com/user-attachments/assets/3faef43c-8e89-43b7-9f6a-966ca0ae9f77) Hi @hefeinantongjulebu , maybe should check storage.Size in db ?
Author
Owner

@amine-y commented on GitHub (Feb 2, 2026):

@dosu do you have any news about this?

@amine-y commented on GitHub (Feb 2, 2026): @dosu do you have any news about this?
Author
Owner

@dosubot[bot] commented on GitHub (Feb 2, 2026):

Hi @amine-y! I'm Dosu and I’m helping the dify-plugin-daemon team.

Here’s what I found: the error persists even after increasing PERSISTENCE_STORAGE_MAX_SIZE because the storage size counter in the database is incremented every time you save data—even when you overwrite an existing key. The previous size isn’t subtracted, so the counter can quickly exceed the real disk usage, especially if you overwrite keys often. This leads to the “allocated size is greater than max storage size” error, even if you have plenty of actual space left. Deleting keys does subtract their size, but it can’t fix over-counting from repeated overwrites.

Workarounds: delete keys before overwriting them, or manually reset the TenantStorage counter in the database if it’s drifted out of sync with actual usage. For long-term stability, you may want to periodically reconcile the database counter with the real storage usage.
Reference: core persistence logic

Let me know if you want help with specific SQL or operational steps!

To reply, just mention @dosu.


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

Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Feb 2, 2026): <!-- Greeting --> Hi @amine-y! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify-plugin-daemon team. <!-- Answer --> Here’s what I found: the error persists even after increasing `PERSISTENCE_STORAGE_MAX_SIZE` because the storage size counter in the database is incremented every time you save data—even when you overwrite an existing key. The previous size isn’t subtracted, so the counter can quickly exceed the real disk usage, especially if you overwrite keys often. This leads to the “allocated size is greater than max storage size” error, even if you have plenty of actual space left. Deleting keys does subtract their size, but it can’t fix over-counting from repeated overwrites. Workarounds: delete keys before overwriting them, or manually reset the `TenantStorage` counter in the database if it’s drifted out of sync with actual usage. For long-term stability, you may want to periodically reconcile the database counter with the real storage usage. [Reference: core persistence logic](https://github.com/langgenius/dify-plugin-daemon/blob/f272e6c3fcd8a18c6ff571d7fcbfde857f63ef99/internal/core/persistence/persistence.go#L37-L157) Let me know if you want help with specific SQL or operational steps! <!-- 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/5d186d28-3ce5-4d9c-8423-41514f526bde?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/5d186d28-3ce5-4d9c-8423-41514f526bde?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/5d186d28-3ce5-4d9c-8423-41514f526bde?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/5d186d28-3ce5-4d9c-8423-41514f526bde?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/5d186d28-3ce5-4d9c-8423-41514f526bde?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/5d186d28-3ce5-4d9c-8423-41514f526bde?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/5d186d28-3ce5-4d9c-8423-41514f526bde?feedback_type=other)</sup> [![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=Here%E2%80%99s%20what%20I%20found%3A%20the%20error%20persists%20even%20after%20increasing%20%60PERSISTENCE_STORAGE_MAX_SIZE%60%20because%20the%20storage%20size%20counter%20in%20the%20database%20is%20incremented%20every%20time%20you%20save%20data%E2%80%94even%20when%20you%20overwrite%20an%20existing%20key.%20The%20previous%20size%20isn%E2%80%99t%20subtracted%2C%20so%20the%20counter%20can%20quickly%20exceed%20the%20real%20disk%20usage%2C%20especially%20if%20you%20overwrite%20keys%20often.%20This%20leads%20to%20the%20%E2%80%9Callocated%20size%20is%20greater%20than%20max%20storage%20size%E2%80%9D%20error%2C%20even%20if%20you%20have%20plenty%20of%20actual%20space%20left.%20Deleting%20keys%20does%20subtract%20their%20size%2C%20but%20it%20can%E2%80%99t%20fix%20over-counting%20from%20repeated%20overwrites.%20%0A%0AWorkarounds%3A%20delete%20keys%20before%20overwriting%20them%2C%20or%20manually%20reset%20the%20%60TenantStorage%60%20counter%20in%20the%20database%20if%20it%E2%80%99s%20drifted%20out%20of%20sync%20with%20actual%20usage.%20For%20long-term%20stability%2C%20you%20may%20want%20to%20periodically%20reconcile%20the%20database%20counter%20with%20the%20real%20storage%20usage.%20%20%0A%5BReference%3A%20core%20persistence%20logic%5D%28https%3A//github.com/langgenius/dify-plugin-daemon/blob/f272e6c3fcd8a18c6ff571d7fcbfde857f63ef99/internal/core/persistence/persistence.go%23L37-L157%29%0A%0ALet%20me%20know%20if%20you%20want%20help%20with%20specific%20SQL%20or%20operational%20steps%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-plugin-daemon/issues/355)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-daemon#130