Upsert with Cloud Inference vectors hangs indefinitely (HTTP/2 issue with undici)
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- node.js, typescript
- Domain
- api, networking
Research direction
Start in packages/js-client-rest/src/dispatcher.ts and inspect the undici Agent options used by the REST client. Reproduce the upsert against the Qdrant Cloud inference endpoint in the Docker environment, then verify that the request completes over HTTP/1.1 without hanging and that the existing client behavior remains intact.
Written by the indexing model from the issue text.
Description
Problem
Using `@qdrant/js-client-rest` to upsert points with Cloud Inference vectors (using `vector: { text, model }` syntax) causes the request to hang indefinitely — never resolving or rejecting — when running inside a Docker container.
Reproduction
```js
const { QdrantClient } = require('@qdrant/js-client-rest');
const client = new QdrantClient({
url: 'https://xyz.cloud.qdrant.io',
apiKey: process.env.QDRANT_API_KEY,
checkCompatibility: false,
});
await client.upsert('my-collection', {
wait: true,
points: [
{
id: 1,
vector: { text: 'hello world', model: 'openai' },
payload: {},
},
],
});
// Hangs forever — no timeout, no error, no response
```
Environment:
- Node.js v20.20.2
- @qdrant/js-client-rest 1.17.0
- undici 6.24.1
- Running inside Docker (docker-compose)
Workaround
Using Node.js native `https.request` (HTTP/1.1) instead of the undici-based client works perfectly — returns 200 in ~222ms inside Docker.
```js
// This works inside Docker:
const https = require('https');
// ... manual HTTPS request with http1Only ...
```
Also confirmed: `curl --http2` from the host machine also hangs when targeting the inference endpoint, confirming the issue manifests at the HTTP/2 protocol level.
Root Cause Analysis
The `@qdrant/js-client-rest` package uses undici as its HTTP transport. While `allowH2` defaults to `false` in undici v6, HTTPS connections perform ALPN negotiation. If the server advertises h2, some versions/configurations may still negotiate HTTP/2, which then hangs on certain Qdrant Cloud inference endpoints inside Docker networking.
Suggested Fix
Add `allowH2: false` explicitly to the undici `Agent` options in `packages/js-client-rest/src/dispatcher.ts` to guarantee HTTP/1.1 and avoid any ALPN-based HTTP/2 upgrade:
```ts
// packages/js-client-rest/src/dispatcher.ts
new Agent({
bodyTimeout: 0,
headersTimeout: 0,
connections,
keepAliveTimeout: 10_000,
allowH2: false, // ← explicitly disable HTTP/2
})
```
This is a one-line, zero-risk change that makes the HTTP/1.1 guarantee explicit rather than relying on the undici default.
Version Info
- `@qdrant/js-client-rest`: 1.17.0
- undici: 6.24.1
- Node.js: v20.20.2
- Docker: docker-compose
- OS: macOS (host), Debian-based (container)
- Dominant language
- TypeScript
- Stars
- 464
- Forks
- 46
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from qdrant/qdrant-js
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
-
Payload typing Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in qdrant/qdrant-js
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100