gohugoio/hugo · warning

aborted

Error message

aborted

What it means

Raised in Deployer.Deploy (deploy/deploy.go:180) when `deployment.confirm` is enabled: after printing the upload/delete summary, Hugo prompts `Continue? (Y/n)` on stdin and returns `errors.New("aborted")` if the reply doesn't start with 'y' or 'Y'. It signals the user (or a non-interactive stdin) declined the deployment — no changes were applied.

Source

Thrown at deploy/deploy.go:180

	if len(uploads)+len(deletes) == 0 {
		if !d.quiet {
			d.logger.Println("No changes required.")
		}
		return nil
	}
	if !d.quiet {
		d.logger.Println(summarizeChanges(uploads, deletes))
	}

	// Ask for confirmation before proceeding.
	if d.cfg.Confirm && !d.cfg.DryRun {
		fmt.Printf("Continue? (Y/n) ")
		var confirm string
		if _, err := fmt.Scanln(&confirm); err != nil {
			return err
		}
		if confirm != "" && confirm[0] != 'y' && confirm[0] != 'Y' {
			return errors.New("aborted")
		}
	}

	// Order the uploads. They are organized in groups; all uploads in a group
	// must be complete before moving on to the next group.
	uploadGroups := applyOrdering(d.cfg.Ordering, uploads)

	nParallel := d.cfg.Workers
	var errs []error
	var errMu sync.Mutex // protects errs

	for _, uploads := range uploadGroups {
		// Short-circuit for an empty group.
		if len(uploads) == 0 {
			continue
		}

		// Within the group, apply uploads in parallel.

View on GitHub ↗ (pinned to 8a468df065)

Solutions

  1. If cancellation was intentional, nothing to fix — no files were uploaded or deleted.
  2. For CI/automation, remove `--confirm` / set `confirm = false` so no prompt is issued; use `--dryRun` first if you want a preview step.
  3. If you meant to proceed interactively, re-run and answer 'y' (or press Enter, which counts as yes).

Example fix

# before (CI script)
hugo deploy --confirm

# after
hugo deploy --dryRun   # review step
hugo deploy            # apply step, no prompt
Defensive patterns

Strategy: try-catch

Try / catch

if err := deployer.Deploy(ctx); err != nil {
    if strings.Contains(err.Error(), "aborted") {
        log.Println("deploy cancelled at confirmation prompt; re-run with --confirm or --force as appropriate")
        os.Exit(1)
    }
    return err
}

Prevention

When it happens

Trigger: `hugo deploy --confirm` (or `confirm = true` in the deployment config) where the operator types 'n' or anything not starting with y/Y at the prompt; also fires in CI when stdin supplies unexpected input to the prompt.

Common situations: Intentional cancellation after reviewing the change summary; running with `confirm` enabled in CI/cron where nothing can answer the prompt; piping input that doesn't match y/Y.

Related errors


AI-assisted analysis of gohugoio/hugo@8a468df065 (2026-07-31). Data as JSON: /data/errors/025014151dd910ea.json. Report an issue: GitHub ↗.