docker-compose launched project conversion embedding error #6478

Closed
opened 2026-02-21 18:15:56 -05:00 by yindo · 0 comments
Owner

Originally created by @leekoko on GitHub (Oct 31, 2024).

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 search for existing issues, 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

0.10.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I use a Mac computer, when I want to create a knowledge base, I click "Add File" and upload the file.

Then when processing it into an embedding, it reports a failure error, and the error log is as follows

I haven't made any changes to the project(In addition to changing the port), and the API uses a relay address, but this should not affect the function, right?

[2024-10-31 09:41:02,060: ERROR/MainProcess] consume document failed
Traceback (most recent call last):
  File "/app/api/core/model_runtime/model_providers/__base/text_embedding_model.py", line 44, in invoke
    return self._invoke(model, credentials, texts, user, input_type)
  File "/app/api/core/model_runtime/model_providers/openai/text_embedding/text_embedding.py", line 76, in _invoke
    embeddings_batch, embedding_used_tokens = self._embedding_invoke(
  File "/app/api/core/model_runtime/model_providers/openai/text_embedding/text_embedding.py", line 172, in _embedding_invoke
    [list(np.frombuffer(base64.b64decode(data.embedding), dtype="float32")) for data in response.data],
  File "/app/api/core/model_runtime/model_providers/openai/text_embedding/text_embedding.py", line 172, in <listcomp>
    [list(np.frombuffer(base64.b64decode(data.embedding), dtype="float32")) for data in response.data],
  File "/usr/local/lib/python3.10/base64.py", line 80, in b64decode
    s = _bytes_from_decode_data(s)
  File "/usr/local/lib/python3.10/base64.py", line 45, in _bytes_from_decode_data
    raise TypeError("argument should be a bytes-like object or ASCII "
TypeError: argument should be a bytes-like object or ASCII string, not 'list'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/api/core/indexing_runner.py", line 75, in run
    self._load(
  File "/app/api/core/indexing_runner.py", line 677, in _load
    tokens += future.result()
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 458, in result
    return self.__get_result()
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/app/api/core/indexing_runner.py", line 734, in _process_chunk
    index_processor.load(dataset, chunk_documents, with_keywords=False)
  File "/app/api/core/rag/index_processor/processor/paragraph_index_processor.py", line 60, in load
    vector.create(documents)
  File "/app/api/core/rag/datasource/vdb/vector_factory.py", line 138, in create
    embeddings = self._embeddings.embed_documents([document.page_content for document in texts])
  File "/app/api/core/rag/embedding/cached_embedding.py", line 93, in embed_documents
    raise ex
  File "/app/api/core/rag/embedding/cached_embedding.py", line 61, in embed_documents
    embedding_result = self._model_instance.invoke_text_embedding(
  File "/app/api/core/model_manager.py", line 177, in invoke_text_embedding
    return self._round_robin_invoke(
  File "/app/api/core/model_manager.py", line 310, in _round_robin_invoke
    return function(*args, **kwargs)
  File "/app/api/core/model_runtime/model_providers/__base/text_embedding_model.py", line 46, in invoke
    raise self._transform_invoke_error(e)
core.model_runtime.errors.invoke.InvokeError: [openai] Error: argument should be a bytes-like object or ASCII string, not 'list'
[2024-10-31 09:41:02,062: INFO/MainProcess] Processed dataset: 4a5ed17d-efb3-4bb8-88bf-311cac13f2eb latency: 4.266939846100286
[2024-10-31 09:41:02,087: INFO/MainProcess] Task tasks.document_indexing_task.document_indexing_task[431e9342-5689-4838-8851-078cbf487364] succeeded in 4.292012171819806s: None

✔️ Expected Behavior

The embedding transformation was successful.

Actual Behavior

[openail Error: argument should be a bytes-like object or ASClI string, not 'list'

Originally created by @leekoko on GitHub (Oct 31, 2024). ### 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 [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 (我已阅读并同意 [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 0.10.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I use a Mac computer, when I want to create a knowledge base, I click "Add File" and upload the file. Then when processing it into an embedding, it reports a failure error, and the error log is as follows I haven't made any changes to the project(In addition to changing the port), and the API uses a relay address, but this should not affect the function, right? ``` [2024-10-31 09:41:02,060: ERROR/MainProcess] consume document failed Traceback (most recent call last): File "/app/api/core/model_runtime/model_providers/__base/text_embedding_model.py", line 44, in invoke return self._invoke(model, credentials, texts, user, input_type) File "/app/api/core/model_runtime/model_providers/openai/text_embedding/text_embedding.py", line 76, in _invoke embeddings_batch, embedding_used_tokens = self._embedding_invoke( File "/app/api/core/model_runtime/model_providers/openai/text_embedding/text_embedding.py", line 172, in _embedding_invoke [list(np.frombuffer(base64.b64decode(data.embedding), dtype="float32")) for data in response.data], File "/app/api/core/model_runtime/model_providers/openai/text_embedding/text_embedding.py", line 172, in <listcomp> [list(np.frombuffer(base64.b64decode(data.embedding), dtype="float32")) for data in response.data], File "/usr/local/lib/python3.10/base64.py", line 80, in b64decode s = _bytes_from_decode_data(s) File "/usr/local/lib/python3.10/base64.py", line 45, in _bytes_from_decode_data raise TypeError("argument should be a bytes-like object or ASCII " TypeError: argument should be a bytes-like object or ASCII string, not 'list' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/app/api/core/indexing_runner.py", line 75, in run self._load( File "/app/api/core/indexing_runner.py", line 677, in _load tokens += future.result() File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 458, in result return self.__get_result() File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result raise self._exception File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/app/api/core/indexing_runner.py", line 734, in _process_chunk index_processor.load(dataset, chunk_documents, with_keywords=False) File "/app/api/core/rag/index_processor/processor/paragraph_index_processor.py", line 60, in load vector.create(documents) File "/app/api/core/rag/datasource/vdb/vector_factory.py", line 138, in create embeddings = self._embeddings.embed_documents([document.page_content for document in texts]) File "/app/api/core/rag/embedding/cached_embedding.py", line 93, in embed_documents raise ex File "/app/api/core/rag/embedding/cached_embedding.py", line 61, in embed_documents embedding_result = self._model_instance.invoke_text_embedding( File "/app/api/core/model_manager.py", line 177, in invoke_text_embedding return self._round_robin_invoke( File "/app/api/core/model_manager.py", line 310, in _round_robin_invoke return function(*args, **kwargs) File "/app/api/core/model_runtime/model_providers/__base/text_embedding_model.py", line 46, in invoke raise self._transform_invoke_error(e) core.model_runtime.errors.invoke.InvokeError: [openai] Error: argument should be a bytes-like object or ASCII string, not 'list' [2024-10-31 09:41:02,062: INFO/MainProcess] Processed dataset: 4a5ed17d-efb3-4bb8-88bf-311cac13f2eb latency: 4.266939846100286 [2024-10-31 09:41:02,087: INFO/MainProcess] Task tasks.document_indexing_task.document_indexing_task[431e9342-5689-4838-8851-078cbf487364] succeeded in 4.292012171819806s: None ``` ### ✔️ Expected Behavior The embedding transformation was successful. ### ❌ Actual Behavior [openail Error: argument should be a bytes-like object or ASClI string, not 'list'
yindo added the 🐞 bug👻 feat:rag labels 2026-02-21 18:15:56 -05:00
yindo closed this issue 2026-02-21 18:15:56 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6478