Problem adding documents when using Meilisearch in a Python Docker Container
See original GitHub issueDescription I have built a python application that I need to run in a Docker Container. It gathers data, adds it to a CSV, then adds it to Meilisearch using the Meilisearch module.
Expected behavior Add CSV to database/Meilisearch and finish the code.
Current behavior
Program ran like normal until it was time to delete the index like I would want. It runs perfect just running with python main.py
but for some reason, in packaged in a Docker Container it fails.
Environment (please complete the following information):
- OS: Debian Linux
- Meilisearch version: Latest
- meilisearch-python version: Latest
Really simple docker file:
FROM python:3.9-slim
COPY . .
RUN pip install -r requirements.txt
ENV CRONMONITORING=healthchecksurl
ENV SEARCHCLIENT=meiliclient
ENV SEARCHCLIENTKEY=meiliclientapikey
CMD ["python", "main.py"]
Really simple usage of Meilisearch:
client = meilisearch.Client(SEARCHCLIENT, SEARCHCLIENTKEY)
index = client.index('index')
csvfile = open('index.csv', 'r')
data = csvfile.read()
index.delete_all_documents()
index.add_documents_csv(data.encode('utf-8'))
Issue Analytics
- State:
- Created a year ago
- Comments:9
Top Results From Across the Web
Changes regarding Meilisearch v0.27.0 · Issue #190 - GitHub
This issue gathers the changes related to the v0.27.0 of Meilisearch that will impact the integrations. Release date: 09/05/2022.
Read more >Quick start | Meilisearch Documentation v0.30
This quick start will walk you through setting up Meilisearch, adding documents, performing your first search, using the search preview, adding a search...
Read more >Using Meilisearch with Docker
In this guide you will learn how to use Docker to download and run Meilisearch, configure its behavior, and manage your Meilisearch data....
Read more >Run Meilisearch in production: taking it to the next level
Running a Meilisearch instance for testing purposes is incredibly easy and can be done in many ways: using Docker, Homebrew, Aptitude, binaries, a...
Read more >Documents | Meilisearch Documentation v0.30
Documents function as containers for organizing data, and are the basic building blocks of a Meilisearch database. To search for a document, you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ah, instead of doing that, I ran the container privileged using the
--privileged
tag, when running the container, and it seemed to have worked. I’m going to change the title as it will be more relevant for newcomers. Thank you for your help. Seems like memory was really the problem.The Meilisearch client in and out of Docker should act the same. I wonder if it is a memory issue since the Docker container will have less available to it than outside Docker. If you try the encoding without sending to Meilisearch does it error?