chroma-core / chroma-core/chroma
[Bug]: Only absolute URLs are supported
- Dominant language
- Rust
- Stars
- 29.3k
- Forks
- 2.5k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 38
Description
### What happened?
I am working on a project using [Meteor.js](https://www.meteor.com/) version 3.2.2. For those unfamiliar, Meteor.js is a Node.js framework. As stated in the title, I am getting the error **"Only absolute URLs are supported"** when trying to create a client. I am using an npm package and running Chrome in a Docker container, both of which are up-to-date. If I directly make an API request, there is no issue. To narrow down the problem, I added logs on the Node modules side. It also worked when I tried it directly on the node.
### Code inside the application:
```ts
Meteor.startup(async () => {
const tenantName = 'test';
const databaseName = 'test';
const client = new ChromaClient({
host: 'localhost',
port: 8000,
ssl: false,
tenant: tenantName,
database: databaseName,
fetchOptions: {
headers: {
Accept: 'application/json',
},
},
headers: {
Accept: 'application/json',
},
});
console.log(client);
const response = await client.version();
console.log(response);
});
```
### Log output from the package:
```js
var ChromaClient = class {
constructor(args = {}) {
let {
host = defaultChromaClientArgs.host,
port = defaultChromaClientArgs.port,
ssl = defaultChromaClientArgs.ssl,
tenant = defaultChromaClientArgs.tenant,
database = defaultChromaClientArgs.database,
headers = defaultChromaClientArgs.headers,
fetchOptions = defaultChromaClientArgs.fetchOptions
} = args;
if (args.path) {
console.warn(
"The 'path' argument is deprecated. Please use 'ssl', 'host', and 'port' instead"
);
const parsedPath = parseConnectionPath(args.path);
ssl = parsedPath.ssl;
host = parsedPath.host;
port = parsedPath.port;
}
if (args.auth) {
console.warn(
"The 'auth' argument is deprecated. Please use 'headers' instead"
);
if (!headers) {
headers = {};
}
if (!headers["x-chroma-token"] && args.auth.tokenHeaderType === "X_CHROMA_TOKEN" && args.auth.credentials) {
headers["x-chroma-token"] = args.auth.credentials;
}
}
const baseUrl = `${ssl ? "https" : "http"}://${host}:${port}`;
this._tenant = tenant || process.env.CHROMA_TENANT;
this._database = database || process.env.CHROMA_DATABASE;
const configOptions = {
...fetchOptions,
method: normalizeMethod(fetchOptions?.method),
baseUrl,
headers
};
Logger.info({ payload: configOptions }, "ChromaClient constructor configOptions");
const calculatedConfigOptions = w(configOptions);
Logger.info({ payload:calculatedConfigOptions }, "ChromaClient constructor calculatedConfigOptions");
this.apiClient = J(calculatedConfigOptions);
this.apiClient.setConfig({ fetch: chromaFetch });
}
//...
};
```
```js
var chromaFetch = async (input, init) => {
let response;
try {
response = await fetch(input, init);
} catch (err) {
Logger.info({ err, payload: { input, init } }, "chromaFetch error");
if (offlineError(err)) {
throw new ChromaConnectionError(
"Failed to connect to ChromaDB. Make sure your server is running and try again. If you are running from a browser, make sure that your ChromaDB instance is configured to allow requests from the current origin using the CHROMA_SERVER_CORS_ALLOW_ORIGINS environment variable."
);
}
throw new ChromaConnectionError("Failed to connect to Chroma");
}
if (response.ok) {
return response;
}
switch (response.status) {
case 400:
let status = "Bad Request";
try {
const responseBody = await response.json();
status = responseBody.message || status;
} catch {
}
throw new ChromaClientError(
`Bad request to ${input.url || "Chroma"} with status: ${status}`
);
case 401:
throw new ChromaUnauthorizedError(`Unauthorized`);
case 403:
throw new ChromaForbiddenError(
`You do not have permission to access the requested resource.`
);
case 404:
throw new ChromaNotFoundError(
`The requested resource could not be found`
);
case 409:
throw new ChromaUniqueError("The resource already exists");
case 422:
const body = await response.json();
if (body && body?.message.startsWith("Quota exceeded")) {
throw new ChromaQuotaExceededError(body?.message);
}
break;
}
throw new ChromaConnectionError(
`Unable to connect to the ChromaDB server. Please try again later.`
);
};
```
### Bash output:
```bash
[12-06-2025 09:44:45.561] INFO: ChromaClient constructor configOptions
payload: {
"headers": {
"Accept": "application/json"
},
"baseUrl": "http://localhost:8000"
}
[12-06-2025 09:44:45.561] INFO: ChromaClient constructor calculatedConfigOptions
payload: {
"bodySerializer": "(t) => JSON.stringify(t, (r, e) => typeof e == \"bigint\" ? e.toString() : e)",
"headers": {
"Accept": "application/json"
},
"parseAs": "auto",
"querySerializer": "(i) => {\n let o = [];\n if (i && typeof i == \"object\") for (let n in i) {\n let s = i[n];\n if (s != null) {\n if (Array.isArray(s)) {\n o = [...o, O({ allowReserved: t, explode: true, name: n, style: \"form\", value: s, ...r })];\n continue;\n }\n if (typeof s == \"object\") {\n o = [...o, q({ allowReserved: t, explode: true, name: n, style: \"deepObject\", value: s, ...e })];\n continue;\n }\n o = [...o, y({ allowReserved: t, name: n, value: s })];\n }\n }\n return o.join(\"&\");\n}",
"baseUrl": "http://localhost:8000"
}
[12-06-2025 09:44:45.562] INFO: {"_tenant":"test","_database":"test","apiClient":{"interceptors":{"error":{"_fns":[]},"request":{"_fns":[]},"response":{"_fns":[]}}}}
[12-06-2025 09:44:45.563] INFO: chromaFetch error
payload: {
"input": {}
}
err: {
"type": "TypeError",
"message": "Only absolute URLs are supported",
"stack":
TypeError: Only absolute URLs are supported
at getNodeRequestOptions (/Users/recepozen/.meteor/packages/fetch/.0.1.6.1jl6fak2dbx++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/node-fetch/lib/index.js:1327:9)
at /Users/recepozen/.meteor/packages/fetch/.0.1.6.1jl6fak2dbx++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/node-fetch/lib/index.js:1454:19
at new Promise ()
at fetch (/Users/recepozen/.meteor/packages/fetch/.0.1.6.1jl6fak2dbx++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/node-fetch/lib/index.js:1451:9)
at Package.fetch.fetch (packages/montiapm:agent/lib/hijack/http.js:73:27)
at chromaFetch (/Users/recepozen/bordo/monochat/node_modules/chromadb/src/chroma-fetch.ts:23:22)
at o (/Users/recepozen/bordo/monochat/node_modules/.pnpm/@hey-api+client-fetch@0.10.0_@hey-api+openapi-ts@0.67.3_typescript@5.8.3_/node_modules/@hey-api/client-fetch/src/client.ts:74:26)
at Object.get (/Users/recepozen/bordo/monochat/node_modules/.pnpm/@hey-api+client-fetch@0.10.0_@hey-api+openapi-ts@0.67.3_typescript@5.8.3_/node_modules/@hey-api/client-fetch/src/client.ts:155:23)
at Function.version (/Users/recepozen/bordo/monochat/node_modules/chromadb/src/api/sdk.gen.ts:320:51)
at ChromaClient.version (/Users/recepozen/bordo/monochat/node_modules/chromadb/src/cloud-client.ts:10:34)
at imports/managers/ai-manager/server/vector-stores/providers/chroma.ts:294:33
at Function.time (/Users/recepozen/bordo/monochat/.meteor/local/build/programs/server/tools/tool-env/profile.ts:646:30)
at /tools/static-assets/server/boot.js:453:19
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at /tools/static-assets/server/boot.js:503:5
at startServerProcess (/tools/static-assets/server/boot.js:501:3)
}
[12-06-2025 09:44:45.775] INFO: error on boot.js {"name":"ChromaConnectionError"}
[12-06-2025 09:44:45.775] INFO: ChromaConnectionError: Failed to connect to Chroma
at chromaFetch (/Users/recepozen/bordo/monochat/node_modules/chromadb/src/chroma-fetch.ts:31:3)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at o (/Users/recepozen/bordo/monochat/node_modules/.pnpm/@hey-api+client-fetch@0.10.0_@hey-api+openapi-ts@0.67.3_typescript@5.8.3_/node_modules/@hey-api/client-fetch/src/client.ts:74:20)
at ChromaClient.version (/Users/recepozen/bordo/monochat/node_modules/chromadb/src/cloud-client.ts:10:8)
at imports/managers/ai-manager/server/vector-stores/providers/chroma.ts:294:20
at /tools/static-assets/server/boot.js:453:5
at /tools/static-assets/server/boot.js:503:5
at startServerProcess (/tools/static-assets/server/boot.js:501:3)
=> Exited with code: 1
=> Your application is crashing. Waiting for file change.
```
### Versions
ChromaDB: 1.0.12
chromadb: 3.0.3
macos: 15.5 (24F74)
```bash
~/ meteor node -v
v22.14.0
~/ meteor npm -v
10.9.2```
### Relevant log output
```shell
[12-06-2025 09:44:45.561] INFO: ChromaClient constructor configOptions
payload: {
"headers": {
"Accept": "application/json"
},
"baseUrl": "http://localhost:8000"
}
[12-06-2025 09:44:45.561] INFO: ChromaClient constructor calculatedConfigOptions
payload: {
"bodySerializer": "(t) => JSON.stringify(t, (r, e) => typeof e == \"bigint\" ? e.toString() : e)",
"headers": {
"Accept": "application/json"
},
"parseAs": "auto",
"querySerializer": "(i) => {\n let o = [];\n if (i && typeof i == \"object\") for (let n in i) {\n let s = i[n];\n if (s != null) {\n if (Array.isArray(s)) {\n o = [...o, O({ allowReserved: t, explode: true, name: n, style: \"form\", value: s, ...r })];\n continue;\n }\n if (typeof s == \"object\") {\n o = [...o, q({ allowReserved: t, explode: true, name: n, style: \"deepObject\", value: s, ...e })];\n continue;\n }\n o = [...o, y({ allowReserved: t, name: n, value: s })];\n }\n }\n return o.join(\"&\");\n}",
"baseUrl": "http://localhost:8000"
}
[12-06-2025 09:44:45.562] INFO: {"_tenant":"test","_database":"test","apiClient":{"interceptors":{"error":{"_fns":[]},"request":{"_fns":[]},"response":{"_fns":[]}}}}
[12-06-2025 09:44:45.563] INFO: chromaFetch error
payload: {
"input": {}
}
err: {
"type": "TypeError",
"message": "Only absolute URLs are supported",
"stack":
TypeError: Only absolute URLs are supported
at getNodeRequestOptions (/Users/recepozen/.meteor/packages/fetch/.0.1.6.1jl6fak2dbx++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/node-fetch/lib/index.js:1327:9)
at /Users/recepozen/.meteor/packages/fetch/.0.1.6.1jl6fak2dbx++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/node-fetch/lib/index.js:1454:19
at new Promise ()
at fetch (/Users/recepozen/.meteor/packages/fetch/.0.1.6.1jl6fak2dbx++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/node-fetch/lib/index.js:1451:9)
at Package.fetch.fetch (packages/montiapm:agent/lib/hijack/http.js:73:27)
at chromaFetch (/Users/recepozen/bordo/monochat/node_modules/chromadb/src/chroma-fetch.ts:23:22)
at o (/Users/recepozen/bordo/monochat/node_modules/.pnpm/@hey-api+client-fetch@0.10.0_@hey-api+openapi-ts@0.67.3_typescript@5.8.3_/node_modules/@hey-api/client-fetch/src/client.ts:74:26)
at Object.get (/Users/recepozen/bordo/monochat/node_modules/.pnpm/@hey-api+client-fetch@0.10.0_@hey-api+openapi-ts@0.67.3_typescript@5.8.3_/node_modules/@hey-api/client-fetch/src/client.ts:155:23)
at Function.version (/Users/recepozen/bordo/monochat/node_modules/chromadb/src/api/sdk.gen.ts:320:51)
at ChromaClient.version (/Users/recepozen/bordo/monochat/node_modules/chromadb/src/cloud-client.ts:10:34)
at imports/managers/ai-manager/server/vector-stores/providers/chroma.ts:294:33
at Function.time (/Users/recepozen/bordo/monochat/.meteor/local/build/programs/server/tools/tool-env/profile.ts:646:30)
at /tools/static-assets/server/boot.js:453:19
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at /tools/static-assets/server/boot.js:503:5
at startServerProcess (/tools/static-assets/server/boot.js:501:3)
}
[12-06-2025 09:44:45.775] INFO: error on boot.js {"name":"ChromaConnectionError"}
[12-06-2025 09:44:45.775] INFO: ChromaConnectionError: Failed to connect to Chroma
at chromaFetch (/Users/recepozen/bordo/monochat/node_modules/chromadb/src/chroma-fetch.ts:31:3)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at o (/Users/recepozen/bordo/monochat/node_modules/.pnpm/@hey-api+client-fetch@0.10.0_@hey-api+openapi-ts@0.67.3_typescript@5.8.3_/node_modules/@hey-api/client-fetch/src/client.ts:74:20)
at ChromaClient.version (/Users/recepozen/bordo/monochat/node_modules/chromadb/src/cloud-client.ts:10:8)
at imports/managers/ai-manager/server/vector-stores/providers/chroma.ts:294:20
at /tools/static-assets/server/boot.js:453:5
at /tools/static-assets/server/boot.js:503:5
at startServerProcess (/tools/static-assets/server/boot.js:501:3)
=> Exited with code: 1
=> Your application is crashing. Waiting for file change.
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.