goharbor/harbor · error

the configure value can not be empty

Error message

the configure value can not be empty

What it means

Sentinel error ErrStringValueIsEmpty, returned by NonEmptyStringType.validate when a configuration item whose metadata type is NonEmptyString is set to a value that is empty or only whitespace. The offending input is the config value being set.

Solutions

  1. Provide a non-blank value for the configuration item
  2. If an empty value should be legal, change the item's metadata type from NonEmptyString to StringType
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/lib/config/metadata/value.go:34 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/55a49a070ecad737. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/config/metadata/value.go:34

import (
	"errors"
	"time"

	"github.com/goharbor/harbor/src/lib/log"
)

var (
	// ErrNotDefined ...
	ErrNotDefined = errors.New("configure item is not defined in metadata")
	// ErrTypeNotMatch ...
	ErrTypeNotMatch = errors.New("the required value doesn't matched with metadata defined")
	// ErrInvalidData ...
	ErrInvalidData = errors.New("the data provided is invalid")
	// ErrValueNotSet ...
	ErrValueNotSet = errors.New("the configure value is not set")
	// ErrStringValueIsEmpty ...
	ErrStringValueIsEmpty = errors.New("the configure value can not be empty")
)

// ConfigureValue - struct to hold a actual value, also include the name of config metadata.
type ConfigureValue struct {
	Name  string `json:"name,omitempty"`
	Value string `json:"value,omitempty"`
}

// NewCfgValue ... Create checked config value
func NewCfgValue(name, value string) (*ConfigureValue, error) {
	result := &ConfigureValue{}
	err := result.Set(name, value)
	if err != nil {
		result.Name = name // Keep name to trace error
	}
	return result, err
}

View on GitHub (pinned to 7b2fd08cc5)