mindsdb / mindsdb

Platform for building AI that can learn and answer questions over federated data.
https://mindsdb.com
Other
26.84k stars 4.89k forks source link

[Bug]: [elasticsearch/elasticsearch_datasource]: 'dict' object has no attribute 'type' #10056

Closed maulanaakbardj closed 5 days ago

maulanaakbardj commented 3 weeks ago

Short description of current behavior

While running the job to sync data from the Elasticsearch data source to the Knowledge Base, I encountered the following error: ERROR mindsdb.interfaces.jobs.jobs_controller: [elasticsearch/elasticsearch_datasource]: 'dict' object has no attribute 'type'

Follow up: #10046

Video or screenshots

1 2 3 4 5 image

Expected behavior

No response

How to reproduce the error

No response

Anything else?

No response

HahaBill commented 2 weeks ago

@chandrevdw31 Hey Chandre! I can have a look at this one.

chandrevdw31 commented 2 weeks ago

@HahaBill can you check if this PR resolves this issue. Fyi @dusvyat maybe you can advise

HahaBill commented 2 weeks ago

@HahaBill can you check if this PR resolves this issue. Fyi @dusvyat maybe you can advise

I see, alright I will try to reproduce the steps and see whether the PR resolved the issue.

HahaBill commented 2 weeks ago

@chandrevdw31 Unfortunately, I get the same errors as in the issue description by Maulana:

2024-11-07 21:39:06,486            jobs INFO     mindsdb.interfaces.jobs.scheduler: Job execute: sync_data(14)
2024-11-07 21:39:06,519            jobs INFO     mindsdb.interfaces.database.integrations: IntegrationController.get_handler: create a client to db service of files type, args - {'name': 'files', 'integration_id': 3, 'connection_data': {}, 'file_storage': <mindsdb.interfaces.storage.fs.FileStorage object at 0x28ba648e0>, 'handler_storage': <mindsdb.interfaces.storage.model_fs.HandlerStorage object at 0x28ba64b20>, 'file_controller': <mindsdb.interfaces.file.file_controller.FileController object at 0x28ba55a50>}
2024-11-07 21:39:06,536            jobs INFO     mindsdb.interfaces.database.integrations: IntegrationController.get_handler: create a client to db service of elasticsearch type, args - {'name': 'elasticsearch_datasource', 'integration_id': 44, 'connection_data': {'cloud_id': '353fcd25c0b148eaaba3b9b9ea7663fb:dXMtY2VudHJhbDEuZ2NwLmNsb3VkLmVzLmlvJGMxOTllNGY0M2U2YTRiZTA5NzlmNTM4ZTI5MWUyZTVjJDE3OTU1NWZiNWI5YTQ1OTg4OThkNDZmNTQ4ZmM5Y2I1', 'api_key': 'dzhwa0NKTUJyN0h3TVlsZm5oTUE6YzZDWkluNERSVTJjTW9ib0ZZdWNjdw=='}, 'file_storage': <mindsdb.interfaces.storage.fs.FileStorage object at 0x28ba565c0>, 'handler_storage': <mindsdb.interfaces.storage.model_fs.HandlerStorage object at 0x28ba55e10>}
2024-11-07 21:39:07,018            jobs ERROR    mindsdb.interfaces.jobs.jobs_controller: [elasticsearch/elasticsearch_datasource]: 'dict' object has no attribute 'type'
HahaBill commented 2 weeks ago

I will investigate more and provide further updates.

HahaBill commented 2 weeks ago

I found the root cause and that is: WHERE id < LAST. There is some problem with using LAST keyword.

HahaBill commented 2 weeks ago

Ready for a review: https://github.com/mindsdb/mindsdb/pull/10144