{"record":{"id":"08676ec602efc0ae","repo":"medusajs/medusa","slug":"medusa-search-requires-an-explicit-endpoint-prov","errorCode":null,"errorMessage":"Medusa search requires an explicit \"endpoint\" provider option","messagePattern":"Medusa search requires an explicit \"endpoint\" provider option","errorType":"validation","errorClass":"MedusaError","httpStatus":400,"severity":"critical","filePath":"packages/modules/search/src/providers/search-medusa/utils/client.ts","lineNumber":180,"sourceCode":"    return this.client_.request(\"POST\", this.path(\"/query\"), { body })\n  }\n\n  multiQuery(body: IndexMultiQueryParams): Promise<IndexMultiQueryResponse> {\n    return this.client_.request(\"POST\", this.path(\"/query/multi\"), { body })\n  }\n}\n\nexport function validateMedusaSearchOptions(\n  options: MedusaSearchProviderOptions\n): void {\n  if (!options?.api_key) {\n    throw new MedusaError(\n      MedusaError.Types.INVALID_ARGUMENT,\n      'Medusa search requires an explicit \"api_key\" provider option'\n    )\n  }\n  if (!options.endpoint) {\n    throw new MedusaError(\n      MedusaError.Types.INVALID_ARGUMENT,\n      'Medusa search requires an explicit \"endpoint\" provider option'\n    )\n  }\n  if (!options.environment_handle) {\n    throw new MedusaError(\n      MedusaError.Types.INVALID_ARGUMENT,\n      'Medusa search requires an explicit \"environment_handle\" provider option'\n    )\n  }\n}\n","sourceCodeStart":162,"sourceCodeEnd":192,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/modules/search/src/providers/search-medusa/utils/client.ts#L162-L192","documentation":"The provider client requires a non-empty endpoint URL to know where to send requests. This INVALID_ARGUMENT error is thrown at construction when the endpoint provider option is absent or empty.","triggerScenarios":"Configuring the search-medusa provider in medusa-config without an endpoint option, or with a typo'd/empty environment variable such as process.env.MEDUSA_SEARCH_ENDPOINT when it is unset.","commonSituations":"Copy-pasting a provider config snippet that omits endpoint; missing SEARCH_ENDPOINT/MEDUSA_SEARCH_ENDPOINT env var in production while it existed locally; renaming the env var without updating the config.","solutions":["Add endpoint to the provider options (e.g. https://search.medusa.cloud or your provisioned URL)","Set the backing environment variable in .env / hosting environment and restart","Double-check the variable name in medusa-config matches the one in .env exactly"],"exampleFix":"// before\noptions: { api_key: process.env.SEARCH_API_KEY }\n// after\noptions: {\n  api_key: process.env.SEARCH_API_KEY,\n  endpoint: process.env.SEARCH_ENDPOINT ?? \"https://search.medusa.csord.net\",\n}\n","handlingStrategy":"validation","validationCode":"if (!process.env.MEDUSA_SEARCH_ENDPOINT) {\n  throw new Error(\"MEDUSA_SEARCH_ENDPOINT is required for the search-medusa provider\")\n}","typeGuard":"const isValidEndpoint = (v) =>\n  typeof v === \"string\" && /^https?:\\/\\/.+/.test(v)","tryCatchPattern":null,"preventionTips":["Fail fast at boot on missing endpoint","Prefer a valid https URL constant over env if the endpoint is fixed","Validate provider options once in medusa-config with a schema check"],"tags":["search","config","endpoint","missing-env-var"],"backgroundTag":"missing-endpoint-url","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}