vertex error #4963

Closed
opened 2026-02-21 18:08:47 -05:00 by yindo · 2 comments
Owner

Originally created by @Mgrsc on GitHub (Aug 8, 2024).

Originally assigned to: @crazywoola on GitHub.

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

0.6.16

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

image
[vertex_ai] Error: {'type': 'error', 'error': {'details': None, 'type': 'overloaded_error', 'message': 'Overloaded'}}

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @Mgrsc on GitHub (Aug 8, 2024). Originally assigned to: @crazywoola on GitHub. ### 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 0.6.16 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![image](https://github.com/user-attachments/assets/99e4274c-b2e0-4b57-a537-fdce6ffe96c2) [vertex_ai] Error: {'type': 'error', 'error': {'details': None, 'type': 'overloaded_error', 'message': 'Overloaded'}} ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:08:47 -05:00
yindo closed this issue 2026-02-21 18:08:47 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 8, 2024):

To resolve the "overloaded_error" issue with Vertex AI in your self-hosted Dify version 0.6.16 running on Docker, you need to handle the specific exceptions that correspond to server overload or rate limiting. The provided code already maps various exceptions to unified error types, including InvokeRateLimitError and InvokeServerUnavailableError.

Here is the relevant part of the code that maps these exceptions:

def _invoke_error_mapping(self) -> dict[type[InvokeError], list[type[Exception]]]:
    """
    Map model invoke error to unified error
    The key is the error type thrown to the caller
    The value is the error type thrown by the model,
    which needs to be converted into a unified error type for the caller.
    :return: Invoke error mapping
    """
    return {
        InvokeConnectionError: [
            exceptions.RetryError
        ],
        InvokeServerUnavailableError: [
            exceptions.ServiceUnavailable,
            exceptions.InternalServerError,
            exceptions.BadGateway,
            exceptions.GatewayTimeout,
            exceptions.DeadlineExceeded
        ],
        InvokeRateLimitError: [
            exceptions.ResourceExhausted,
            exceptions.TooManyRequests
        ],
        InvokeAuthorizationError: [
            exceptions.Unauthenticated,
            exceptions.PermissionDenied,
            exceptions.Unauthenticated,
            exceptions.Forbidden
        ],
        InvokeBadRequestError: [
            exceptions.BadRequest,
            exceptions.InvalidArgument,
            exceptions.FailedPrecondition,
            exceptions.OutOfRange,
            exceptions.NotFound,
            exceptions.MethodNotAllowed,
            exceptions.Conflict,
            exceptions.AlreadyExists,
            exceptions.Aborted,
            exceptions.LengthRequired,
            exceptions.PreconditionFailed,
            exceptions.RequestRangeNotSatisfiable,
            exceptions.Cancelled,
        ]
    }

To handle the "overloaded_error" issue, ensure that your code catches these specific exceptions and implements appropriate retry logic or error handling mechanisms. For example:

try:
    # Your code to invoke the model
    result = self._generate(model, credentials, prompt_messages, model_parameters, tools, stop, stream, user)
except exceptions.ResourceExhausted as e:
    # Handle rate limit error
    raise InvokeRateLimitError("Rate limit exceeded, please try again later.") from e
except exceptions.ServiceUnavailable as e:
    # Handle server unavailable error
    raise InvokeServerUnavailableError("Service is currently unavailable, please try again later.") from e
except exceptions.InternalServerError as e:
    # Handle internal server error
    raise InvokeServerUnavailableError("Internal server error, please try again later.") from e
# Add other specific exception handling as needed

By catching these exceptions and providing meaningful error messages or retry logic, you can better manage the "overloaded_error" issue with Vertex AI [1].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Aug 8, 2024): <!-- Answer --> To resolve the "overloaded_error" issue with Vertex AI in your self-hosted Dify version 0.6.16 running on Docker, you need to handle the specific exceptions that correspond to server overload or rate limiting. The provided code already maps various exceptions to unified error types, including `InvokeRateLimitError` and `InvokeServerUnavailableError`. Here is the relevant part of the code that maps these exceptions: ```python def _invoke_error_mapping(self) -> dict[type[InvokeError], list[type[Exception]]]: """ Map model invoke error to unified error The key is the error type thrown to the caller The value is the error type thrown by the model, which needs to be converted into a unified error type for the caller. :return: Invoke error mapping """ return { InvokeConnectionError: [ exceptions.RetryError ], InvokeServerUnavailableError: [ exceptions.ServiceUnavailable, exceptions.InternalServerError, exceptions.BadGateway, exceptions.GatewayTimeout, exceptions.DeadlineExceeded ], InvokeRateLimitError: [ exceptions.ResourceExhausted, exceptions.TooManyRequests ], InvokeAuthorizationError: [ exceptions.Unauthenticated, exceptions.PermissionDenied, exceptions.Unauthenticated, exceptions.Forbidden ], InvokeBadRequestError: [ exceptions.BadRequest, exceptions.InvalidArgument, exceptions.FailedPrecondition, exceptions.OutOfRange, exceptions.NotFound, exceptions.MethodNotAllowed, exceptions.Conflict, exceptions.AlreadyExists, exceptions.Aborted, exceptions.LengthRequired, exceptions.PreconditionFailed, exceptions.RequestRangeNotSatisfiable, exceptions.Cancelled, ] } ``` To handle the "overloaded_error" issue, ensure that your code catches these specific exceptions and implements appropriate retry logic or error handling mechanisms. For example: ```python try: # Your code to invoke the model result = self._generate(model, credentials, prompt_messages, model_parameters, tools, stop, stream, user) except exceptions.ResourceExhausted as e: # Handle rate limit error raise InvokeRateLimitError("Rate limit exceeded, please try again later.") from e except exceptions.ServiceUnavailable as e: # Handle server unavailable error raise InvokeServerUnavailableError("Service is currently unavailable, please try again later.") from e except exceptions.InternalServerError as e: # Handle internal server error raise InvokeServerUnavailableError("Internal server error, please try again later.") from e # Add other specific exception handling as needed ``` By catching these exceptions and providing meaningful error messages or retry logic, you can better manage the "overloaded_error" issue with Vertex AI <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/model_providers/vertex_ai/llm/llm.py)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Aug 8, 2024):

It seems something is happening on their side.

https://docs.anthropic.com/en/api/errors

@crazywoola commented on GitHub (Aug 8, 2024): It seems something is happening on their side. https://docs.anthropic.com/en/api/errors
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4963