goharbor/harbor · error
or list must start with
Error message
or list must start with "{" and end with "}" What it means
Syntax error in q.parseList for OR lists: the value does not end with '}' to match its leading '{', so it is not a valid '{a b c}' or-list token.
Solutions
- Close the list with '}', e.g. '{a b c}'
- Check for missing or extra brace characters in the query value
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/lib/q/builder.go:173 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/cdcf99a9a99de898.
Report an issue: GitHub.
Appendix: source
Thrown at src/lib/q/builder.go:173
ol := &OrList{}
ol.Values = append(ol.Values, values...)
return ol, nil
}
func parseAndList(value string) (*AndList, error) {
values, err := parseList(value, '(')
if err != nil {
return nil, err
}
al := &AndList{}
al.Values = append(al.Values, values...)
return al, nil
}
func parseList(value string, c rune) ([]any, error) {
length := len(value)
if c == '{' && value[length-1] != '}' {
return nil, fmt.Errorf(`or list must start with "{" and end with "}"`)
}
if c == '(' && value[length-1] != ')' {
return nil, fmt.Errorf(`and list must start with "(" and end with ")"`)
}
var vs []any
for str := range strings.SplitSeq(value[1:length-1], " ") {
v := parseValue(str)
if s, ok := v.(string); ok && len(s) == 0 {
continue
}
vs = append(vs, v)
}
return vs, nil
}
// try to parse value as time first, then integer, and last string
func parseValue(value string) any {View on GitHub (pinned to 7b2fd08cc5)