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

Haystack REST API not starting #1443

Closed
ajainvivek opened this issue Sep 13, 2021 · 13 comments
Closed

Haystack REST API not starting #1443

ajainvivek opened this issue Sep 13, 2021 · 13 comments

Comments

@ajainvivek
Copy link

ajainvivek commented Sep 13, 2021

Describe the bug
I am unable to start the haystack API using docker. I am getting infinite error loop

Error message

Screen Shot 2021-09-13 at 10 57 16 pm

Expected behavior

I have tried multiple versions of python image.

Increased the docker memory to 6 GB and swap to 4 GB

System:

  • OS: Mac M1
  • GPU/CPU: CPU
  • Haystack version (commit or version number): 0.9.0
@oryx1729
Copy link
Contributor

Hi @ajainvivek,

Are you using your own Dockerfile or the one provided in the repo? If you're using a custom Dockerfile, can you share the code?

Did you test if the API works without Docker?

@ajainvivek
Copy link
Author

I haven't changed anything in the docker file.

I have commented out ray and Gaiss-cpu in the requirements file.

@oryx1729
Copy link
Contributor

Hi @ajainvivek, can you try if you get the same issue with docker-compose: docker-compose pull && docker-compose up?

@ajainvivek
Copy link
Author

I have tried both, the issue still persists. I can pair with someone in the team because the issue occurs only in Mac M1 machine.

@julian-risch
Copy link
Member

julian-risch commented Sep 20, 2021

I think you would at least need to make some small changes in docker-compose.yml. For example, the elasticsearch image needs to be changed to image: "elasticsearch:7.9.2" (default is image: "deepset/elasticsearch-game-of-thrones"). The default image uses an old elasticsearch image that is not available on ARM architecture (link, link). Did you make that change and did you make any other changes to the docker-compose.yml file @ajainvivek ?

@julian-risch
Copy link
Member

@ajainvivek Does docker-compose up --build work on your machine or do you already see errors there during the installation of dependencies?

@julian-risch
Copy link
Member

I can reproduce this issue on my Apple M1 machine. However, to get to the point where i see the reported error messages I first had to make changes to the dockerfile so that the tokenizers dependency is correctly installed with a rust compiler:

# install as a package
COPY setup.py requirements.txt README.md /home/user/
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
RUN pip install --upgrade pip setuptools wheel
RUN ["sh", "-c", "export PATH=$HOME/.cargo/bin:$PATH && pip install -r requirements.txt"]
RUN pip install -e .

In addition, I changed the python image to python:3.9.7-buster

@julian-risch
Copy link
Member

julian-risch commented Sep 20, 2021

I found this issue that reports the same error: googleapis/python-pubsub#414
It suggest that the problem is caused by a bug in an older versions of grpcio (older than 1.38.1). Here is the issue in the grpc repo: grpc/grpc#26279
grpcio==1.37.1 is a dependency of pymilvus: https://github.com/milvus-io/pymilvus/blob/f27df7c00a393a537f72836b1a70c8c0c3c81346/requirements.txt#L4
Unfortunately, removing milvus from haystack's requirements.txt is no workaround at the moment because it's required by an import statement in haystack's code:

from haystack.document_store.milvus import MilvusDocumentStore

@julian-risch
Copy link
Member

I got it working on Apple M1 by removing pymilvus from the requirements.txt and removing the line from haystack.document_store.milvus import MilvusDocumentStore from haystack/document_store/__init__.py.
@ajainvivek could you please check whether removing the two lines also works on your machine and report back here?
If the next release of pymilvus bumps the grpcio dependency to >=1.38.1 that step would become obsolete.

@ajainvivek
Copy link
Author

Sure, I will have a look today😁

@julian-risch
Copy link
Member

As an alternative, we have uploaded a haystack-m1 docker image: https://hub.docker.com/repository/docker/deepset/haystack-m1/

@julian-risch
Copy link
Member

Hi @ajainvivek could you please give an update whether one of the suggested solutions worked for you? Either the uploaded haystack-m1 docker image or making the suggested changes to the docker file and running the listed commands? 🙂

@ZanSara
Copy link
Contributor

ZanSara commented Oct 26, 2021

Closing as I'm assuming the suggested solution solved the problem. If it was not the case, please feel free to re-open or open a new issue.

@ZanSara ZanSara closed this as completed Oct 26, 2021
nniiggeell pushed a commit to nniiggeell/haystack that referenced this issue Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants