{"record":{"id":"75919f2e3b541d6c","repo":"influxdata/influxdb","slug":"cannot-create-internal-db","errorCode":null,"errorMessage":"cannot create internal db","messagePattern":"cannot create internal db","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"influxdb3_catalog/src/catalog/versions/v2.rs","lineNumber":1301,"sourceCode":"    let result = catalog\n        .create_database_opts(\n            INTERNAL_DB_NAME,\n            CreateDatabaseOptions::default().retention_period(INTERNAL_DB_RETENTION_PERIOD),\n        )\n        .await;\n    // what is the best outcome if \"_internal\" cannot be created?\n    match result {\n        Ok(_) => info!(\"created internal database\"),\n        Err(err) => {\n            match err {\n                CatalogError::AlreadyExists => {\n                    // this is probably ok\n                    debug!(\"not creating internal db as it exists already\");\n                }\n                _ => {\n                    // all other errors are unexpected state\n                    error!(?err, \"unexpected error when creating internal db\");\n                    panic!(\"cannot create internal db\");\n                }\n            }\n        }\n    };\n}\n\n#[derive(Debug, Default)]\npub struct CatalogBuilder {\n    catalog_id: Arc<str>,\n    object_store: Option<Arc<dyn ObjectStore>>,\n    time_provider: Option<Arc<dyn TimeProvider>>,\n    metric_registry: Option<Arc<Registry>>,\n}\n\nimpl CatalogBuilder {\n    pub fn catalog_id(mut self, catalog_id: impl Into<Arc<str>>) -> Self {\n        self.catalog_id = catalog_id.into();\n        self","sourceCodeStart":1283,"sourceCodeEnd":1319,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_catalog/src/catalog/versions/v2.rs#L1283-L1319","documentation":"During catalog bootstrap the library attempts to create an internal database. If creation returns any error other than 'already exists', the code logs it and panics with 'cannot create internal db', because the process cannot operate without its internal db.","triggerScenarios":"The create-internal-db call returns an unexpected error — e.g. permission denied on the storage path, object store misconfiguration, disk full, schema version conflicts — anything other than the AlreadyExists variant.","commonSituations":"Data directory owned by the wrong user or read-only filesystem; S3/object store credentials or bucket misconfigured; corrupted or partially-migrated catalog store after a failed upgrade; disk-full on local storage.","solutions":["Read the logged 'unexpected error when creating internal db' line — it carries the underlying cause (permissions, storage, etc.).","Fix storage permissions/availability: ensure the data directory is writable by the influxdb3 process and the disk is not full.","Verify object-store configuration (bucket, endpoint, credentials) if using remote storage.","If the catalog store is corrupted or half-migrated, restore from backup or re-bootstrap on a clean store.","Upgrade influxdb3 if the failure stems from a known migration bug in your version."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// before startup, verify storage is writable/available\nif !storage.is_reachable() || !storage.can_write() {\n    return Err(\"catalog storage unavailable; cannot create internal db\");\n}","typeGuard":"fn storage_ready(cfg: &StorageConfig) -> bool {\n    cfg.endpoint_resolves() && cfg.credentials_present() && cfg.path_writable()\n}","tryCatchPattern":"// The library panics on unexpected creation errors; supervise the process.\nloop {\n    match run_influxdb3().await {\n        Ok(()) => break,\n        Err(e) | Err(_) if is_panic(&e) => {\n            log::error!(\"catalog bootstrap failed: {e}; retrying after backoff\");\n            tokio::time::sleep(Duration::from_secs(5)).await;\n        }\n    }\n}","preventionTips":["Pre-provision and permission the data directory/object-store bucket","Validate storage config (endpoint, credentials, bucket) before startup","Monitor disk space and filesystem writability","Back up the catalog store before version upgrades","Read the 'unexpected error' log line to fix the root cause before restarting"],"tags":["panic","bootstrap","internal-db","storage"],"backgroundTag":"module-init-failed","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"}