{"record":{"id":"84c552f9f285fb89","repo":"risingwavelabs/risingwave","slug":"object-type-not-found-name","errorCode":null,"errorMessage":"{object_type} not found: {name}","messagePattern":"(.+?) not found: (.+?)","errorType":"error_code","errorClass":"CatalogError","httpStatus":null,"severity":"error","filePath":"src/frontend/src/catalog/mod.rs","lineNumber":111,"sourceCode":"/// Check if modifications happen to system catalog.\npub fn check_schema_writable(schema: &str) -> Result<()> {\n    if is_system_schema(schema) {\n        Err(ErrorCode::ProtocolError(format!(\n            \"permission denied to write on \\\"{}\\\", System catalog modifications are currently disallowed.\",\n            schema\n        )).into())\n    } else {\n        Ok(())\n    }\n}\n\npub type CatalogResult<T> = std::result::Result<T, CatalogError>;\n\n// TODO(error-handling): provide more concrete error code for different object types.\n#[derive(Error, Debug, thiserror_ext::Box)]\n#[thiserror_ext(newtype(name = CatalogError, extra_provide = Self::provide_postgres_error_code))]\npub enum CatalogErrorInner {\n    #[error(\"{object_type} not found: {name}\")]\n    NotFound {\n        object_type: &'static str,\n        name: String,\n    },\n\n    #[error(\n        \"{object_type} named {name} already exists{}\",\n        if *.under_creation { \" and is still being created\" } else { \"\" },\n    )]\n    Duplicated {\n        object_type: &'static str,\n        name: String,\n        under_creation: bool, // only used for StreamingJob type and Subscription for now\n    },\n}\n\nimpl CatalogError {\n    /// Provide the Postgres error code for the error.","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/frontend/src/catalog/mod.rs#L93-L129","documentation":"CatalogError::NotFound is the frontend catalog's error for looking up an object (table, schema, database, function, etc.) by name that does not exist. It carries the object type and the missing name and is mapped to a Postgres error code; the TODO notes more concrete codes are planned.","triggerScenarios":"Querying, altering, or dropping an object whose name is not in the catalog: `SELECT * FROM missing_table`, `DROP TABLE t`, `DESCRIBE unknown_view`, resolving table/function references during binding when the catalog reader cannot find the entry.","commonSituations":"Typos in table or schema names; querying before a MV/table finished creation; wrong database or search_path; object dropped by another session; case-sensitivity issues with quoted identifiers.","solutions":["Verify the object name and its spelling, including case sensitivity (quote identifiers if needed).","Check you are connected to the right database and that search_path includes the object's schema (`SHOW SCHEMAS`, `SHOW TABLES`).","Confirm the object exists and creation completed before querying it.","If the name is built dynamically, validate existence with catalog views before executing the statement."],"exampleFix":"-- before\nSELECT * FROM result;\n-- after\nSELECT * FROM public.result; -- or fix the typo after SHOW TABLES","handlingStrategy":"validation","validationCode":"const exists = await client.query(\n  \"SELECT 1 FROM rw_tables WHERE name = $1\", [tableName]);\nif (exists.rows.length === 0) throw new Error(`table ${tableName} missing`);","typeGuard":"function objectExists(rows) { return Array.isArray(rows) && rows.length > 0; }","tryCatchPattern":"try {\n  await client.query(`SELECT * FROM ${ident}`);\n} catch (e) {\n  if (String(e.message).endsWith(\"not found: \" + ident)) {\n    // create the object or correct the name\n  } else throw e;\n}","preventionTips":["Check SHOW TABLES / SHOW MATERIALIZED VIEWS before referencing objects","Be careful with identifier case sensitivity; quote to preserve case","Ensure DDL completed before queries reference the object","Pin the database and search_path in connection settings"],"tags":["catalog","not-found","frontend","sql"],"backgroundTag":"resource-not-found","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}