Show「You have reached the limit of your subscription.」 #1134

Closed
opened 2026-02-21 17:30:09 -05:00 by yindo · 9 comments
Owner

Originally created by @xmsz-stu on GitHub (Feb 29, 2024).

Originally assigned to: @GarfieldDai on GitHub.

Self Checks

  • 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).
  • Pleas do not modify this template :) and fill in all the required fields.

Provide a description of the help you need

data: {
      code: 'unauthorized',
      message: 'You have reached the limit of your subscription.',
      status: 401
    }

Why this happend?

Originally created by @xmsz-stu on GitHub (Feb 29, 2024). Originally assigned to: @GarfieldDai on GitHub. ### Self Checks - [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] Pleas do not modify this template :) and fill in all the required fields. ### Provide a description of the help you need ``` data: { code: 'unauthorized', message: 'You have reached the limit of your subscription.', status: 401 } ``` Why this happend?
yindo closed this issue 2026-02-21 17:30:09 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 29, 2024):

🤖

Hey there, @xmsz-stu! 👋 Great to see you back. What's cooking this time?

Based on the error message you're receiving, it seems like you've reached the limit of your current subscription plan. This could be due to a few reasons:

  1. User Authentication Failure: The @login_required decorator ensures that a user must be logged in to access the endpoints. If the user's authentication fails or the user's session has expired, it could trigger a 401 Unauthorized error.

  2. Subscription Plan Limit Reached: The error message specifically mentions reaching the limit of a subscription. This suggests that the logic within BillingService.get_subscription or another part of the BillingService checks the user's current subscription plan against their usage or entitlements. If the user's actions exceed what their subscription plan allows, the service could be designed to return a 401 status code, although a 403 Forbidden or a custom error code might be more appropriate for this scenario.

  3. Tenant Ownership or Admin Rights: The method BillingService.is_tenant_owner_or_admin(current_user) checks if the current user is either the tenant owner or an admin. If this check fails, it could lead to an error. However, the expected behavior would typically be to throw an error explicitly stating the lack of permissions, unless it's implicitly understood that only owners or admins can query subscription information and exceeding this limit is treated as an unauthorized access.

  4. Edition Check Failure: The @only_edition_cloud decorator suggests that this endpoint is restricted to a specific edition of the software, presumably a cloud edition. If the user's account does not meet this criterion, it could result in a 401 error, although, similar to the tenant ownership check, a more specific error code or message might be expected.

Without more information, it's hard to pinpoint the exact cause. However, the most direct cause related to the specific error message about reaching a subscription limit would be tied to the logic within BillingService.get_subscription or related billing service methods that enforce subscription limits.

For more details, you can refer to the source code in the api/controllers/console/billing/billing.py and api/services/billing_service.py files.

