{"record":{"id":"8491d36b12f46ce8","repo":"hasura/graphql-engine","slug":"parsing-admin-secrets-from-config-yaml-environ","errorCode":null,"errorMessage":"parsing 'admin_secrets' from config.yaml / environment variable HASURA_GRAPHQL_ADMIN_SECRETS failed: expected value of format [\"secret1\", \"secret2\"]: %w","messagePattern":"parsing 'admin_secrets' from config\\.yaml / environment variable HASURA_GRAPHQL_ADMIN_SECRETS failed: expected value of format \\[\"secret1\", \"secret2\"\\]: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/cli.go","lineNumber":988,"sourceCode":"\t}\n\n\tadminSecret := v.GetString(\"admin_secret\")\n\tif adminSecret == \"\" {\n\t\tadminSecret = v.GetString(\"access_key\")\n\t}\n\n\t// Admin secrets can be specified as a string value of format\n\t// [\"secret1\", \"secret2\"], similar to how the corresponding environment variable\n\t// HASURA_GRAPHQL_ADMIN_SECRETS is configured with the server\n\tadminSecretsList := v.GetString(\"admin_secrets\")\n\n\tadminSecrets := []string{}\n\tif len(adminSecretsList) > 0 {\n\t\terr = json.Unmarshal([]byte(adminSecretsList), &adminSecrets)\n\t\tif err != nil {\n\t\t\treturn errors.E(\n\t\t\t\top,\n\t\t\t\tfmt.Errorf(\n\t\t\t\t\t\"parsing 'admin_secrets' from config.yaml / environment variable HASURA_GRAPHQL_ADMIN_SECRETS failed: expected value of format [\\\"secret1\\\", \\\"secret2\\\"]: %w\",\n\t\t\t\t\terr,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t}\n\n\tec.Config = &Config{\n\t\tVersion:            ConfigVersion(v.GetInt(\"version\")),\n\t\tDisableInteractive: v.GetBool(\"disable_interactive\"),\n\t\tServerConfig: ServerConfig{\n\t\t\tEndpoint:     v.GetString(\"endpoint\"),\n\t\t\tAdminSecret:  adminSecret,\n\t\t\tAdminSecrets: adminSecrets,\n\t\t\tAPIPaths: &ServerAPIPaths{\n\t\t\t\tV1Query:    v.GetString(\"api_paths.query\"),\n\t\t\t\tV2Query:    v.GetString(\"api_paths.v2_query\"),\n\t\t\t\tV1Metadata: v.GetString(\"api_paths.v1_metadata\"),","sourceCodeStart":970,"sourceCodeEnd":1006,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/cli.go#L970-L1006","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before\narguments_presets:\n  limit: \"10\"   # argument is Int\n# after\narguments_presets:\n  limit: 10","handlingStrategy":"validation","validationCode":"for (arg, preset) in &command.argument_presets {\n    let decl = command.arguments.get(arg).expect(\"preset arg exists\");\n    assert!(type_check(preset, decl).is_ok(), \"preset for {arg} fails type check\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Write presets with the argument's exact type (quote strings, unquoted numbers/bools)","Re-validate presets whenever argument types change"],"tags":["metadata","commands","arguments","type-error","presets"],"backgroundTag":"type-mismatch-in-metadata","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}