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

Thrown from the PreRunE hook of `hasura actions use-codegen` when ec.SetupCodegenAssetsRepo() fails. Setup ensures the codegen-assets repository is cloned and up to date locally so framework templates and starter kits can be listed; any git/network/filesystem failure inside setup surfaces here.

Source

Thrown at cli/commands/actions_use_codegen.go:51

  hasura actions use-codegen --framework nodejs-express

  # Use codegen from framework list
  hasura actions use-codegen

  # Set output directory
  hasura actions use-codegen --output-dir codegen

  # Use a codegen with a starter kit
  hasura actions use-codegen --with-starter-kit true`,
		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,
					),
				)
			}

			err = ec.SetupCodegenAssetsRepo()
			if err != nil {
				return errors.E(op, "setting up codengen assets repo failed")
			}
			// 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,

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Verify `git ls-remote https://github.com/hasura/codegen-assets` works from the same shell.
  2. Install/fix git and ensure it is on PATH.
  3. Configure proxy env (HTTPS_PROXY) or git http.proxy if behind a corporate proxy.
  4. Remove the existing codegen-assets clone dir and retry for a clean clone.
Defensive patterns

Strategy: retry

Validate before calling

command -v git >/dev/null && git ls-remote https://github.com/hasura/codegen-assets.git >/dev/null 2>&1

Try / catch

Catch, verify git/network, remove the stale clone, retry the command once.

Prevention

When it happens

Trigger: Running `hasura actions use-codegen` offline, without git on PATH, behind a proxy blocking github.com, or with an unwritable/corrupted CLI home directory where the repo is cloned.

Common situations: Restricted corporate networks, CI without egress to github.com, broken proxy config, or a corrupted earlier clone in the CLI home dir.

Related errors


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