{"record":{"id":"aaf12ad7469cc363","repo":"hasura/graphql-engine","slug":"cannot-read-config-from-file-env-w","errorCode":null,"errorMessage":"cannot read config from file/env: %w","messagePattern":"cannot read config from file/env: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/cli.go","lineNumber":969,"sourceCode":"\tv.SetDefault(\"api_paths.v1_metadata\", \"v1/metadata\")\n\tv.SetDefault(\"api_paths.graphql\", \"v1/graphql\")\n\tv.SetDefault(\"api_paths.config\", \"v1alpha1/config\")\n\tv.SetDefault(\"api_paths.pg_dump\", \"v1alpha1/pg_dump\")\n\tv.SetDefault(\"api_paths.version\", \"v1/version\")\n\tv.SetDefault(\"metadata_directory\", DefaultMetadataDirectory)\n\tv.SetDefault(\"migrations_directory\", DefaultMigrationsDirectory)\n\tv.SetDefault(\"seeds_directory\", DefaultSeedsDirectory)\n\tv.SetDefault(\"actions.kind\", \"synchronous\")\n\tv.SetDefault(\"actions.handler_webhook_baseurl\", \"http://localhost:3000\")\n\tv.SetDefault(\"actions.codegen.framework\", \"\")\n\tv.SetDefault(\"actions.codegen.output_dir\", \"\")\n\tv.SetDefault(\"actions.codegen.uri\", \"\")\n\tv.SetDefault(\"no_transaction\", false)\n\tv.AddConfigPath(ec.ExecutionDirectory)\n\n\terr := v.ReadInConfig()\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"cannot read config from file/env: %w\", err))\n\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,","sourceCodeStart":951,"sourceCodeEnd":987,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/cli.go#L951-L987","documentation":"A scalar type referenced by its qualified name has not been defined in the metadata's scalar type declarations. Scalar references in field types or arguments must resolve to a declared scalar type.","triggerScenarios":"Using a scalar name (e.g. `Date`, `UUID`, `my_scalar`) in a field or argument type without a corresponding scalar_types entry, during metadata resolution.","commonSituations":"Assuming built-in scalars exist when only declared ones are available; renaming scalar declarations; referencing third-party/other-subgraph scalars that are not present locally.","solutions":["Add a scalar_types definition for the missing scalar name","Fix the reference to use an existing declared scalar","Import/include the metadata file declaring the scalar"],"exampleFix":"// before\nfields:\n  created: DateTime  // not declared\n// after\nscalar_types:\n  DateTime: ...\nfields:\n  created: DateTime","handlingStrategy":"validation","validationCode":"let scalars: HashSet<_> = metadata.scalar_types.keys().collect();\nfor t in referenced_scalar_types(&metadata) {\n    assert!(scalars.contains(&t), \"scalar type {t} not declared\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Declare every custom scalar explicitly, including common ones like DateTime/UUID","Use a shared scalars module imported by all subgraphs to avoid divergence"],"tags":["metadata","types","scalar","validation"],"backgroundTag":"undefined-type-reference","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}