Dify Cloud – Google AI Studio provider cannot validate credentials #776

Closed
opened 2026-02-16 10:20:28 -05:00 by yindo · 3 comments
Owner

Originally created by @nhinguyen120499 on GitHub (Nov 4, 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.9.2

Cloud or Self Hosted

Cloud

Steps to reproduce

  1. Remove provider
  2. Add again with new Google AI Studio API key
  3. Save → error
    Expected: Validate success
    Actual: PluginInvokeError
    Yesterday it worked normally, today fails.

✔️ Expected Behavior

Adding new Google AI Studio API key successfully

Actual Behavior

Error: Google LargeLanguageModel.validate_credentials() missing 1 required positional argument: 'self'
Req_id: d5a182f118

Image
Originally created by @nhinguyen120499 on GitHub (Nov 4, 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.9.2 ### Cloud or Self Hosted Cloud ### Steps to reproduce 1. Remove provider 2. Add again with new Google AI Studio API key 3. Save → error Expected: Validate success Actual: PluginInvokeError Yesterday it worked normally, today fails. ### ✔️ Expected Behavior Adding new Google AI Studio API key successfully ### ❌ Actual Behavior Error: Google LargeLanguageModel.validate_credentials() missing 1 required positional argument: 'self' Req_id: d5a182f118 <img width="387" height="109" alt="Image" src="https://github.com/user-attachments/assets/a2122062-5bf8-46af-bb48-af23a92d2fda" />
yindo added the bug label 2026-02-16 10:20:28 -05:00
yindo closed this issue 2026-02-16 10:20:28 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 4, 2025):

Hi @nhinguyen120499! I'm Dosu and I’m helping the dify team.

The error happens because the validate_credentials method in GoogleLargeLanguageModel is defined as an instance method (expects self), but it's called as a class/static method during provider credential validation. This mismatch causes Python to throw the "missing 1 required positional argument: 'self'" TypeError.

To fix this, the method should be decorated with @classmethod (using cls instead of self) or @staticmethod if it doesn't need instance or class state. This pattern has resolved similar issues for other providers like Siliconflow and Anthropic in Dify. You can see a working example of the fix for Siliconflow here and for Anthropic here.

If you have access to the code, update the method definition to:

@classmethod
def validate_credentials(cls, model: str, credentials: dict) -> None:
    # method body

This should resolve the credential validation error for Google AI Studio in Dify Cloud v1.9.2.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Nov 4, 2025): <!-- Greeting --> Hi @nhinguyen120499! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> The error happens because the `validate_credentials` method in `GoogleLargeLanguageModel` is defined as an instance method (expects `self`), but it's called as a class/static method during provider credential validation. This mismatch causes Python to throw the "missing 1 required positional argument: 'self'" TypeError. To fix this, the method should be decorated with `@classmethod` (using `cls` instead of `self`) or `@staticmethod` if it doesn't need instance or class state. This pattern has resolved similar issues for other providers like Siliconflow and Anthropic in Dify. You can see a working example of the fix for Siliconflow [here](https://github.com/langgenius/dify-official-plugins/issues/1860) and for Anthropic [here](https://github.com/langgenius/dify-official-plugins/issues/1933). If you have access to the code, update the method definition to: ```python @classmethod def validate_credentials(cls, model: str, credentials: dict) -> None: # method body ``` This should resolve the credential validation error for Google AI Studio in Dify Cloud v1.9.2. <!-- 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/fa302c11-e805-4671-8df3-4674a4a53f00?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/fa302c11-e805-4671-8df3-4674a4a53f00?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/fa302c11-e805-4671-8df3-4674a4a53f00?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/fa302c11-e805-4671-8df3-4674a4a53f00?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/fa302c11-e805-4671-8df3-4674a4a53f00?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/fa302c11-e805-4671-8df3-4674a4a53f00?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/fa302c11-e805-4671-8df3-4674a4a53f00?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&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/27853)
Author
Owner

@dosubot[bot] commented on GitHub (Nov 4, 2025):

This error happens because the validate_credentials method in the Google AI Studio provider is defined as an instance method (it expects self), but somewhere in the plugin system it's being called as if it were a static or class method, so Python doesn't pass the self argument, resulting in the "missing 1 required positional argument: 'self'" TypeError. This is a recurring bug pattern seen in other Dify plugins like Anthropic, Siliconflow, and Bedrock as well (example, example, example).

The root cause is that the plugin system or daemon is not instantiating the model class before calling its instance methods. Other plugins have fixed this by either making validate_credentials a @classmethod or by adding a _validate_credentials method that matches the expected interface.

There is not yet a merged fix or workaround specifically for the Google AI Studio provider, but based on how similar issues were resolved, the maintainers will likely need to update the plugin to ensure credential validation is called on an instance, or refactor the method to be a classmethod. If you have control over the plugin code, you can try changing validate_credentials to a @classmethod and update its signature to use cls instead of self (see workaround for Siliconflow). Otherwise, you may need to wait for an official patch.

This is not a configuration or credential issue on your end—it's a bug in the plugin's method definition or how it's invoked by the platform.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Nov 4, 2025): <!-- Answer --> This error happens because the `validate_credentials` method in the Google AI Studio provider is defined as an instance method (it expects `self`), but somewhere in the plugin system it's being called as if it were a static or class method, so Python doesn't pass the `self` argument, resulting in the "missing 1 required positional argument: 'self'" TypeError. This is a recurring bug pattern seen in other Dify plugins like Anthropic, Siliconflow, and Bedrock as well ([example](https://github.com/langgenius/dify-official-plugins/issues/1933), [example](https://github.com/langgenius/dify-official-plugins/issues/1860), [example](https://github.com/langgenius/dify-official-plugins/issues/1892)). The root cause is that the plugin system or daemon is not instantiating the model class before calling its instance methods. Other plugins have fixed this by either making `validate_credentials` a `@classmethod` or by adding a `_validate_credentials` method that matches the expected interface. There is not yet a merged fix or workaround specifically for the Google AI Studio provider, but based on how similar issues were resolved, the maintainers will likely need to update the plugin to ensure credential validation is called on an instance, or refactor the method to be a classmethod. If you have control over the plugin code, you can try changing `validate_credentials` to a `@classmethod` and update its signature to use `cls` instead of `self` ([see workaround for Siliconflow](https://github.com/langgenius/dify-official-plugins/issues/1860)). Otherwise, you may need to wait for an official patch. This is not a configuration or credential issue on your end—it's a bug in the plugin's method definition or how it's invoked by the platform. <!-- 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/c6472fbf-bb61-494d-851a-c7b781095f7e?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/c6472fbf-bb61-494d-851a-c7b781095f7e?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/c6472fbf-bb61-494d-851a-c7b781095f7e?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/c6472fbf-bb61-494d-851a-c7b781095f7e?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/c6472fbf-bb61-494d-851a-c7b781095f7e?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/c6472fbf-bb61-494d-851a-c7b781095f7e?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/c6472fbf-bb61-494d-851a-c7b781095f7e?feedback_type=other)</sup>&nbsp;&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-official-plugins/issues/1999)
Author
Owner

@nhinguyen120499 commented on GitHub (Nov 4, 2025):

Thanks for the clarification. Since this issue completely blocks adding or rotating Google AI Studio credentials on Dify Cloud, could you please provide an estimated timeline for the fix (ETA)?

We need to know whether the patch will be applied within hours/days so that we can plan whether to wait or switch provider temporarily.

Is the fix already under development or scheduled for an upcoming Cloud deployment?

Looking forward to your update — this is production-blocking for us.

@nhinguyen120499 commented on GitHub (Nov 4, 2025): Thanks for the clarification. Since this issue completely blocks adding or rotating Google AI Studio credentials on Dify Cloud, could you please provide an estimated timeline for the fix (ETA)? We need to know whether the patch will be applied within hours/days so that we can plan whether to wait or switch provider temporarily. Is the fix already under development or scheduled for an upcoming Cloud deployment? Looking forward to your update — this is production-blocking for us.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#776