If you need further assistance, please provide more details about the actions you were trying to perform when you encountered this error, and any additional error messages or logs you may have. This will help in diagnosing the issue more accurately.

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@dosubot[bot] commented on GitHub (Feb 29, 2024): _🤖_ <!-- Greeting --> Hey there, @xmsz-stu! 👋 Great to see you back. What's cooking this time? <!-- Answer --> Based on the error message you're receiving, it seems like you've reached the limit of your current subscription plan. This could be due to a few reasons: 1. **User Authentication Failure**: The `@login_required` decorator ensures that a user must be logged in to access the endpoints. If the user's authentication fails or the user's session has expired, it could trigger a 401 Unauthorized error. 2. **Subscription Plan Limit Reached**: The error message specifically mentions reaching the limit of a subscription. This suggests that the logic within `BillingService.get_subscription` or another part of the `BillingService` checks the user's current subscription plan against their usage or entitlements. If the user's actions exceed what their subscription plan allows, the service could be designed to return a 401 status code, although a 403 Forbidden or a custom error code might be more appropriate for this scenario. 3. **Tenant Ownership or Admin Rights**: The method `BillingService.is_tenant_owner_or_admin(current_user)` checks if the current user is either the tenant owner or an admin. If this check fails, it could lead to an error. However, the expected behavior would typically be to throw an error explicitly stating the lack of permissions, unless it's implicitly understood that only owners or admins can query subscription information and exceeding this limit is treated as an unauthorized access. 4. **Edition Check Failure**: The `@only_edition_cloud` decorator suggests that this endpoint is restricted to a specific edition of the software, presumably a cloud edition. If the user's account does not meet this criterion, it could result in a 401 error, although, similar to the tenant ownership check, a more specific error code or message might be expected. Without more information, it's hard to pinpoint the exact cause. However, the most direct cause related to the specific error message about reaching a subscription limit would be tied to the logic within `BillingService.get_subscription` or related billing service methods that enforce subscription limits. For more details, you can refer to the source code in the [api/controllers/console/billing/billing.py](https://github.com/langgenius/dify/blob/main/api/controllers/console/billing/billing.py) and [api/services/billing_service.py](https://github.com/langgenius/dify/blob/main/api/services/billing_service.py) files. If you need further assistance, please provide more details about the actions you were trying to perform when you encountered this error, and any additional error messages or logs you may have. This will help in diagnosing the issue more accurately. ## Sources - [api/controllers/console/billing/billing.py](https://github.com/langgenius/dify/blob/main/api/controllers/console/billing/billing.py) - [api/services/billing_service.py](https://github.com/langgenius/dify/blob/main/api/services/billing_service.py) <!-- Dosu Comment Footer --> <details open> <summary> #### About Dosu </summary> This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. </details>
Author
Owner

@crazywoola commented on GitHub (Feb 29, 2024):

Obviously :)

You have reached the limit of your subscription.

@crazywoola commented on GitHub (Feb 29, 2024): Obviously :) > You have reached the limit of your subscription.
Author
Owner

@xmsz-stu commented on GitHub (Mar 1, 2024):

Contributor

image

Which is the limit of subscription

@xmsz-stu commented on GitHub (Mar 1, 2024): > Contributor > ### <img width="694" alt="image" src="https://github.com/langgenius/dify/assets/139225486/7a8acc3c-c232-4250-a552-f8db9218f47c"> Which is the limit of subscription
Author
Owner

@GarfieldDai commented on GitHub (Mar 1, 2024):

Your vector space is out of limit. It seems the problem is frontend cache. Plz refresh browser and you can see true vector space.
@xmsz-stu

@GarfieldDai commented on GitHub (Mar 1, 2024): Your vector space is out of limit. It seems the problem is frontend cache. Plz refresh browser and you can see true vector space. @xmsz-stu
Author
Owner

@xmsz-stu commented on GitHub (Mar 3, 2024):

Your vector space is out of limit. It seems the problem is frontend cache. Plz refresh browser and you can see true vector space. @xmsz-stu

ok

  • How do I know the vector space size used by each article?
  • I only have 135 articles now, and 58 thousand characters feel too few.
  • How do I recover the vector space? Does deleting articles recover it?
  • How do I control the size of my vector space, such as by limiting the character length of articles?
@xmsz-stu commented on GitHub (Mar 3, 2024): > Your vector space is out of limit. It seems the problem is frontend cache. Plz refresh browser and you can see true vector space. @xmsz-stu ok - How do I know the vector space size used by each article? - I only have 135 articles now, and 58 thousand characters feel too few. - How do I recover the vector space? Does deleting articles recover it? - How do I control the size of my vector space, such as by limiting the character length of articles?
Author
Owner

@GarfieldDai commented on GitHub (Mar 3, 2024):

  • How do I know the vector space size used by each article?

    total_words_size = words * 3
    total_vector_size = 1536 * 4 * document_segments_size
    vector_size = (total_words_size + total_vector_size) / 1024 / 1024

  • I only have 135 articles now, and 58 thousand characters feel too few.

    Your total_vector_size is almost 4.8 MB(1536 * 4 * 822 / 1024 / 1024). Because you have many document segments.

  • How do I recover the vector space? Does deleting articles recover it?

    Yes. You also can make a professional subscription to get 200 MB vector space.

  • How do I control the size of my vector space, such as by limiting the character length of articles?

    Refer above calculation, you should make your document segment more suitable.

