Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gemini API returns 503 error with MissingFieldException #220

Open
surajsahani opened this issue Nov 16, 2024 · 5 comments
Open

Gemini API returns 503 error with MissingFieldException #220

surajsahani opened this issue Nov 16, 2024 · 5 comments
Labels
component:android sdk Issue/PR related to Android SDK status:triaged Issue/PR triaged to the corresponding sub-team type:help Support-related issues

Comments

@surajsahani
Copy link

Description of the bug:

When interacting with the Gemini API, the following error message is received in the log:

D  Error message received: Unexpected Response:
{
  "error": {
    "code": 503,
    "message": "The model is overloaded. Please try again later.",
    "status": "UNAVAILABLE"
  }
}
kotlinx.serialization.MissingFieldException: Field 'details' is required for type with serial name 'com.google.ai.client.generativeai.common.server.GRpcError', but it was missing at path: $.error

This indicates that the API is overloaded, but it also throws a MissingFieldException related to the 'details' field when parsing the response.

Actual vs expected behavior:

Actual: The response includes a 503 error code with the message "The model is overloaded." Additionally, a MissingFieldException is thrown due to the missing 'details' field.
Expected: The API should either provide a valid response with the necessary 'details' field or handle missing fields gracefully without throwing an exception.

Any other information you'd like to share?

This error occurs during normal API interaction when the model is under heavy load. It would be helpful to have the API gracefully handle missing fields in error responses to prevent application crashes.

@adrdev10
Copy link

I think adding the missing field will give some inshights to the error that's happening in Google's side. It's a weekend so I doubt that that the team will be able to take a look at it today or tomorrow.

This is the error I'm also getting

{
"error": {
    "code": 503,
    "message": "The model is overloaded. Please try again later.",
    "status": "UNAVAILABLE"
    }
}
kotlinx.serialization.MissingFieldException: Field 'details' is required for type with serial name 'com.google.ai.client.generativeai.common.server.GRpcError', but it was missing at path: $.error

@gmKeshari gmKeshari added type:help Support-related issues component:android sdk Issue/PR related to Android SDK status:triaged Issue/PR triaged to the corresponding sub-team labels Nov 20, 2024
@gmKeshari
Copy link

Hi @surajsahani,

Were you getting the errors earlier also?? I mean whether it was working earlier and suddenly you started seeing these errors or from very beginning you were getting these errors?

@surajsahani
Copy link
Author

surajsahani commented Nov 21, 2024

This issue started suddenly from last 4-5 days @gmKeshari

@surajsahani
Copy link
Author

I think adding the missing field will give some inshights to the error that's happening in Google's side. It's a weekend so I doubt that that the team will be able to take a look at it today or tomorrow.

This is the error I'm also getting

{
"error": {
    "code": 503,
    "message": "The model is overloaded. Please try again later.",
    "status": "UNAVAILABLE"
    }
}
kotlinx.serialization.MissingFieldException: Field 'details' is required for type with serial name 'com.google.ai.client.generativeai.common.server.GRpcError', but it was missing at path: $.error

+1 This has been happening from last week, when new gemini model drop for Iphone

@gmKeshari
Copy link

Hey @surajsahani,

Due to overload this issue was reported by many users last week. Our team is working to fix this. You can consider this as a temporary issue.

Temporarily switch to another model (e.g. from Gemini 1.5 Pro to Gemini 1.5 Flash) and see if it works. Or wait a bit and retry your request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:android sdk Issue/PR related to Android SDK status:triaged Issue/PR triaged to the corresponding sub-team type:help Support-related issues
Projects
None yet
Development

No branches or pull requests

3 participants