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

When client is configured using url, port seems to be incorrectly set on some methods #59

Open
sinedied opened this issue Jan 26, 2024 · 2 comments

Comments

@sinedied
Copy link

sinedied commented Jan 26, 2024

I have a weird error: when Qdrant client is initialized with a full URL (ie https://hostname:port), client methods fails with a fetch failed / timeout errors but some don't.

The code:

const qdrantClient = new QdrantClient({ url: 'https://mydomain.com:443' });
try {
  await qdrantClient.getCollection('test');
}  catch (e) {
  console.log(e);
}

When used locally with a URL like http://localhost:6333 there's no issue, but when the URL is https://mydomain.com:443 I get a fetch failed error.

If I add the port manually in the client setup:

const qdrantClient = new QdrantClient({ url: 'https://mydomain.com:443', port: 443 });

It works normally.

EDIT: It also seems only some methods are affected by this, as I can make search queries just fine without having the port explicitly set?

@harshalmittal4
Copy link

Hello,
This issue arises because of the way URL package parses urls with default ports (443 for https and 80 for http) -

Note: If an input string passed to the URL() constructor doesn't contain an explicit port number (e.g., https://localhost) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., https://localhost:443), then in the URL object the constructor returns, the value of the port property will be the empty string: ''.

reference: port

harshalmittal4 added a commit to harshalmittal4/qdrant-js that referenced this issue Feb 3, 2024
This change correctly parses default http
ports in url for rest and grpc packages.
@bmkor
Copy link

bmkor commented Jul 1, 2024

Would like to chip in here. As we hosted qdrant in a self-host vanilla k8s and exposed the service via https instead of node port. We suspect this is the reason why we cannot integrate this qdrant service with others such as anything-llm in this way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants