Upsert with Cloud Inference vectors hangs indefinitely (HTTP/2 issue with undici)

Open Beginner friendly
#131 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from qdrant/qdrant-js

All issues in qdrant/qdrant-js

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.