tongyi embedding duplicate import bug #516

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

Originally created by @huangzhuo1949 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.4.1

Plugin version

0.0.35

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

only when large-scale calls generate retry behavior

✔️ Error log

2025-08-04 15:10:33,637|ERROR|io_server.py:117|93b9a1bc-8650-4b41-b37c-67b1684bfa85|Unexpected error occurred when executing request
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/dify_plugin/interfaces/model/text_embedding_model.py", line 117, in invoke
return self._invoke(model, credentials, texts, user, input_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/work/models/tongyi/models/text_embedding/text_embedding.py", line 56, in _invoke
(embeddings_batch, embedding_used_tokens) = self.embed_documents(
^^^^^^^^^^^^^^^^^^^^^
File "/home/work/models/tongyi/models/text_embedding/text_embedding.py", line 148, in embed_documents
raise ValueError(f"Response output is missing or does not contain embeddings: {response}")
ValueError: Response output is missing or does not contain embeddings: cannot access free variable 'time' where it is not associated with a value in enclosing scope

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/dify_plugin/core/server/io_server.py", line 101, in _execute_request_in_thread
self._execute_request(
File "/usr/local/lib/python3.11/site-packages/dify_plugin/plugin.py", line 333, in _execute_request
response = self.dispatch(session, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dify_plugin/core/server/router.py", line 79, in dispatch
return route.func(session, data)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dify_plugin/core/server/router.py", line 72, in wrapper
return f(session, data)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dify_plugin/core/plugin_executor.py", line 180, in invoke_text_embedding
return model_instance.invoke(
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dify_plugin/interfaces/model/text_embedding_model.py", line 119, in invoke
raise self._transform_invoke_error(e) from e
dify_plugin.errors.model.InvokeError: [models] Error: Response output is missing or does not contain embeddings: cannot access free variable 'time' where it is not associated with a value in enclosing scope

Originally created by @huangzhuo1949 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.4.1 ### Plugin version 0.0.35 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce only when large-scale calls generate retry behavior ### ✔️ Error log 2025-08-04 15:10:33,637|ERROR|io_server.py:117|93b9a1bc-8650-4b41-b37c-67b1684bfa85|Unexpected error occurred when executing request Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/dify_plugin/interfaces/model/text_embedding_model.py", line 117, in invoke return self._invoke(model, credentials, texts, user, input_type) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/work/models/tongyi/models/text_embedding/text_embedding.py", line 56, in _invoke (embeddings_batch, embedding_used_tokens) = self.embed_documents( ^^^^^^^^^^^^^^^^^^^^^ File "/home/work/models/tongyi/models/text_embedding/text_embedding.py", line 148, in embed_documents raise ValueError(f"Response output is missing or does not contain embeddings: {response}") ValueError: Response output is missing or does not contain embeddings: cannot access free variable 'time' where it is not associated with a value in enclosing scope The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/dify_plugin/core/server/io_server.py", line 101, in _execute_request_in_thread self._execute_request( File "/usr/local/lib/python3.11/site-packages/dify_plugin/plugin.py", line 333, in _execute_request response = self.dispatch(session, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/dify_plugin/core/server/router.py", line 79, in dispatch return route.func(session, data) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/dify_plugin/core/server/router.py", line 72, in wrapper return f(session, data) ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/dify_plugin/core/plugin_executor.py", line 180, in invoke_text_embedding return model_instance.invoke( ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/dify_plugin/interfaces/model/text_embedding_model.py", line 119, in invoke raise self._transform_invoke_error(e) from e dify_plugin.errors.model.InvokeError: [models] Error: Response output is missing or does not contain embeddings: cannot access free variable 'time' where it is not associated with a value in enclosing scope
yindo added the bug label 2026-02-16 10:19:37 -05:00
yindo closed this issue 2026-02-16 10:19:37 -05:00
Author
Owner

@huangzhuo1949 commented on GitHub (Aug 4, 2025):

fixed in pr #1406

@huangzhuo1949 commented on GitHub (Aug 4, 2025): fixed in pr #1406
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#516