{"record":{"id":"e8818d0e38a37f77","repo":"influxdata/influxdb","slug":"the-following-database-does-not-exist-0","errorCode":null,"errorMessage":"The following Database does not exist: {0}","messagePattern":"The following Database does not exist: (.+?)","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3_server/src/http.rs","lineNumber":373,"sourceCode":"    #[error(\"Python plugins not enabled on this server\")]\n    PythonPluginsNotEnabled,\n\n    #[error(\"Plugin error: {0}\")]\n    Plugin(#[from] influxdb3_processing_engine::plugins::PluginError),\n\n    #[error(\"Processing engine error: {0}\")]\n    ProcessingEngine(#[from] influxdb3_processing_engine::manager::ProcessingEngineError),\n\n    #[error(transparent)]\n    Influxdb3TypesHttp(#[from] influxdb3_types::http::Error),\n\n    #[error(\"Authorization error: {0}\")]\n    ResourceAuthorization(#[from] ResourceAuthorizationError),\n\n    #[error(\"Authentication error: {0}\")]\n    Authentication(#[from] AuthenticatorError),\n\n    #[error(\"The following Database does not exist: {0}\")]\n    MissingDb(String),\n\n    #[error(\"The following Database Table does not exist: {0}\")]\n    MissingTable(String),\n\n    #[error(\"Cannot parse the given human time: {0}\")]\n    ParsingHumanTime(#[source] humantime::DurationError),\n\n    #[error(\"Cannot parse the timestamp: {0}\")]\n    ParsingTimestamp(#[from] chrono::ParseError),\n\n    #[error(\"Timestamp is out of range\")]\n    TimestampOutOfRange,\n\n    #[error(\"Current node mode does not use the processing engine\")]\n    NoProcessingEngine,\n\n    #[error(\"invalid request: {0}\")]","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_server/src/http.rs#L355-L391","documentation":"This error is the `MissingDb(String)` variant of the HTTP server's `Error` enum in influxdb3_server/src/http.rs, rendered as \"The following Database does not exist: {0}\". It is thrown when an HTTP API request references a database (bucket) name that InfluxDB 3 does not have. It surfaces for query, write, and other database-scoped API calls where the db parameter does not match any existing database.","triggerScenarios":"Sending an HTTP API request (e.g. POST /api/v3/query_influxql, /api/v3/query_sql, or a write path) whose `db` parameter names a database that was never created or was deleted.","commonSituations":"Typo or wrong casing in the db name; pointing a client at a fresh server where the database was never created; switching environments (dev vs prod) where the database exists elsewhere; database deleted by retention/management operations between calls.","solutions":["List existing databases (e.g. `SHOW DATABASES` or the catalog API) and confirm the exact name","Create the missing database before retrying (e.g. `CREATE DATABASE mydb` or the write-with-implicit-create path)","Fix the `db` parameter in the client/config to match an existing database name","Check you are connected to the intended server/environment"],"exampleFix":"// before\ncurl -X POST 'http://localhost:8181/api/v3/query_sql' -d '{\"db\": \"weather_data\", \"query\": \"SELECT * FROM temps\"}'\n// after\ncurl -X POST 'http://localhost:8181/api/v3/query_sql' -d '{\"db\": \"weather\", \"query\": \"SELECT * FROM temps\"}' // db exists (verified via SHOW DATABASES)\n-- or, create it first:\nCREATE DATABASE weather","handlingStrategy":"validation","validationCode":"// before calling the HTTP API\nconst dbs = await fetch('http://localhost:8181/api/v3/query_sql', {\n  method: 'POST',\n  body: JSON.stringify({ db: 'internal', q: 'SHOW DATABASES' })\n}).then(r => r.json());\nif (!dbs.some(r => r[Object.keys(r)[0]] === dbName)) {\n  throw new Error(`db ${dbName} does not exist on this server`);\n}","typeGuard":"function dbExists(dbName, existingDbs) {\n  return typeof dbName === 'string' && existingDbs.includes(dbName);\n}","tryCatchPattern":"try {\n  await query(dbName, sql);\n} catch (e) {\n  if (e.message.startsWith('The following Database does not exist')) {\n    await createDatabase(dbName);\n    return query(dbName, sql); // retry once after creating\n  }\n  throw e;\n}","preventionTips":["Run SHOW DATABASES and keep the db name in shared config rather than hardcoding","Automate database creation in environment provisioning scripts","Watch for case/whitespace differences in db names between environments","Use one client-config source of truth across dev/staging/prod"],"tags":["http","database","influxdb3","resource-not-found"],"backgroundTag":"entity-not-found","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}