Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

[Bug]: create knowledgebase using ollama embedding model failed; #11910

@ext2xhb

Description

@ext2xhb

Short description of current behavior

description:
I'm trying to create a knowledgebase using embedding model with ollama nomic-embed-text, it failed , as : "Problem with embedding model config: 'str' object has no attribute 'get'.
conditions:
1)knowledge base create sql: CREATE KNOWLEDGE_BASE my_file_kb
USING
-- 使用 Ollama 作为 embedding 模型
embedding_model = {
"provider": "ollama",
"model_name": "nomic-embed-text",
"base_url": "http://localhost:11434" //first try: error occurs "Problem with embedding model config: 'str' object has no attribute 'get'."
"base_url": "http://localhost:11434/v1" //second try: error occurs "'FileHandler' object has no attribute 'create_table'"

},
storage = files.test_knowledge1,
metadata_columns = ['category'],
content_columns = ['content'],
id_column = 'id';
  1. ollama and nomic-embed-text already installed in my host and checked;

  2. first try: mindsdb-exception: mindsdb server, raise a exception as following; it seems the url of ollama isnot correct,
    2025-11-19 15:06:48,791 http INFO httpx: HTTP Request: POST http://localhost:11434/embeddings "HTTP/1.1 404 Not Found"
    2025-11-19 15:06:48,792 http ERROR mindsdb.api.http.namespaces.sql: Error query processing:
    Traceback (most recent call last):
    File "D:\workspace\mindsdb\mindsdb\integrations\handlers\openai_handler\helpers.py", line 78, in wrapper
    return func(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^
    File "D:\workspace\mindsdb\mindsdb\interfaces\knowledge_base\llm_client.py", line 79, in embeddings
    response = self.client.embeddings.create(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "d:\workspace\mindsdb.venv\Lib\site-packages\openai\resources\embeddings.py", line 132, in create
    return self._post(
    ^^^^^^^^^^^
    File "d:\workspace\mindsdb.venv\Lib\site-packages\openai_base_client.py", line 1259, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "d:\workspace\mindsdb.venv\Lib\site-packages\openai_base_client.py", line 1047, in request
    raise self._make_status_error_from_response(err.response) from None
    openai.NotFoundError: 404 page not found

4) second try: base_url": "http://localhost:11434/v1" (this is the ollama's base url) but another error occurs:
2025-11-19 15:26:35,461 http ERROR mindsdb.api.http.namespaces.sql: Error query processing:
Traceback (most recent call last):
File "D:\workspace\mindsdb\mindsdb\api\http\namespaces\sql.py", line 54, in post
result: SQLAnswer = mysql_proxy.process_query(query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\workspace\mindsdb\mindsdb\utilities\profiler\profiler.py", line 141, in wrapper
result = function(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\workspace\mindsdb\mindsdb\api\mysql\mysql_proxy\mysql_proxy.py", line 501, in process_query
executor.query_execute(sql)
File "D:\workspace\mindsdb\mindsdb\utilities\profiler\profiler.py", line 141, in wrapper
result = function(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\workspace\mindsdb\mindsdb\api\mysql\mysql_proxy\executor\mysql_executor.py", line 80, in query_execute
self.do_execute()
File "D:\workspace\mindsdb\mindsdb\utilities\profiler\profiler.py", line 141, in wrapper
result = function(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\workspace\mindsdb\mindsdb\api\mysql\mysql_proxy\executor\mysql_executor.py", line 106, in do_execute
executor_answer: ExecuteAnswer = self.command_executor.execute_command(self.query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\workspace\mindsdb\mindsdb\utilities\profiler\profiler.py", line 141, in wrapper
result = function(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\workspace\mindsdb\mindsdb\api\executor\command_executor.py", line 660, in execute_command
return self.answer_create_kb(statement, database_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\workspace\mindsdb\mindsdb\api\executor\command_executor.py", line 1424, in answer_create_kb
_ = self.session.kb_controller.add(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\workspace\mindsdb\mindsdb\interfaces\knowledge_base\controller.py", line 1234, in add
vector_store_handler.create_table(vector_table_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'FileHandler' object has no attribute 'create_table'

Video or screenshots

No response

Expected behavior

No response

How to reproduce the error

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions