Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue importing a CSV #4472

Open
Kerollmops opened this issue Mar 11, 2024 · 1 comment
Open

Issue importing a CSV #4472

Kerollmops opened this issue Mar 11, 2024 · 1 comment
Labels
bug Something isn't working as expected

Comments

@Kerollmops
Copy link
Member

When importing a certain CSV, Meilisearch throws an internal error. This must not happen.

To Reproduce
Send the following CSV into Meilisearch. Sending the content will create the index at the same time. Once the task has been accepted you can find in the tasks the internal error: keys must be inserted in order and only one time.

curl -X POST 'http://localhost:7700/indexes/stuff/documents' -H 'Content-Type: text/csv' -H 'Authorization: Bearer aSampleMasterKey' --data-binary @./myfile.csv
".100000","NEW","REF/RAW MATERIAL STEELS&METALS","","","",1/1/1901,,0,"EA","EA",1,0,0,0,0,0,1,0,0,0,0,0,0,76.89,0,0,0,76.89,0,0,1,0,0,"","",0,"","","","",0,"",2/28/2018 2:49:29 PM,0,"","",0,0,0,0,0,0,"",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"",0,0,"",,0,0,0
".101035","NEW","BAR, STL, HF, 1/8X1/2","","","",1/1/1901,,0,"IN","IN",40,0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,0,.0104,0,21,1,0,0,"9042","",0,"","","","",0,"",6/20/2023 7:47:45 AM,0,"","",0,0,0,0,0,0,"",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"",0,0,"",,0,0,0

Expected behavior
In any case, the engine should not return an internal error. It can accept or refuse the content, but with a comprehensive error message.

Meilisearch version:
At least in v1.6.2 and until v1.7.0.

Additional content
The issue has originally been reported on Discord, and the user found a work around by fixing the primary key.

@Kerollmops Kerollmops added the bug Something isn't working as expected label Mar 11, 2024
@dureuill
Copy link
Contributor

Initial investigation located that the culprit for the internal error is probably:

writer.insert(*field_id, &self.value_buffer)?;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

2 participants