hasura/graphql-engine · error

%s: %s

Error message

%s: %s

What it means

ConvertMetadataToSDL runs the cli-ext helper as a subprocess to turn actions/custom_types metadata into GraphQL SDL. This error means the subprocess returned a non-zero exit; the message combines the exec error with everything the process wrote to stderr.

Source

Thrown at cli/internal/metadataobject/actions/cli_extension/cli_extension.go:78

	}

	sdlToCmd := exec.Command(*c.binPath)
	args := []string{"sdl", "to", "--input-file", inputFileName, "--output-file", outputFileName}
	sdlToCmd.Args = append(sdlToCmd.Args, args...)

	var (
		stdout bytes.Buffer
		stderr bytes.Buffer
	)

	sdlToCmd.Stdout = &stdout
	sdlToCmd.Stderr = &stderr
	err = sdlToCmd.Run()

	c.logger.WithField("command", "sdl to").Debug("output: " + stdout.String())

	if err != nil {
		return toResponse, errors.E(op, fmt.Errorf("%s: %s", err.Error(), stderr.String()))
	}

	tmpByt, err := readCliExtOutput(outputFileName)
	if err != nil {
		return toResponse, errors.E(op, err)
	}

	err = yaml.Unmarshal(tmpByt, &toResponse)
	if err != nil {
		return toResponse, errors.E(op, errors.KindBadInput, err)
	}

	return toResponse, nil
}

// ConvertSDLToMetadata converts graphql SDL to hasura metadata.
func (c *Config) ConvertSDLToMetadata(
	fromPayload types.SDLFromRequest,

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Read the stderr portion of the message — it states the actual extension failure
  2. Install or update the plugin: `hasura plugins install cli-ext` / `hasura plugins update cli-ext`
  3. Verify the cli-ext binary resolves on PATH (especially in CI) and is executable
  4. Simplify the metadata payload to isolate content the extension rejects
Defensive patterns

Strategy: retry

Validate before calling

// Pre-flight: subprocess binary must exist
if _, err := exec.LookPath("cli-ext-hasura"); err != nil {
  // install plugin before proceeding
}

Try / catch

resp, err := ext.ConvertMetadataToSDL(req)
if err != nil {
  if strings.Contains(err.Error(), ":") && isPluginMissing(err) { // parse stderr
    installPlugin(); resp, err = ext.ConvertMetadataToSDL(req) // retry once
  }
}

Prevention

When it happens

Trigger: Calling ConvertMetadataToSDL (from Create or Export) when the cli-ext binary is missing, not executable, of an incompatible version, or when it rejects the request payload written to its temp file.

Common situations: Fresh machine without `hasura plugins install cli-ext`; plugin/CLI version mismatch; PATH problems in CI containers; metadata containing constructs the extension cannot parse.

Related errors


AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28). Data as JSON: /api/errors/163096eb99c226c4. Report an issue: GitHub.