The OpenAI-API-compatible plugin fails with: Credentials validation failed: invalid response #518

Closed
opened 2026-02-16 10:19:38 -05:00 by yindo · 1 comment
Owner

Originally created by @jiekechoo on GitHub (Aug 4, 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.7.1

Plugin version

0.0.19

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  • The embbeding model worked
curl -s -X POST \
  http://192.168.123.59:8002/v3/embeddings \
  -H "Content-Type: application/json" \
  -d '{
    "input": "测试OpenAI兼容API",
    "model": "bge-large-zh-v1.5"
  }' | jq
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "embedding": [
        -0.041102729737758636,
        0.054906170815229416,
        0.056597959250211716,
        .....
        0.02210857719182968,
        -0.019686246290802956,
        0.021820204332470894,
        0.01223661657422781,
        0.00675272848457098
      ],
      "index": 0
    }
  ],
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}
  • Dify UI got error: Credentials validation failed: invalid response
Image

Additionally, the embedding model backend logs show(no errors):

[2025-08-04 06:49:37.742][81][serving][debug][drogon_http_server.cpp:83] Request URI working in drogon thread pool
[2025-08-04 06:49:37.742][81][serving][debug][http_server.cpp:193] REST request /v3/embeddings
[2025-08-04 06:49:37.742][81][serving][debug][http_server.cpp:201] Processing HTTP request: POST /v3/embeddings body: 47 bytes
[2025-08-04 06:49:37.742][81][serving][debug][http_rest_api_handler.cpp:535] Model name from deduced from JSON: bge-large-zh-v1.5
[2025-08-04 06:49:37.742][81][serving][debug][mediapipegraphdefinition.cpp:367] Successfully waited for mediapipe definition: bge-large-zh-v1.5
[2025-08-04 06:49:37.742][81][serving][debug][mediapipegraphdefinition.cpp:261] Creating Mediapipe graph executor: bge-large-zh-v1.5
[2025-08-04 06:49:37.742][81][serving][debug][mediapipegraphexecutor.hpp:119] Start unary KServe request mediapipe graph: bge-large-zh-v1.5 execution
[2025-08-04 06:49:37.742][140][embeddings_calculator][debug][embeddings_calculator_ov.cc:86] EmbeddingsCalculatorOV  [Node: bge-large-zh-v1.5] Open start
[2025-08-04 06:49:37.742][140][embeddings_calculator][debug][embeddings_calculator_ov.cc:93] EmbeddingsCalculatorOV [Node: bge-large-zh-v1.5] Open end
[2025-08-04 06:49:37.743][140][embeddings_calculator][debug][embeddings_calculator_ov.cc:105] Request body: {"input": "ping", "model": "bge-large-zh-v1.5"}
[2025-08-04 06:49:37.743][140][embeddings_calculator][debug][embeddings_calculator_ov.cc:106] Request uri: /v3/embeddings
[2025-08-04 06:49:37.743][140][embeddings_calculator][debug][embeddings_calculator_ov.cc:114] Embeddings request deserialization time: 0.00300000 ms
[2025-08-04 06:49:37.748][140][embeddings_calculator][debug][embeddings_calculator_ov.cc:226] Single embedding model output found with name last_hidden_state
[2025-08-04 06:49:37.748][140][embeddings_calculator][debug][embeddings_calculator_ov.cc:249] Embeddings response deserialization time: 0.049 ms
[2025-08-04 06:49:37.748][81][serving][debug][mediapipegraphexecutor.hpp:201] Will wait for output stream: output packet
[2025-08-04 06:49:37.748][140][embeddings_calculator][debug][embeddings_calculator_ov.cc:80] EmbeddingsCalculatorOV [Node: bge-large-zh-v1.5 ] Close
[2025-08-04 06:49:37.748][81][serving][debug][mediapipegraphexecutor.hpp:203] Received packet from output stream: output
[2025-08-04 06:49:37.748][81][serving][debug][mediapipegraphexecutor.hpp:235] Received all output stream packets for graph: bge-large-zh-v1.5

Could anyone explain how to fix? I’m not sure how to proceed.

✔️ Error log

Dify docker compose backend logs show:

