Mintplex-Labs/anything-llm · error
Weaviate::Invalid ENV settings
Error message
Weaviate::Invalid ENV settings
What it means
Weaviate's connect() refuses to run unless process.env.VECTOR_DB is exactly "weaviate". It is a fail-fast guard so the provider is only used when the app was actually configured for Weaviate; any other value (chroma, qdrant, lance, unset, or different casing) throws before any network call is made.
Source
Thrown at server/utils/vectorDbProviders/weaviate/index.js:22
const { storeVectorResult, cachedVectorInformation } = require("../../files");
const { v4: uuidv4 } = require("uuid");
const { toChunks, getEmbeddingEngineSelection } = require("../../helpers");
const { camelCase } = require("../../helpers/camelcase");
const { sourceIdentifier } = require("../../chats");
const { VectorDatabase } = require("../base");
class Weaviate extends VectorDatabase {
constructor() {
super();
}
get name() {
return "Weaviate";
}
async connect() {
if (process.env.VECTOR_DB !== "weaviate")
throw new Error("Weaviate::Invalid ENV settings");
const weaviateUrl = new URL(process.env.WEAVIATE_ENDPOINT);
const options = {
scheme: weaviateUrl.protocol?.replace(":", "") || "http",
host: weaviateUrl?.host,
...(process.env?.WEAVIATE_API_KEY?.length > 0
? { apiKey: new weaviate.ApiKey(process.env?.WEAVIATE_API_KEY) }
: {}),
};
const client = weaviate.client(options);
const isAlive = await await client.misc.liveChecker().do();
if (!isAlive)
throw new Error(
"Weaviate::Invalid Alive signal received - is the service online?"
);
return { client };
}
View on GitHub (pinned to 3aec848f28)
Solutions
- Set VECTOR_DB="weaviate" (exact lowercase) in server/.env next to WEAVIATE_ENDPOINT
- Fully restart the AnythingLLM server/container after saving .env so process.env is re-read
- If using the provider in a script/test, load env first: require('dotenv').config() or export VECTOR_DB=weaviate in the shell
- Strip stray quotes/spaces from .env values and confirm docker-compose actually passes the variable into the container
Example fix
# before (.env) VECTOR_DB=Weaviate # after (.env) VECTOR_DB=weaviate WEAVIATE_ENDPOINT=http://localhost:8080
Defensive patterns
Strategy: validation
Validate before calling
function canUseWeaviate() {
return process.env.VECTOR_DB === "weaviate" && !!process.env.WEAVIATE_ENDPOINT;
}
if (!canUseWeaviate()) throw new Error("Configure VECTOR_DB=weaviate and WEAVIATE_ENDPOINT first"); Try / catch
try {
const { client } = await weaviate.connect();
} catch (e) {
if (e.message.includes("Invalid ENV settings")) { fixVectorDbEnv(); return; }
throw e;
} Prevention
- Validate required env pairs at boot and fail with a listing of missing keys instead of at first connect
- Use exact lowercase provider ids in VECTOR_DB — the comparison is case-sensitive
- Reload/restart the process (or container) after every .env change before testing providers
When it happens
Trigger: Anything that reaches Weaviate.connect() while VECTOR_DB != "weaviate": a typo'd or unset VECTOR_DB value, a .env edit that was never reloaded, or importing/instantiating the provider directly in a test or script without the server environment loaded.
Common situations: VECTOR_DB=Weaviate (capitalized — the check is case-sensitive); docker container started without the env file/passing env vars; running unit tests against the provider class without dotenv; .env changed but the Node process not restarted.
Related errors
- Could not embed document chunks! This document will not be r
- Type "${type}" is not a valid type to sync.
- No ApiPie LLM API key was set.
- No Azure API endpoint was set.
- No Azure API key was set.
AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18).
Data as JSON: /api/errors/82a93bffb17acb73.
Report an issue: GitHub.