influxdata/influxdb · error · ResourceMappingError

missing resource name

Error message

missing resource name {0}

What it means

ResourceMappingError::MissingResourceName is thrown when a resource entry that should carry a name has none — the name string is empty or absent during resource mapping. The mapping layer requires every non-wildcard resource entry to identify itself by name.

Solutions

  1. Ensure every non-wildcard resource entry has a non-empty name before calling the mapping API.
  2. Validate permission definitions at load time and reject entries with empty names.
  3. Fix the template/config that produced an empty name value.

Example fix

// before
let names = vec![""]; // missing
// after
let names = vec!["my_db"];
Defensive patterns

Strategy: validation

Validate before calling

fn require_name(entry: &PermissionEntry) -> Result<&str, String> {
    entry.name.as_deref().filter(|n| !n.trim().is_empty()).ok_or_else(|| "missing resource name".to_string())
}

Try / catch

let name = require_name(&entry).map_err(ResourceMappingError::MissingResourceName)?;

Prevention

When it happens

Trigger: Passing an empty string or a record with a missing name field into the resource-name-to-id mapping when building token permissions.

Common situations: Deserialized permission JSON with a null/empty "name"; config templating that left a placeholder unsubstituted; programmatic construction skipping the name field.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19). Data as JSON: /api/errors/c8ca086924dd8267. Report an issue: GitHub.

Appendix: source

Thrown at influxdb3_authz/src/permissions.rs:38

pub const AUTHZ_DELETE_ROW_ACTION: &str = "delete";

pub const AUTHZ_CREATE_CRUD_ACTION: &str = "create";
pub const AUTHZ_READ_CRUD_ACTION: &str = "read";
pub const AUTHZ_UPDATE_CRUD_ACTION: &str = "update";
pub const AUTHZ_DELETE_CRUD_ACTION: &str = "delete";

pub const AUTHZ_WILDCARD: &str = "*";

#[derive(Debug, Error)]
pub enum ResourceMappingError {
    #[error("resource type not supported {0}")]
    ResourceTypeNotSupported(String),
    #[error("invalid resource name {0}")]
    InvalidResourceName(String),
    #[error("mixed wildcard (*) and resource name")]
    MixedWildcardAndRegularResourceName,
    #[error("missing resource name {0}")]
    MissingResourceName(String),
    #[error("action not supported, {0}")]
    ActionNotSupported(String),
    #[error("missing resource id {0}")]
    MissingResourceId(String),
}

pub trait ResourceNameToIdProvider {
    fn resource_name_to_id(
        &self,
        resource_type: ResourceType,
        names: &[String],
    ) -> Result<ResourceIdentifier, ResourceMappingError>;
}

pub trait ResourceIdToNameProvider {
    fn resource_id_to_name(
        &self,

View on GitHub (pinned to 06200ef96b)