Hugging Face Hub: invalid user #716

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

Originally created by @hiiamboris on GitHub (Oct 14, 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 Dify issues & Dify Official Plugins, 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.9.0

Plugin version

0.0.5

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Configure an inference endpoint at Hugging Face.
  2. Try adding it to Dify: it always errors out with "User Name or Organization Name is invalid." message

(sure, all parameters were entered correctly, according to the plugin docs)

✔️ Error log

2025-10-14 18:01:33.936 ERROR [Dummy-197] [base.py:211] - Error in stream reponse for plugin {'code': -500, 'message': '{"message":"{\\"args\\":{},\\"error_type\\":\\"CredentialsValidateFailedError\\",\\"message\\":\\"User Name or Organization Name is invalid.\\"}","error_type":"PluginInvokeError","args":null}', 'data': None}
2025-10-14 18:01:33.942 ERROR [Dummy-197] [models.py:287] - Failed to save model credentials, tenant_id: 78abecd7-cf2c-4b78-99c2-7baa4f313f56, model: nomic-embed-code-gguf-wow, model_type: text-embedding
Traceback (most recent call last):
  File "/app/api/controllers/console/workspace/models.py", line 278, in post
    model_provider_service.create_model_credential(
  File "/app/api/services/model_provider_service.py", line 263, in create_model_credential
    provider_configuration.create_custom_model_credential(
  File "/app/api/core/entities/provider_configuration.py", line 928, in create_custom_model_credential
    credentials = self.validate_custom_model_credentials(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/core/entities/provider_configuration.py", line 901, in validate_custom_model_credentials
    return _validate(session)
           ^^^^^^^^^^^^^^^^^^
  File "/app/api/core/entities/provider_configuration.py", line 890, in _validate
    validated_credentials = model_provider_factory.model_credentials_validate(
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/core/model_runtime/model_providers/model_provider_factory.py", line 156, in model_credentials_validate
    self.plugin_model_manager.validate_model_credentials(
  File "/app/api/core/plugin/impl/model.py", line 137, in validate_model_credentials
    for resp in response:
                ^^^^^^^^
  File "/app/api/core/plugin/impl/base.py", line 212, in _request_with_plugin_daemon_response_stream
    self._handle_plugin_daemon_error(error.error_type, error.message)
  File "/app/api/core/plugin/impl/base.py", line 242, in _handle_plugin_daemon_error
    raise CredentialsValidateFailedError(error_object.get("message"))
core.model_runtime.errors.validate.CredentialsValidateFailedError: User Name or Organization Name is invalid.
Originally created by @hiiamboris on GitHub (Oct 14, 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 [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/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.9.0 ### Plugin version 0.0.5 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. Configure an inference endpoint at Hugging Face. 2. Try adding it to Dify: it always errors out with "User Name or Organization Name is invalid." message (sure, all parameters were entered correctly, according to the plugin docs) ### ✔️ Error log ``` 2025-10-14 18:01:33.936 ERROR [Dummy-197] [base.py:211] - Error in stream reponse for plugin {'code': -500, 'message': '{"message":"{\\"args\\":{},\\"error_type\\":\\"CredentialsValidateFailedError\\",\\"message\\":\\"User Name or Organization Name is invalid.\\"}","error_type":"PluginInvokeError","args":null}', 'data': None} 2025-10-14 18:01:33.942 ERROR [Dummy-197] [models.py:287] - Failed to save model credentials, tenant_id: 78abecd7-cf2c-4b78-99c2-7baa4f313f56, model: nomic-embed-code-gguf-wow, model_type: text-embedding Traceback (most recent call last): File "/app/api/controllers/console/workspace/models.py", line 278, in post model_provider_service.create_model_credential( File "/app/api/services/model_provider_service.py", line 263, in create_model_credential provider_configuration.create_custom_model_credential( File "/app/api/core/entities/provider_configuration.py", line 928, in create_custom_model_credential credentials = self.validate_custom_model_credentials( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/core/entities/provider_configuration.py", line 901, in validate_custom_model_credentials return _validate(session) ^^^^^^^^^^^^^^^^^^ File "/app/api/core/entities/provider_configuration.py", line 890, in _validate validated_credentials = model_provider_factory.model_credentials_validate( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/core/model_runtime/model_providers/model_provider_factory.py", line 156, in model_credentials_validate self.plugin_model_manager.validate_model_credentials( File "/app/api/core/plugin/impl/model.py", line 137, in validate_model_credentials for resp in response: ^^^^^^^^ File "/app/api/core/plugin/impl/base.py", line 212, in _request_with_plugin_daemon_response_stream self._handle_plugin_daemon_error(error.error_type, error.message) File "/app/api/core/plugin/impl/base.py", line 242, in _handle_plugin_daemon_error raise CredentialsValidateFailedError(error_object.get("message")) core.model_runtime.errors.validate.CredentialsValidateFailedError: User Name or Organization Name is invalid. ```
yindo added the bug label 2026-02-16 10:20:17 -05:00
yindo closed this issue 2026-02-16 10:20:17 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 14, 2025):

The plugin validates the Hugging Face "User Name / Organization Name" (the huggingface_namespace field) by making a direct API request to Hugging Face's endpoints using your provided API token. If the namespace is not recognized or accessible, it returns the "User Name or Organization Name is invalid" error. The expected value for this field is either your Hugging Face account username or your organization name, exactly as shown in your Hugging Face account settings or the Inference Endpoints UI. Double-check for typos, extra spaces, or mismatches with your Hugging Face dashboard. Also, make sure your API token has the necessary permissions and that the endpoint URL matches the one shown in your Hugging Face deployment console. More details and screenshots are in the plugin's README and YAML config.

If everything looks correct and you still get the error, it could be a bug or a change in Hugging Face's API. In that case, try regenerating your API token, confirm your endpoint is active, and ensure your namespace is accessible via the Hugging Face API.

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 (Oct 14, 2025): <!-- Answer --> The plugin validates the Hugging Face "User Name / Organization Name" (the `huggingface_namespace` field) by making a direct API request to Hugging Face's endpoints using your provided API token. If the namespace is not recognized or accessible, it returns the "User Name or Organization Name is invalid" error. The expected value for this field is either your Hugging Face account username or your organization name, exactly as shown in your Hugging Face account settings or the Inference Endpoints UI. Double-check for typos, extra spaces, or mismatches with your Hugging Face dashboard. Also, make sure your API token has the necessary permissions and that the endpoint URL matches the one shown in your Hugging Face deployment console. More details and screenshots are in the plugin's [README](https://github.com/langgenius/dify-official-plugins/blob/d08137b120bd63878bd05504fa6273acc21dd2b1/models/huggingface_hub/README.md) and [YAML config](https://github.com/langgenius/dify-official-plugins/blob/d08137b120bd63878bd05504fa6273acc21dd2b1/models/huggingface_hub/provider/huggingface_hub.yaml). If everything looks correct and you still get the error, it could be a bug or a change in Hugging Face's API. In that case, try regenerating your API token, confirm your endpoint is active, and ensure your namespace is accessible via the Hugging Face API. <!-- 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/7721e07e-aeeb-4ea0-9936-cf7bad020c24?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/7721e07e-aeeb-4ea0-9936-cf7bad020c24?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/7721e07e-aeeb-4ea0-9936-cf7bad020c24?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/7721e07e-aeeb-4ea0-9936-cf7bad020c24?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/7721e07e-aeeb-4ea0-9936-cf7bad020c24?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/7721e07e-aeeb-4ea0-9936-cf7bad020c24?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/7721e07e-aeeb-4ea0-9936-cf7bad020c24?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/1859)
Author
Owner

@hiiamboris commented on GitHub (Oct 14, 2025):

I'm not dumb, I can spell hiiamboris just fine. And I tried a token with unlimited write permissions - to the same end. All tokens are fresh. Endpoint was active and even running. My own API calls work fine, no errors.

@hiiamboris commented on GitHub (Oct 14, 2025): I'm not dumb, I can spell `hiiamboris` just fine. And I tried a token with unlimited write permissions - to the same end. All tokens are fresh. Endpoint was active and even running. My own API calls work fine, no errors.
Author
Owner

@dosubot[bot] commented on GitHub (Oct 14, 2025):

You've clearly ruled out typos, token permissions, and endpoint status, and your direct API calls work—so this looks like a plugin-side bug or a mismatch in how Dify constructs or validates the Hugging Face request. The plugin expects the "User Name / Organization Name" field to match exactly what's shown in your Hugging Face account or org settings, but the actual credential validation logic in the plugin is either missing or handled elsewhere, which could mean it's enforcing stricter checks or misinterpreting the API response compared to your direct calls (plugin code, README). There are no recent fixes or open issues about this, so it's likely an edge case or a bug in the plugin's validation flow.

If you want to dig deeper, you could compare the exact request/response between your working direct API call and what Dify sends (using a proxy or logging), to spot any subtle differences in headers, endpoint URL, or payload. If the plugin is expecting a specific response structure or status code, even a minor difference could trigger the "invalid" error. If you find a mismatch, sharing those details could help pinpoint the bug.

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 (Oct 14, 2025): <!-- Answer --> You've clearly ruled out typos, token permissions, and endpoint status, and your direct API calls work—so this looks like a plugin-side bug or a mismatch in how Dify constructs or validates the Hugging Face request. The plugin expects the "User Name / Organization Name" field to match exactly what's shown in your Hugging Face account or org settings, but the actual credential validation logic in the plugin is either missing or handled elsewhere, which could mean it's enforcing stricter checks or misinterpreting the API response compared to your direct calls ([plugin code](https://github.com/langgenius/dify-official-plugins/blob/d08137b120bd63878bd05504fa6273acc21dd2b1/models/huggingface_hub/provider/huggingface_hub.py), [README](https://github.com/langgenius/dify-official-plugins/blob/d08137b120bd63878bd05504fa6273acc21dd2b1/models/huggingface_hub/README.md)). There are no recent fixes or open issues about this, so it's likely an edge case or a bug in the plugin's validation flow. If you want to dig deeper, you could compare the exact request/response between your working direct API call and what Dify sends (using a proxy or logging), to spot any subtle differences in headers, endpoint URL, or payload. If the plugin is expecting a specific response structure or status code, even a minor difference could trigger the "invalid" error. If you find a mismatch, sharing those details could help pinpoint the bug. <!-- 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/a7418d23-75e9-4af0-9b58-c97aaa817b76?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/a7418d23-75e9-4af0-9b58-c97aaa817b76?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/a7418d23-75e9-4af0-9b58-c97aaa817b76?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/a7418d23-75e9-4af0-9b58-c97aaa817b76?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/a7418d23-75e9-4af0-9b58-c97aaa817b76?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/a7418d23-75e9-4af0-9b58-c97aaa817b76?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/a7418d23-75e9-4af0-9b58-c97aaa817b76?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/1859)
Author
Owner

@hiiamboris commented on GitHub (Oct 15, 2025):

My call looks like this:

http-send/auth/data 'post endpoint/v1/embeddings
	'bearer "token" 
	#[
		model: "nomic-ai/nomic-embed-code-GGUF"
		input: "Today is a sunny day and I will get some ice cream."
	]

But I don't need the username to make it. Maybe plugin is doing something completely uncalled for.

@hiiamboris commented on GitHub (Oct 15, 2025): My call looks like this: ``` http-send/auth/data 'post endpoint/v1/embeddings 'bearer "token" #[ model: "nomic-ai/nomic-embed-code-GGUF" input: "Today is a sunny day and I will get some ice cream." ] ``` But I don't need the username to make it. Maybe plugin is doing something completely uncalled for.
Author
Owner

@dosubot[bot] commented on GitHub (Oct 15, 2025):

You're right—your direct API call to Hugging Face's Inference Endpoint doesn't require a username, just the token, model, and input. The Dify plugin, however, enforces a "User Name / Organization Name" field for credential validation, even though it's not needed for the actual API request. This requirement is set in the plugin's config and UI logic, but the credential validation method in the code is empty, so the error likely comes from backend integration or a preflight check that expects this field to match Hugging Face's namespace rules, regardless of whether the API uses it for embeddings requests (plugin code, YAML config, README).

This means the plugin is likely doing an unnecessary or overly strict check, causing the error even when your credentials and endpoint are valid. There isn't a documented workaround or config option to skip this check. If you want to patch it, you could try editing the plugin to relax or bypass the username/org validation for inference endpoints, since the API itself doesn't require it.

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 (Oct 15, 2025): <!-- Answer --> You're right—your direct API call to Hugging Face's Inference Endpoint doesn't require a username, just the token, model, and input. The Dify plugin, however, enforces a "User Name / Organization Name" field for credential validation, even though it's not needed for the actual API request. This requirement is set in the plugin's config and UI logic, but the credential validation method in the code is empty, so the error likely comes from backend integration or a preflight check that expects this field to match Hugging Face's namespace rules, regardless of whether the API uses it for embeddings requests ([plugin code](https://github.com/langgenius/dify-official-plugins/blob/d08137b120bd63878bd05504fa6273acc21dd2b1/models/huggingface_hub/provider/huggingface_hub.py), [YAML config](https://github.com/langgenius/dify-official-plugins/blob/d08137b120bd63878bd05504fa6273acc21dd2b1/models/huggingface_hub/provider/huggingface_hub.yaml), [README](https://github.com/langgenius/dify-official-plugins/blob/d08137b120bd63878bd05504fa6273acc21dd2b1/models/huggingface_hub/README.md)). This means the plugin is likely doing an unnecessary or overly strict check, causing the error even when your credentials and endpoint are valid. There isn't a documented workaround or config option to skip this check. If you want to patch it, you could try editing the plugin to relax or bypass the username/org validation for inference endpoints, since the API itself doesn't require it. <!-- 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/9d24c6d7-f058-4c78-a311-473b9644b642?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/9d24c6d7-f058-4c78-a311-473b9644b642?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/9d24c6d7-f058-4c78-a311-473b9644b642?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/9d24c6d7-f058-4c78-a311-473b9644b642?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/9d24c6d7-f058-4c78-a311-473b9644b642?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/9d24c6d7-f058-4c78-a311-473b9644b642?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/9d24c6d7-f058-4c78-a311-473b9644b642?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/1859)
Author
Owner

@hiiamboris commented on GitHub (Nov 8, 2025):

Learned my lesson. Will not report anything again.

@hiiamboris commented on GitHub (Nov 8, 2025): Learned my lesson. Will not report anything again.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#716