@GarfieldDai commented on GitHub (Mar 3, 2024): - How do I know the vector space size used by each article? > total_words_size = words * 3 > total_vector_size = 1536 * 4 * document_segments_size > vector_size = (total_words_size + total_vector_size) / 1024 / 1024 - I only have 135 articles now, and 58 thousand characters feel too few. > Your total_vector_size is almost 4.8 MB(1536 * 4 * 822 / 1024 / 1024). Because you have many document segments. - How do I recover the vector space? Does deleting articles recover it? > Yes. You also can make a professional subscription to get 200 MB vector space. - How do I control the size of my vector space, such as by limiting the character length of articles? > Refer above calculation, you should make your document segment more suitable.
Author
Owner

@xmsz-stu commented on GitHub (Mar 3, 2024):

  • How do I know the vector space size used by each article?

    total_words_size = words * 3
    total_vector_size = 1536 * 4 * document_segments_size
    vector_size = (total_words_size + total_vector_size) / 1024 / 1024

  • I only have 135 articles now, and 58 thousand characters feel too few.

    Your total_vector_size is almost 4.8 MB(1536 * 4 * 822 / 1024 / 1024). Because you have many document segments.

  • How do I recover the vector space? Does deleting articles recover it?

    Yes. You also can make a professional subscription to get 200 MB vector space.

  • How do I control the size of my vector space, such as by limiting the character length of articles?

    Refer above calculation, you should make your document segment more suitable.

ok
I deleted files, but still can't upload
image
image

@xmsz-stu commented on GitHub (Mar 3, 2024): > * How do I know the vector space size used by each article? > > total_words_size = words * 3 > > total_vector_size = 1536 * 4 * document_segments_size > > vector_size = (total_words_size + total_vector_size) / 1024 / 1024 > * I only have 135 articles now, and 58 thousand characters feel too few. > > Your total_vector_size is almost 4.8 MB(1536 * 4 * 822 / 1024 / 1024). Because you have many document segments. > * How do I recover the vector space? Does deleting articles recover it? > > Yes. You also can make a professional subscription to get 200 MB vector space. > * How do I control the size of my vector space, such as by limiting the character length of articles? > > Refer above calculation, you should make your document segment more suitable. ok I deleted files, but still can't upload <img width="373" alt="image" src="https://github.com/langgenius/dify/assets/139225486/d1ed637a-fb37-4637-9113-72c5bd2ee880"> <img width="385" alt="image" src="https://github.com/langgenius/dify/assets/139225486/8853abc8-ef14-4060-9568-e6850acbb602">
Author
Owner

@GarfieldDai commented on GitHub (Mar 3, 2024):

The reason is that the size of documents is out of limit. Sandbox only have 50 quota for documents upload. There was a update yesterday.
image

@GarfieldDai commented on GitHub (Mar 3, 2024): The reason is that the size of documents is out of limit. Sandbox only have 50 quota for documents upload. There was a update yesterday. ![image](https://github.com/langgenius/dify/assets/28395549/dace9311-7d4a-4fd6-9a03-5ae0f04a79e7)
Author
Owner

@xmsz-stu commented on GitHub (Mar 4, 2024):

The reason is that the size of documents is out of limit. Sandbox only have 50 quota for documents upload. There was a update yesterday. image

Alright

@xmsz-stu commented on GitHub (Mar 4, 2024): > The reason is that the size of documents is out of limit. Sandbox only have 50 quota for documents upload. There was a update yesterday. ![image](https://private-user-images.githubusercontent.com/28395549/309627818-dace9311-7d4a-4fd6-9a03-5ae0f04a79e7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDk1MzI1NDEsIm5iZiI6MTcwOTUzMjI0MSwicGF0aCI6Ii8yODM5NTU0OS8zMDk2Mjc4MTgtZGFjZTkzMTEtN2Q0YS00ZmQ2LTlhMDMtNWFlMGYwNGE3OWU3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAzMDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMzA0VDA2MDQwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTlhZDRiYWU0MTIxNGJlOWQ2N2E0NzA5YzQwZGI2ZWIyM2VkNjNjZmE5NDY3Yjc4YzM3Nzc1ZDkyYjE2MWIxMzcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.wHIBI7zaeGR3XOyM65CS8uJSWS1ZCbf3K1P-TPvzOn8) Alright
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#1134