{"record":{"id":"f78e5f67c498a4e5","repo":"influxdata/influxdb","slug":"missing-resource-id-0","errorCode":null,"errorMessage":"missing resource id {0}","messagePattern":"missing resource id (.+?)","errorType":"error_code","errorClass":"ResourceMappingError","httpStatus":null,"severity":"error","filePath":"influxdb3_authz/src/permissions.rs","lineNumber":42,"sourceCode":"pub const AUTHZ_READ_CRUD_ACTION: &str = \"read\";\npub const AUTHZ_UPDATE_CRUD_ACTION: &str = \"update\";\npub const AUTHZ_DELETE_CRUD_ACTION: &str = \"delete\";\n\npub const AUTHZ_WILDCARD: &str = \"*\";\n\n#[derive(Debug, Error)]\npub enum ResourceMappingError {\n    #[error(\"resource type not supported {0}\")]\n    ResourceTypeNotSupported(String),\n    #[error(\"invalid resource name {0}\")]\n    InvalidResourceName(String),\n    #[error(\"mixed wildcard (*) and resource name\")]\n    MixedWildcardAndRegularResourceName,\n    #[error(\"missing resource name {0}\")]\n    MissingResourceName(String),\n    #[error(\"action not supported, {0}\")]\n    ActionNotSupported(String),\n    #[error(\"missing resource id {0}\")]\n    MissingResourceId(String),\n}\n\npub trait ResourceNameToIdProvider {\n    fn resource_name_to_id(\n        &self,\n        resource_type: ResourceType,\n        names: &[String],\n    ) -> Result<ResourceIdentifier, ResourceMappingError>;\n}\n\npub trait ResourceIdToNameProvider {\n    fn resource_id_to_name(\n        &self,\n        identifier: &ResourceIdentifier,\n    ) -> Vec<Result<String, ResourceMappingError>>;\n}\n","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_authz/src/permissions.rs#L24-L60","documentation":"ResourceMappingError::MissingResourceId is thrown when a resource entry that must be identified by ID has no ID — the id string is empty or absent during resource mapping. It is the ID-based counterpart of MissingResourceName.","triggerScenarios":"Passing a resource record with an empty/absent id field into mapping functions that resolve resources by id when constructing token permissions.","commonSituations":"Deserialized permission data lacking the resource id; a lookup that failed earlier and silently produced an empty id; partial migration of permission records.","solutions":["Ensure every resource entry carries a non-empty resource id before mapping.","Fail fast on earlier lookups: if resource_name_to_id fails, do not continue with an empty id.","Repair or regenerate the permission records that are missing ids."],"exampleFix":"// before\nlet id = \"\"; // missing\n// after\nlet id = \"0x1234abcd\"; // valid resource id","handlingStrategy":"validation","validationCode":"fn require_id(entry: &PermissionEntry) -> Result<&str, String> {\n    entry.id.as_deref().filter(|i| !i.is_empty()).ok_or_else(|| \"missing resource id\".to_string())\n}","typeGuard":null,"tryCatchPattern":"let id = require_id(&entry).map_err(ResourceMappingError::MissingResourceId)?;","preventionTips":["Enforce non-empty id via schema validation when loading permission records","Never continue a pipeline after a failed name-to-id lookup","Backfill missing ids through a migration before use"],"tags":["authz","permissions","validation"],"backgroundTag":"empty-required-field","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"}