plugin_daemon-1  | [GIN] 2025/08/04 - 06:59:47 | 200 |     585.238µs |      172.19.0.4 | GET      "/plugin/8e84d385-3e2c-4537-8e71-df7754b3a815/management/models?page=1&page_size=256"
plugin_daemon-1  | [GIN] 2025/08/04 - 06:59:47 | 200 |   11.706697ms |      172.19.0.4 | POST     "/plugin/8e84d385-3e2c-4537-8e71-df7754b3a815/dispatch/model/validate_model_credentials"
api-1            | 2025-08-04 06:59:47.864 ERROR [Dummy-595] [models.py:162] - Failed to save model credentials, tenant_id: 8e84d385-3e2c-4537-8e71-df7754b3a815, model: bge-large-zh-v1.5, model_type: text-embedding
api-1            | Traceback (most recent call last):
api-1            |   File "/app/api/controllers/console/workspace/models.py", line 154, in post
api-1            |     model_provider_service.save_model_credentials(
api-1            |   File "/app/api/services/model_provider_service.py", line 237, in save_model_credentials
api-1            |     provider_configuration.add_or_update_custom_model_credentials(
api-1            |   File "/app/api/core/entities/provider_configuration.py", line 422, in add_or_update_custom_model_credentials
api-1            |     provider_model_record, credentials = self.custom_model_credentials_validate(model_type, model, credentials)
api-1            |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-1            |   File "/app/api/core/entities/provider_configuration.py", line 402, in custom_model_credentials_validate
api-1            |     credentials = model_provider_factory.model_credentials_validate(
api-1            |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-1            |   File "/app/api/core/model_runtime/model_providers/model_provider_factory.py", line 191, in model_credentials_validate
api-1            |     self.plugin_model_manager.validate_model_credentials(
api-1            |   File "/app/api/core/plugin/impl/model.py", line 137, in validate_model_credentials
api-1            |     for resp in response:
api-1            |                 ^^^^^^^^
api-1            |   File "/app/api/core/plugin/impl/base.py", line 211, in _request_with_plugin_daemon_response_stream
api-1            |     self._handle_plugin_daemon_error(error.error_type, error.message)
api-1            |   File "/app/api/core/plugin/impl/base.py", line 241, in _handle_plugin_daemon_error
api-1            |     raise CredentialsValidateFailedError(error_object.get("message"))
api-1            | core.model_runtime.errors.validate.CredentialsValidateFailedError: Credentials validation failed: invalid response
nginx-1          | 192.168.123.5 - - [04/Aug/2025:06:59:47 +0000] "POST /console/api/workspaces/current/model-providers/langgenius/openai_api_compatible/openai_api_compatible/models HTTP/1.1" 400 103 "http://192.168.123.59:8088/plugins" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36" "-"
Originally created by @jiekechoo on GitHub (Aug 4, 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.7.1 ### Plugin version 0.0.19 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce - The embbeding model worked ```shell curl -s -X POST \ http://192.168.123.59:8002/v3/embeddings \ -H "Content-Type: application/json" \ -d '{ "input": "测试OpenAI兼容API", "model": "bge-large-zh-v1.5" }' | jq ``` ```json { "object": "list", "data": [ { "object": "embedding", "embedding": [ -0.041102729737758636, 0.054906170815229416, 0.056597959250211716, ..... 0.02210857719182968, -0.019686246290802956, 0.021820204332470894, 0.01223661657422781, 0.00675272848457098 ], "index": 0 } ], "usage": { "prompt_tokens": 8, "total_tokens": 8 } } ``` - Dify UI got error: `Credentials validation failed: invalid response` <img width="1602" height="1266" alt="Image" src="https://github.com/user-attachments/assets/7514c117-bf46-45cc-8027-c06be21036b4" /> Additionally, the embedding model backend logs show(no errors): ``` [2025-08-04 06:49:37.742][81][serving][debug][drogon_http_server.cpp:83] Request URI working in drogon thread pool [2025-08-04 06:49:37.742][81][serving][debug][http_server.cpp:193] REST request /v3/embeddings [2025-08-04 06:49:37.742][81][serving][debug][http_server.cpp:201] Processing HTTP request: POST /v3/embeddings body: 47 bytes [2025-08-04 06:49:37.742][81][serving][debug][http_rest_api_handler.cpp:535] Model name from deduced from JSON: bge-large-zh-v1.5 [2025-08-04 06:49:37.742][81][serving][debug][mediapipegraphdefinition.cpp:367] Successfully waited for mediapipe definition: bge-large-zh-v1.5 [2025-08-04 06:49:37.742][81][serving][debug][mediapipegraphdefinition.cpp:261] Creating Mediapipe graph executor: bge-large-zh-v1.5 [2025-08-04 06:49:37.742][81][serving][debug][mediapipegraphexecutor.hpp:119] Start unary KServe request mediapipe graph: bge-large-zh-v1.5 execution [2025-08-04 06:49:37.742][140][embeddings_calculator][debug][embeddings_calculator_ov.cc:86] EmbeddingsCalculatorOV [Node: bge-large-zh-v1.5] Open start [2025-08-04 06:49:37.742][140][embeddings_calculator][debug][embeddings_calculator_ov.cc:93] EmbeddingsCalculatorOV [Node: bge-large-zh-v1.5] Open end [2025-08-04 06:49:37.743][140][embeddings_calculator][debug][embeddings_calculator_ov.cc:105] Request body: {"input": "ping", "model": "bge-large-zh-v1.5"} [2025-08-04 06:49:37.743][140][embeddings_calculator][debug][embeddings_calculator_ov.cc:106] Request uri: /v3/embeddings [2025-08-04 06:49:37.743][140][embeddings_calculator][debug][embeddings_calculator_ov.cc:114] Embeddings request deserialization time: 0.00300000 ms [2025-08-04 06:49:37.748][140][embeddings_calculator][debug][embeddings_calculator_ov.cc:226] Single embedding model output found with name last_hidden_state [2025-08-04 06:49:37.748][140][embeddings_calculator][debug][embeddings_calculator_ov.cc:249] Embeddings response deserialization time: 0.049 ms [2025-08-04 06:49:37.748][81][serving][debug][mediapipegraphexecutor.hpp:201] Will wait for output stream: output packet [2025-08-04 06:49:37.748][140][embeddings_calculator][debug][embeddings_calculator_ov.cc:80] EmbeddingsCalculatorOV [Node: bge-large-zh-v1.5 ] Close [2025-08-04 06:49:37.748][81][serving][debug][mediapipegraphexecutor.hpp:203] Received packet from output stream: output [2025-08-04 06:49:37.748][81][serving][debug][mediapipegraphexecutor.hpp:235] Received all output stream packets for graph: bge-large-zh-v1.5 ``` Could anyone explain how to fix? I’m not sure how to proceed. ### ✔️ Error log Dify docker compose backend logs show: ``` plugin_daemon-1 | [GIN] 2025/08/04 - 06:59:47 | 200 | 585.238µs | 172.19.0.4 | GET "/plugin/8e84d385-3e2c-4537-8e71-df7754b3a815/management/models?page=1&page_size=256" plugin_daemon-1 | [GIN] 2025/08/04 - 06:59:47 | 200 | 11.706697ms | 172.19.0.4 | POST "/plugin/8e84d385-3e2c-4537-8e71-df7754b3a815/dispatch/model/validate_model_credentials" api-1 | 2025-08-04 06:59:47.864 ERROR [Dummy-595] [models.py:162] - Failed to save model credentials, tenant_id: 8e84d385-3e2c-4537-8e71-df7754b3a815, model: bge-large-zh-v1.5, model_type: text-embedding api-1 | Traceback (most recent call last): api-1 | File "/app/api/controllers/console/workspace/models.py", line 154, in post api-1 | model_provider_service.save_model_credentials( api-1 | File "/app/api/services/model_provider_service.py", line 237, in save_model_credentials api-1 | provider_configuration.add_or_update_custom_model_credentials( api-1 | File "/app/api/core/entities/provider_configuration.py", line 422, in add_or_update_custom_model_credentials api-1 | provider_model_record, credentials = self.custom_model_credentials_validate(model_type, model, credentials) api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/core/entities/provider_configuration.py", line 402, in custom_model_credentials_validate api-1 | credentials = model_provider_factory.model_credentials_validate( api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/core/model_runtime/model_providers/model_provider_factory.py", line 191, in model_credentials_validate api-1 | self.plugin_model_manager.validate_model_credentials( api-1 | File "/app/api/core/plugin/impl/model.py", line 137, in validate_model_credentials api-1 | for resp in response: api-1 | ^^^^^^^^ api-1 | File "/app/api/core/plugin/impl/base.py", line 211, in _request_with_plugin_daemon_response_stream api-1 | self._handle_plugin_daemon_error(error.error_type, error.message) api-1 | File "/app/api/core/plugin/impl/base.py", line 241, in _handle_plugin_daemon_error api-1 | raise CredentialsValidateFailedError(error_object.get("message")) api-1 | core.model_runtime.errors.validate.CredentialsValidateFailedError: Credentials validation failed: invalid response nginx-1 | 192.168.123.5 - - [04/Aug/2025:06:59:47 +0000] "POST /console/api/workspaces/current/model-providers/langgenius/openai_api_compatible/openai_api_compatible/models HTTP/1.1" 400 103 "http://192.168.123.59:8088/plugins" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36" "-" ```
yindo added the bug label 2026-02-16 10:19:38 -05:00
yindo closed this issue 2026-02-16 10:19:38 -05:00
Author
Owner

@LucianAozaki commented on GitHub (Jan 5, 2026):

Is this problem solved now?

@LucianAozaki commented on GitHub (Jan 5, 2026): Is this problem solved now?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#518