hasura/graphql-engine · error
parsing 'admin_secrets' from config.yaml / environment varia
Error message
parsing 'admin_secrets' from config.yaml / environment variable HASURA_GRAPHQL_ADMIN_SECRETS failed: expected value of format ["secret1", "secret2"]: %w
What it means
A command's preset (default) argument value failed type checking against the argument's declared type. The message includes the argument name, the optional role the preset is for, the command, and the underlying TypeError detail.
Source
Thrown at cli/cli.go:988
}
adminSecret := v.GetString("admin_secret")
if adminSecret == "" {
adminSecret = v.GetString("access_key")
}
// Admin secrets can be specified as a string value of format
// ["secret1", "secret2"], similar to how the corresponding environment variable
// HASURA_GRAPHQL_ADMIN_SECRETS is configured with the server
adminSecretsList := v.GetString("admin_secrets")
adminSecrets := []string{}
if len(adminSecretsList) > 0 {
err = json.Unmarshal([]byte(adminSecretsList), &adminSecrets)
if err != nil {
return errors.E(
op,
fmt.Errorf(
"parsing 'admin_secrets' from config.yaml / environment variable HASURA_GRAPHQL_ADMIN_SECRETS failed: expected value of format [\"secret1\", \"secret2\"]: %w",
err,
),
)
}
}
ec.Config = &Config{
Version: ConfigVersion(v.GetInt("version")),
DisableInteractive: v.GetBool("disable_interactive"),
ServerConfig: ServerConfig{
Endpoint: v.GetString("endpoint"),
AdminSecret: adminSecret,
AdminSecrets: adminSecrets,
APIPaths: &ServerAPIPaths{
V1Query: v.GetString("api_paths.query"),
V2Query: v.GetString("api_paths.v2_query"),
V1Metadata: v.GetString("api_paths.v1_metadata"),View on GitHub (pinned to 724551b9ae)
Solutions
- Check the {type_error} detail and fix the preset value to match the argument's declared type
- Quote or unquote the YAML value appropriately (e.g. numbers vs strings)
- If the argument type changed, update the preset accordingly or remove it
Example fix
# before arguments_presets: limit: "10" # argument is Int # after arguments_presets: limit: 10
Defensive patterns
Strategy: validation
Validate before calling
for (arg, preset) in &command.argument_presets {
let decl = command.arguments.get(arg).expect("preset arg exists");
assert!(type_check(preset, decl).is_ok(), "preset for {arg} fails type check");
} Prevention
- Write presets with the argument's exact type (quote strings, unquoted numbers/bools)
- Re-validate presets whenever argument types change
When it happens
Trigger: Declaring an `argument_presets` entry on a command whose value cannot be coerced to the argument's type — e.g. a string preset for an Int argument, or a malformed object for an object-typed argument — during metadata resolution.
Common situations: Hand-writing preset values in YAML where scalars lose their quotes/type (e.g. `"true"` vs `true`); changing an argument's type without updating presets; env-sourced presets that resolve to strings needing explicit typing.
Related errors
- the following argument in command {command_name:} is defined
- error in getting server feature flags %w
- expected 0 arguments, found: %v
- argument '{argument_name}' in {source} has an error: {error}
- argument {argument_name:?} has an issue: {issue:?}
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/8491d36b12f46ce8.
Report an issue: GitHub.