{"record":{"id":"8f93abfc56a6d0e5","repo":"n8n-io/n8n","slug":"invalid-qdrant-url-url-please-provide-a-valid","errorCode":null,"errorMessage":"Invalid Qdrant URL: ${url}. Please provide a valid URL with protocol (http/https)","messagePattern":"Invalid Qdrant URL: (.+?)\\. Please provide a valid URL with protocol \\(http/https\\)","errorType":"validation","errorClass":"UserError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreQdrant/Qdrant.utils.ts","lineNumber":22,"sourceCode":"export type QdrantCredential = {\n\tqdrantUrl: string;\n\tapiKey: string;\n};\n\nfunction parseQdrantUrl(url: string): { protocol: string; host: string; port: number } {\n\ttry {\n\t\tconst parsedUrl = new URL(url);\n\t\treturn {\n\t\t\tprotocol: parsedUrl.protocol,\n\t\t\thost: parsedUrl.hostname,\n\t\t\tport: parsedUrl.port\n\t\t\t\t? parseInt(parsedUrl.port, 10)\n\t\t\t\t: parsedUrl.protocol === 'https:'\n\t\t\t\t\t? 443\n\t\t\t\t\t: 80,\n\t\t};\n\t} catch (error) {\n\t\tthrow new UserError(\n\t\t\t`Invalid Qdrant URL: ${url}. Please provide a valid URL with protocol (http/https)`,\n\t\t);\n\t}\n}\n\nexport function createQdrantClient(credentials: QdrantCredential): QdrantClient {\n\tconst { protocol, host, port } = parseQdrantUrl(credentials.qdrantUrl);\n\n\tconst qdrantClient = new QdrantClient({\n\t\thost,\n\t\tapiKey: credentials.apiKey,\n\t\thttps: protocol === 'https:',\n\t\tport,\n\t});\n\n\treturn qdrantClient;\n}\n","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreQdrant/Qdrant.utils.ts#L4-L40","documentation":"Thrown as a UserError by `parseQdrantUrl` when `new URL(url)` raises — the supplied Qdrant URL is not parseable. The function expects a full URL including a protocol (`http://` or `https://`); without a protocol the URL constructor throws. Because it is a UserError, n8n treats it as a user-fixable configuration problem, not a transient operational issue.","triggerScenarios":"User enters `localhost:6333` (no protocol), `qdrant.example.com` (no protocol), an empty string, a URL with an unsupported scheme like `ftp://`, or a value with illegal characters / spaces.","commonSituations":"Copy-paste from a config file that omits the protocol; mistyping `http//` (missing colon); trailing slash or path expected by Qdrant but missing; environment variable resolving to empty at runtime.","solutions":["Prefix the URL with `http://` or `https://` (e.g. `http://localhost:6333`).","Use the Qdrant default ports: 6333 for HTTP, 6334 for gRPC.","If behind TLS, use `https://` and the matching port.","Trim whitespace from the credential value before saving."],"exampleFix":"// before\nconst parsedUrl = new URL(url);\n\n// after: tolerate a missing protocol by defaulting to http\nconst normalized = /^https?:\\/\\//i.test(url) ? url : `http://${url}`;\nconst parsedUrl = new URL(normalized);","handlingStrategy":"validation","validationCode":"// Normalize the URL before parsing so a missing protocol is not fatal.\nfunction normalizeUrl(input: string): string {\n  const trimmed = input.trim();\n  if (!trimmed) throw new UserError('Qdrant URL is required');\n  return /^https?:\\/\\//i.test(trimmed) ? trimmed : `http://${trimmed}`;\n}\nconst parsedUrl = new URL(normalizeUrl(credentials.qdrantUrl));","typeGuard":"function isHttpUrl(value: string): boolean {\n  try {\n    const u = new URL(value);\n    return u.protocol === 'http:' || u.protocol === 'https:';\n  } catch {\n    return false;\n  }\n}","tryCatchPattern":"// Validate at the credential boundary, not deep inside the client builder.\nif (!isHttpUrl(credentials.qdrantUrl)) {\n  throw new UserError(`Invalid Qdrant URL: ${credentials.qdrantUrl}. Please provide a valid URL with protocol (http/https)`);\n}","preventionTips":["Always include `http://` or `https://` in the Qdrant URL field.","Trim whitespace from pasted URLs.","Add a credential-save validator that runs `new URL(...)` before persisting."],"tags":["qdrant","vector-store","url-validation","user-error","configuration","langchain"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}