{"record":{"id":"df1557b30c44bc1d","repo":"Mintplex-Labs/anything-llm","slug":"not-a-valid-url","errorCode":null,"errorMessage":"Not a valid URL.","messagePattern":"Not a valid URL\\.","errorType":"validation","errorClass":"Error","httpStatus":400,"severity":"error","filePath":"collector/extensions/index.js","lineNumber":131,"sourceCode":"          data: {\n            title: null,\n            author: null,\n          },\n        });\n      }\n      return;\n    }\n  );\n\n  app.post(\n    \"/ext/website-depth\",\n    [verifyPayloadIntegrity],\n    async function (request, response) {\n      try {\n        const websiteDepth = require(\"../utils/extensions/WebsiteDepth\");\n        const { url, depth = 1, maxLinks = 20 } = reqBody(request);\n        const validatedUrl = validateURL(url);\n        if (!validURL(validatedUrl)) throw new Error(\"Not a valid URL.\");\n        const scrapedData = await websiteDepth(validatedUrl, depth, maxLinks);\n        response.status(200).json({ success: true, data: scrapedData });\n      } catch (e) {\n        console.error(e);\n        response.status(400).json({ success: false, reason: e.message });\n      }\n      return;\n    }\n  );\n\n  app.post(\n    \"/ext/confluence\",\n    [verifyPayloadIntegrity, setDataSigner],\n    async function (request, response) {\n      try {\n        const { loadConfluence } = require(\"../utils/extensions/Confluence\");\n        const { success, reason, data } = await loadConfluence(\n          reqBody(request),","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/collector/extensions/index.js#L113-L149","documentation":"connect() calls client.describeIndex(PINECONE_INDEX) and throws when status.ready is falsy. Pinecone reports ready=true only once an index is fully provisioned and servable; a freshly created index (especially serverless or pod-based) spends seconds to minutes in an initializing state. This is a startup race between index creation and first use, not an authentication problem.","triggerScenarios":"Creating a Pinecone index and immediately embedding documents or calling /api/ext/vectors/heartbeat; embedding right after recreating an index with the same name; hitting an index that Pinecone lists in a non-Ready lifecycle state (initializing, failed, paused); first embed after a fresh deploy pointed at a brand-new index.","commonSituations":"Infrastructure scripts that create-then-load without waiting; index recreated during migration/restore; Pinecone control-plane slowness during provisioning; a wrong PINECONE_INDEX name that resolves to a different, not-yet-ready index in the account.","solutions":["Wait 30-60 seconds (serverless) or a few minutes (pods) after index creation, then retry the operation — readiness is transient.","Check the index state directly: Pinecone console, or `curl -H \"Api-Key: $PINECONE_API_KEY\" https://api.pinecone.io/indexes/$PINECONE_INDEX` and confirm status.state is 'Ready'.","Verify PINECONE_INDEX points at the intended, fully provisioned index in the same project as the API key.","Wrap first-use connect() in a bounded retry-with-backoff loop that only retries on 'not ready' and rethrows everything else."],"exampleFix":"// before\nconst conn = await pinecone.connect(); // throws during provisioning\n\n// after - retry only the transient 'not ready' case\nasync function connectWhenReady(db, tries = 12) {\n  for (let i = 0; i < tries; i++) {\n    try {\n      return await db.connect();\n    } catch (e) {\n      if (!/not ready/i.test(e.message)) throw e;\n      await new Promise((r) => setTimeout(r, 5_000));\n    }\n  }\n  throw new Error('Pinecone index still not ready after retry window');\n}","handlingStrategy":"retry","validationCode":"import { Pinecone } from '@pinecone-database/pinecone';\n\nconst pc = new Pinecone({ apiKey: process.env.PINECONE_API_KEY });\nconst desc = await pc.describeIndex(process.env.PINECONE_INDEX).catch(() => null);\nif (!desc?.status?.ready) {\n  // index still provisioning — do not call connect()/embed yet\n  throw new Error(`Index not ready (state: ${desc?.status?.state ?? 'unknown'})`);\n}","typeGuard":"async function isPineconeIndexReady(pc, indexName) {\n  const d = await pc.describeIndex(indexName).catch(() => null);\n  return d?.status?.ready === true;\n}","tryCatchPattern":"const MAX_TRIES = 10;\nfor (let i = 0; i < MAX_TRIES; i++) {\n  try {\n    return await pineconeDB.connect();\n  } catch (e) {\n    if (!/not ready/i.test(e.message)) throw e; // only the transient case retries\n    await new Promise((r) => setTimeout(r, 5_000 * (i + 1)));\n  }\n}\nthrow new Error('Pinecone index never became ready');","preventionTips":["Create Pinecone indexes ahead of deployment, not inline with the first embed.","Poll describeIndex(...).status.ready at startup and gate ingestion on it.","Treat status.state values other than 'Ready' as a deployment blocker surfaced in health checks.","Never auto-retry non-transient Pinecone errors with the same loop — match on the message first."],"tags":["pinecone","provisioning","index-state","startup-race","retry"],"backgroundTag":"service-not-ready","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}