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

Failed to connect to Meilisearch: No connection adapters were found for 'localhost:7700/version' #4697

Closed
Zhimin-arya opened this issue Jun 13, 2024 · 3 comments
Labels
needs more info This issue needs a minimal complete and verifiable example support Issues related to support questions

Comments

@Zhimin-arya
Copy link

Bug description:

When I apply the semantic search following steps at https://www.meilisearch.com/docs/guides/ai/langchain#requirements, and failed at below codes:

vector_store = Meilisearch.from_documents(documents=documents, embedding=embeddings, embedders=embedders, embedder_name=embedder_name)

Failed with error: "Failed to connect to Meilisearch: No connection adapters were found for 'localhost:7700/version'"

The problem was caused by requests.get(url) function if url doesn't start with 'http://'
My current workaround is to add one line to meilisearch.py within function "_create_client()":

if not client:
    url = url or get_from_env("url", "MEILI_HTTP_ADDR")
    if url.startswith('localhost'): url = 'http://' + url # Insert here

I also tried to change MEILI_HTTP_ADDR="localhost:7700" to MEILI_HTTP_ADDR="http://localhost:7700", however, the meilisearch will fail to launch.

Meilisearch version:
1.8.1

Additional context
macOS: sonoma 14.1
chip: M3

@curquiza
Copy link
Member

Hello @Zhimin-arya
Sorry for the delay

Connection error means you did not reach Meilisearch, it's not an issue on Meilisearch itself since you don't even reach it.
Can you check you can reach it with curl command?
Did you manage to start Meilisearch without any issue?

@curquiza curquiza added support Issues related to support questions needs more info This issue needs a minimal complete and verifiable example labels Jun 24, 2024
@Zhimin-arya
Copy link
Author

Hello @Zhimin-arya Sorry for the delay

Connection error means you did not reach Meilisearch, it's not an issue on Meilisearch itself since you don't even reach it. Can you check you can reach it with curl command? Did you manage to start Meilisearch without any issue?

I have added the solution for the problem at the end of 1st comment. I think it is something related to meilisearch code, cause the url without 'http://' prefix will fail to connect the adaptor.

@curquiza
Copy link
Member

Hello @Zhimin-arya
I'm really sorry for the late answer

I talked with the team and we don't plan to assume an protocol when it's missing

Should we assume a http or a https prefix when missing?
We need to think about the future as well: what if we someday add unix sockets or another RPC transport, why should we default to the http scheme?

However, we can improve the error message to better guide our users and avoid the frustration you had! I close this issue in favor of #4811

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info This issue needs a minimal complete and verifiable example support Issues related to support questions
Projects
None yet
Development

No branches or pull requests

2 participants