{"record":{"id":"d41d0c67afa856d2","repo":"risingwavelabs/risingwave","slug":"user-not-found","errorCode":null,"errorMessage":"User not found","messagePattern":"User not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/frontend/src/catalog/system_catalog/rw_catalog/iceberg_tables.rs","lineNumber":48,"sourceCode":"#[primary_key(catalog_name, table_namespace, table_name)]\nstruct IcebergTables {\n    pub catalog_name: String,\n    pub table_namespace: String,\n    pub table_name: String,\n    pub metadata_location: Option<String>,\n    pub previous_metadata_location: Option<String>,\n    pub iceberg_type: Option<String>,\n}\n\n#[system_catalog(table, \"rw_catalog.iceberg_tables\")]\nasync fn read(reader: &SysCatalogReaderImpl) -> Result<Vec<IcebergTables>> {\n    let rows = reader.meta_client.list_hosted_iceberg_tables().await?;\n\n    let catalog_reader = reader.catalog_reader.read_guard();\n    let user_reader = reader.user_info_reader.read_guard();\n    let user = user_reader\n        .get_user_by_name(&reader.auth_context.user_name)\n        .ok_or_else(|| anyhow!(\"User not found\"))?;\n\n    let mut res = Vec::new();\n    for row in rows {\n        let record = IcebergTables {\n            catalog_name: row.catalog_name,\n            table_namespace: row.table_namespace,\n            table_name: row.table_name,\n            metadata_location: row.metadata_location,\n            previous_metadata_location: row.previous_metadata_location,\n            iceberg_type: row.iceberg_type,\n        };\n        let table = catalog_reader\n            .get_created_table_by_name(\n                &record.catalog_name,\n                SchemaPath::Name(&record.table_namespace),\n                &record.table_name,\n            )?\n            .0;","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/frontend/src/catalog/system_catalog/rw_catalog/iceberg_tables.rs#L30-L66","documentation":"The `iceberg_tables` system catalog table lists hosted Iceberg tables for the current session. After listing tables it resolves the authenticated user via `user_info_reader.get_user_by_name(auth_context.user_name)`; if the user recorded in the auth context cannot be found in the user catalog, it returns the generic `anyhow!(\"User not found\")`.","triggerScenarios":"Querying `rw_catalog.iceberg_tables` (e.g. `SELECT * FROM iceberg_tables`) while the session's `auth_context.user_name` no longer exists in the user info catalog — e.g. the user was dropped after the connection was established.","commonSituations":"Long-lived connections surviving a `DROP USER`; replication or auth-cache staleness where the frontend's user info snapshot lacks the user; querying system catalogs through a service account that was removed.","solutions":["Reconnect so the auth context is re-established with a currently existing user.","Verify the user exists (`SELECT * FROM rw_users;`) and recreate it if it was dropped.","Check frontend logs for user-info cache sync issues and restart the frontend node if the cache is stale."],"exampleFix":"-- before (connected as dropped user)\nSELECT * FROM iceberg_tables;\n-- after\nCREATE USER report_reader WITH PASSWORD '...'; -- recreate, then reconnect as that user\nSELECT * FROM iceberg_tables;","handlingStrategy":"try-catch","validationCode":"const users = await client.query(\"SELECT name FROM rw_users WHERE name = $1\", [userName]);\nif (users.rows.length === 0) throw new Error(\"user does not exist; reconnect as a valid user\");","typeGuard":"function userExists(rows) { return Array.isArray(rows) && rows.length > 0; }","tryCatchPattern":"try {\n  const res = await client.query(\"SELECT * FROM iceberg_tables\");\n} catch (e) {\n  if (String(e.message) === \"User not found\") {\n    // reconnect to refresh the auth context\n  } else throw e;\n}","preventionTips":["Do not drop users with active long-lived connections, or reconnect afterwards","After DROP USER, recycle connection pools that authenticated as that user","Monitor frontend user-info cache consistency if using replicated frontends"],"tags":["system-catalog","iceberg","user","auth"],"backgroundTag":"user-not-found","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}