goharbor/harbor · error

invalid config, item not defined in metadatalist, %v

Error message

invalid config, item not defined in metadatalist, %v

What it means

Error "invalid config, item not defined in metadatalist, %v" thrown in goharbor/harbor.

Source

Thrown at src/pkg/config/manager.go:194

	}
}

// UpdateConfig - Update config Store with a specified configuration and also save updated configure.
func (c *CfgManager) UpdateConfig(ctx context.Context, cfgs map[string]any) error {
	return c.Store.Update(ctx, cfgs)
}

// GetItemFromDriver ...
func (c *CfgManager) GetItemFromDriver(ctx context.Context, key string) (map[string]any, error) {
	return c.Store.GetFromDriver(ctx, key)
}

// ValidateCfg validate config by metadata. return the first error if exist.
func (c *CfgManager) ValidateCfg(ctx context.Context, cfgs map[string]any) error {
	for key, value := range cfgs {
		item, exist := metadata.Instance().GetByName(key)
		if !exist {
			return fmt.Errorf("invalid config, item not defined in metadatalist, %v", key)
		}
		if item.Scope == metadata.SystemScope {
			return fmt.Errorf("system config items cannot be updated, item: %v", key)
		}

		strVal := utils.GetStrValueOfAnyType(value)

		// Trim spaces from the robot_name_prefix before validation
		if key == common.RobotNamePrefix {
			strVal = strings.TrimSpace(strVal)
			if len(strVal) == 0 {
				return fmt.Errorf("robot_name_prefix cannot be empty or contain only spaces")
			}
			cfgs[key] = strVal
		}

		// check storage per project before setting it
		if key == common.StoragePerProject {

View on GitHub (pinned to 7b2fd08cc5)

When it happens

Trigger: Thrown at src/pkg/config/manager.go:194 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16). Data as JSON: /api/errors/97ee1aff5139da70. Report an issue: GitHub.