{"record":{"id":"62ad98e693b5a348","repo":"linera-io/linera-protocol","slug":"failed-to-open-store","errorCode":null,"errorMessage":"Failed to open store","messagePattern":"Failed to open store","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"linera-storage-service/src/server.rs","lineNumber":694,"sourceCode":"            };\n            let storage_cache_config = StorageCacheConfig {\n                max_cache_size,\n                max_value_entry_size,\n                max_find_keys_entry_size,\n                max_find_key_values_entry_size,\n                max_cache_entries,\n                max_cache_value_size,\n                max_cache_find_keys_size,\n                max_cache_find_key_values_size,\n            };\n            let config = RocksDbStoreConfig {\n                inner_config,\n                storage_cache_config,\n            };\n            let database = RocksDbDatabase::maybe_create_and_connect(&config, &namespace)\n                .await\n                .expect(\"store\");\n            let store = database.open_shared(&[]).expect(\"Failed to open store\");\n            let store = LocalStore::RocksDb(store);\n            (store, endpoint)\n        }\n    };\n    let pending_big_puts = Arc::new(RwLock::new(BTreeMap::default()));\n    let pending_big_reads = Arc::new(RwLock::new(PendingBigReads::default()));\n    let store = StorageServer {\n        store,\n        pending_big_puts,\n        pending_big_reads,\n    };\n    let endpoint = endpoint.parse().unwrap();\n    info!(\"Starting linera_storage_service on endpoint={}\", endpoint);\n    Server::builder()\n        .add_service(StorageServiceServer::new(store))\n        .serve(endpoint)\n        .await\n        .expect(\"a successful running of the server\");","sourceCodeStart":676,"sourceCodeEnd":712,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-storage-service/src/server.rs#L676-L712","documentation":"After connecting, `database.open_shared(&[])` opens a shared store handle (column families plus the StorageCacheConfig caches) on the just-opened RocksDB instance. `.expect(\"Failed to open store\")` panics when that open fails: typically the on-disk state does not match what was requested (column families or options differ from how the DB was created) or the database files are corrupted.","triggerScenarios":"Reopening a RocksDB namespace with different options or column families than it was created with; MANIFEST/SST corruption after a crash or unclean kill during compaction; a cache configuration value rejected when applied to an existing namespace.","commonSituations":"Upgrading linera-storage-service across versions that changed storage options; kill -9 of the server mid-write; partially copied or moved DB directories; mixing namespaces created by a different linera version.","solutions":["Re-run with the exact same --path/namespace and options (same binary version) that created the database","Read the RocksDB error printed just before the panic: it names the real cause (corruption vs. column family vs. I/O)","Restore the directory from backup, or recreate the namespace and re-import the data if corruption is confirmed","Shut down with SIGTERM instead of kill -9 so RocksDB keeps MANIFEST files consistent"],"exampleFix":"# before: kill -9 mid-compaction -> next startup panics \"Failed to open store\"\nkill -9 $STORAGE_PID\n\n# after: graceful shutdown, then restart\nkill -TERM $STORAGE_PID && wait $STORAGE_PID","handlingStrategy":"validation","validationCode":"# sanity-check the DB directory before start\n[ -f /data/linera/CURRENT ] && ls /data/linera/MANIFEST-* >/dev/null 2>&1 \\\n  || { echo \"not a healthy RocksDB dir - do not start\"; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Shut down with SIGTERM, never SIGKILL, so RocksDB flushes MANIFEST state","Pin one linera-storage-service version per DB directory; upgrade deliberately","Back up the DB directory before changing options or versions"],"tags":["rocksdb","storage","corruption","startup","rust"],"backgroundTag":"database-open-failed","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}