goharbor/harbor · error
the value of isn't string
Error message
the value of %s isn't string
What it means
Type guard in replication parseParam: the named parameter exists in the job parameters but its value is not a string (replication params are JSON-encoded strings), so it cannot be unmarshalled into the target.
Solutions
- Pass resource parameters as JSON-encoded strings
- Check the encoding side that builds replication job params
- Fix any type coercion issues in parameter serialization
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at src/jobservice/job/impl/replication/replication.go:169 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/4db63aa8d2abf268.
Report an issue: GitHub.
Appendix: source
Thrown at src/jobservice/job/impl/replication/replication.go:169
}
}
opts := transfer.NewOptions(
transfer.WithSpeed(speed),
transfer.WithCopyByChunk(copyByChunk),
)
return src, dst, opts, nil
}
func parseParam(params map[string]any, name string, v any) error {
value, exist := params[name]
if !exist {
return fmt.Errorf("param %s not found", name)
}
str, ok := value.(string)
if !ok {
return fmt.Errorf("the value of %s isn't string", name)
}
return json.Unmarshal([]byte(str), v)
}
View on GitHub (pinned to 7b2fd08cc5)