goharbor/harbor · error

invalid %s, should be %s or %s

Error message

invalid %s, should be %s or %s

What it means

Error "invalid %s, should be %s or %s" thrown in goharbor/harbor.

Source

Thrown at src/lib/config/metadata/type.go:81

	StringType
}

func (t *AuthModeType) validate(str string) error {
	if str == common.LDAPAuth || str == common.DBAuth || str == common.UAAAuth || str == common.HTTPAuth || str == common.OIDCAuth {
		return nil
	}
	return fmt.Errorf("invalid %s, shoud be one of %s, %s, %s, %s, %s",
		common.AUTHMode, common.DBAuth, common.LDAPAuth, common.UAAAuth, common.HTTPAuth, common.OIDCAuth)
}

// ProjectCreationRestrictionType ...
type ProjectCreationRestrictionType struct {
	StringType
}

func (t *ProjectCreationRestrictionType) validate(str string) error {
	if !(str == common.ProCrtRestrAdmOnly || str == common.ProCrtRestrEveryone) {
		return fmt.Errorf("invalid %s, should be %s or %s",
			common.ProjectCreationRestriction,
			common.ProCrtRestrAdmOnly,
			common.ProCrtRestrEveryone)
	}
	return nil
}

// IntType ..
type IntType struct {
}

func (t *IntType) validate(str string) error {
	_, err := parseInt(str)
	return err
}

func (t *IntType) get(str string) (any, error) {
	return parseInt(str)

View on GitHub (pinned to 7b2fd08cc5)

When it happens

Trigger: Thrown at src/lib/config/metadata/type.go:81 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/624b4f031e0ae6f7. Report an issue: GitHub.