goharbor/harbor · error

the 1st field (indicating Seconds of time) of the cron setti

Error message

the 1st field (indicating Seconds of time) of the cron setting must be 0

What it means

Error "the 1st field (indicating Seconds of time) of the cron setting must be 0" thrown in goharbor/harbor.

Source

Thrown at src/common/utils/utils.go:310

}

// CronParser returns the parser of cron string with format of "* * * * * *"
func CronParser() cronlib.Parser {
	return cronlib.NewParser(cronlib.Second | cronlib.Minute | cronlib.Hour | cronlib.Dom | cronlib.Month | cronlib.Dow)
}

// ValidateCronString check whether it is a valid cron string and whether the 1st field (indicating Seconds of time) of the cron string is a fixed value of 0 or not
func ValidateCronString(cron string) error {
	if len(cron) == 0 {
		return fmt.Errorf("empty cron string is invalid")
	}
	_, err := CronParser().Parse(cron)
	if err != nil {
		return err
	}
	cronParts := strings.Split(cron, " ")
	if len(cronParts) == 6 && cronParts[0] != "0" {
		return fmt.Errorf("the 1st field (indicating Seconds of time) of the cron setting must be 0")
	}
	return nil
}

// IsLocalPath checks if path is local, includes the empty path
func IsLocalPath(path string) bool {
	return len(path) == 0 || (strings.HasPrefix(path, "/") && !strings.HasPrefix(path, "//"))
}

View on GitHub (pinned to 7b2fd08cc5)

When it happens

Trigger: Thrown at src/common/utils/utils.go:310 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/6da14ed02072c5f2. Report an issue: GitHub.