{"record":{"id":"833c7fe53cf8ea06","repo":"hasura/graphql-engine","slug":"error-in-fetching-introspection-schema-w","errorCode":null,"errorMessage":"error in fetching introspection schema: %w","messagePattern":"error in fetching introspection schema: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/commands/actions_create.go","lineNumber":92,"sourceCode":"\tname        string\n\tderiveFrom  string\n\twithCodegen bool\n}\n\nfunc (o *actionsCreateOptions) run() error {\n\tvar (\n\t\top          errors.Op = \"commands.actionsCreateOptions.run\"\n\t\tintroSchema hasura.IntrospectionSchema\n\t\terr         error\n\t)\n\n\tif o.deriveFrom != \"\" {\n\t\to.deriveFrom = strings.TrimSpace(o.deriveFrom)\n\t\to.EC.Spin(\"Deriving a Hasura operation...\")\n\n\t\tintroSchema, err = o.EC.APIClient.V1Graphql.GetIntrospectionSchema()\n\t\tif err != nil {\n\t\t\treturn errors.E(op, fmt.Errorf(\"error in fetching introspection schema: %w\", err))\n\t\t}\n\n\t\to.EC.Spinner.Stop()\n\t}\n\n\t// create new action\n\to.EC.Spin(\"Creating the action...\")\n\tactionCfg := actions.New(o.EC, o.EC.MetadataDir)\n\to.EC.Spinner.Stop()\n\n\terr = actionCfg.Create(o.name, introSchema, o.deriveFrom)\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"error in creating action: %w\", err))\n\t}\n\n\topts := &MetadataApplyOptions{\n\t\tEC: o.EC,\n\t}","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/actions_create.go#L74-L110","documentation":"Same introspection-fetch failure as in codegen, but raised by `hasura actions create --derive-from`: before creating an action derived from an existing GraphQL operation, the CLI must fetch the server's introspection schema via o.EC.APIClient.V1Graphql.GetIntrospectionSchema(), and that HTTP call failed.","triggerScenarios":"Running `hasura actions create <name> --derive-from '<query>'` when the engine at --endpoint is unreachable, the admin secret is wrong, or the server returns an error for the introspection query.","commonSituations":"Expired/incorrect --admin-secret, wrong endpoint URL (http vs https, port), engine container not running, network/VPN blocking the server, or server version restricting introspection.","solutions":["Verify the server is reachable: `curl <endpoint>/healthz`.","Pass the correct --endpoint and --admin-secret.","Fix network/proxy issues between CLI and server.","If you cannot enable introspection, create the action without --derive-from and write its type definitions manually."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"curl -sf -H \"X-Hasura-Admin-Secret: $SECRET\" \"$ENDPOINT/v1/graphql\" -d '{\"query\":\"{ __schema { queryType { name } } }\"}'","typeGuard":null,"tryCatchPattern":"Catch, distinguish auth (401/403) vs connectivity failures from the wrapped error, fix credentials or network, then retry the create.","preventionTips":["Health-check the endpoint first.","Use env vars for admin secret rather than inline flags.","Avoid --derive-from against servers with introspection disabled."],"tags":["graphql","introspection","hasura-cli","auth","network"],"backgroundTag":"graphql-introspection-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}