hasura/graphql-engine · error

setting up codegen-assets repo failed (this is required for

Error message

setting up codegen-assets repo failed (this is required for automatically generating actions code): %w

What it means

Wrapped variant for errors from scalar type resolution (scalar_types module), surfaced transparently with the inner error's message. It fires when resolving a scalar type definition itself fails (e.g. unknown underlying type representation or invalid scalar config).

Source

Thrown at cli/commands/actions_codegen.go:46

  hasura actions codegen

  # Generate code for an Action
  hasura actions codegen [action-name]

  # Generate code for two or more Actions
  hasura actions codegen [action-name] [action-name...]

  # Derive an Action from a Hasura operation
  hasura actions codegen [action-name] --derive-from ""`,
		SilenceUsage: true,
		PreRunE: func(cmd *cobra.Command, args []string) error {
			op := genOpName(cmd, "PreRunE")

			err := ec.SetupCodegenAssetsRepo()
			if err != nil {
				return errors.E(
					op,
					fmt.Errorf(
						"setting up codegen-assets repo failed (this is required for automatically generating actions code): %w",
						err,
					),
				)
			}
			// ensure codegen-assets repo exists
			err = ec.CodegenAssetsRepo.EnsureCloned()
			if err != nil {
				return errors.E(
					op,
					fmt.Errorf(
						"pulling latest actions codegen files from internet failed: %w",
						err,
					),
				)
			}

			return nil

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Read the inner ScalarTypesError message to identify the exact scalar problem
  2. Fix or simplify the scalar type definition (logic/comparison/aggregate config)
  3. Check that the chosen representation is supported by the scalar's data connector
Defensive patterns

Strategy: try-catch

Try / catch

match resolve(&md) {
    Err(ResolveError::ScalarTypesError(inner)) => {
        eprintln!("scalar resolution failed: {inner}");
        fix_scalar_definition(&inner);
    }
    r => r,
}

Prevention

When it happens

Trigger: Declaring a scalar type whose definition fails scalar resolution — such as referencing an unknown comparison operator type, an invalid type representation for a data connector, or a malformed aggregate/compare config — during metadata resolution.

Common situations: Defining custom scalars with unsupported representations per data connector; version skew between metadata format and resolver; copying scalar definitions from another connector type without adjusting them.

Related errors


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