{"record":{"id":"cac71e58491cf607","repo":"influxdata/influxdb","slug":"table-table-name-is-not-defined-in-database-db-name-which","errorCode":null,"errorMessage":"table '{table_name}' is not defined in database '{db_name}', which uses explicit schemas; create the table with the /api/v3/configure/table API before writing to it","messagePattern":"table '(.+?)' is not defined in database '(.+?)', which uses explicit schemas; create the table with the /api/v3/configure/table API before writing to it","errorType":"validation","errorClass":"CatalogError","httpStatus":404,"severity":"error","filePath":"influxdb3_catalog/src/error.rs","lineNumber":100,"sourceCode":"    InvalidLastCacheKeyColumnType,\n\n    #[error(\"plugin trigger is already enabled\")]\n    TriggerAlreadyEnabled,\n\n    #[error(\"plugin trigger is already disabled\")]\n    TriggerAlreadyDisabled,\n\n    #[error(\"invalid column type for column '{column_name}', expected {expected}, got {got}\")]\n    InvalidColumnType {\n        column_name: Arc<str>,\n        expected: InfluxColumnType,\n        got: InfluxColumnType,\n    },\n\n    #[error(\"'{0}' is a reserved column\")]\n    ReservedColumn(Arc<str>),\n\n    #[error(\n        \"table '{table_name}' is not defined in database '{db_name}', which uses explicit schemas; \\\n         create the table with the /api/v3/configure/table API before writing to it\"\n    )]\n    UndeclaredTable {\n        db_name: Arc<str>,\n        table_name: Arc<str>,\n    },\n\n    #[error(\n        \"column '{column_name}' ({column_type}) is not defined in table '{table_name}' of \\\n         database '{db_name}', which uses explicit schemas; add the column with the \\\n         /api/v3/configure/table API before writing to it\"\n    )]\n    UndeclaredColumn {\n        db_name: Arc<str>,\n        table_name: Arc<str>,\n        column_name: Arc<str>,\n        column_type: InfluxColumnType,","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_catalog/src/error.rs#L82-L118","documentation":"CatalogError::UndeclaredTable is thrown on writes to a database configured with an explicit schema when the target table does not exist in the catalog. In explicit-schema mode the catalog will not auto-create tables, so writes to unknown tables are rejected with instructions to create the table via the /api/v3/configure/table API first.","triggerScenarios":"Writing line protocol (or using the write API) to database 'db' and measurement 'm' when 'm' has never been declared and the database's schema_mode is 'explicit'.","commonSituations":"Typos in measurement names in writers; deploying writers before running table-creation migrations; switching a database from auto to explicit schema mode after tables were previously auto-created.","solutions":["Create the table first via POST /api/v3/configure/table with its full column list, then retry the write.","Fix the measurement name in the writer to match an existing declared table.","If auto-creation is desired, switch the database schema mode back to 'auto'."],"exampleFix":"// before\ncurl -X POST .../write?db=metrics --data-binary 'newtable host=a val=1i'  // UndeclaredTable\n// after\ncurl -X POST .../api/v3/configure/table -d '{\"db\":\"metrics\",\"table\":\"newtable\",\"columns\":[{\"name\":\"host\",\"type\":\"tag\"},{\"name\":\"val\",\"type\":\"int64\"},{\"name\":\"time\",\"type\":\"timestamp\"}]}'\ncurl -X POST .../write?db=metrics --data-binary 'newtable host=a val=1i'","handlingStrategy":"validation","validationCode":"async function ensureTable(db, table, columns) {\n  const tables = await listTables(db);\n  if (!tables.includes(table)) {\n    await createTable(db, table, columns);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await writeLineProtocol(lines);\n} catch (e) {\n  if (e.message.includes(\"is not defined in database\")) {\n    await createTable(db, table, expectedColumns);\n    await writeLineProtocol(lines); // retry once\n  } else { throw e; }\n}","preventionTips":["Run table-creation migrations before deploying writers.","Validate measurement names against the declared table list in CI.","Document that explicit-schema databases never auto-create tables."],"tags":["influxdb3","explicit-schema","write","table"],"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"}