hashicorp/nomad · error

cannot update alloc to Connect in-place

Error message

cannot update alloc to Connect in-place

What it means

consulGRPCSocketHook.Update guard: the hook's Connect proxies were never initialized (len(h.proxies)==0), so the allocation cannot transition to using Connect via an in-place update. This is effectively a programming/state error, since Update should only run when Connect services exist and the hook preran.

Source

Thrown at client/allocrunner/consul_grpc_sock_hook.go:163

			mErr = multierror.Append(mErr, err)
		}
	}
	return mErr.ErrorOrNil()
}

// Update creates a gRPC socket file and proxy if there are any Connect
// services.
func (h *consulGRPCSocketHook) Update(req *interfaces.RunnerUpdateRequest) error {
	h.mu.Lock()
	defer h.mu.Unlock()

	h.alloc = req.Alloc

	if !h.shouldRun() {
		return nil
	}
	if len(h.proxies) == 0 {
		return fmt.Errorf("cannot update alloc to Connect in-place")
	}

	var mErr *multierror.Error
	for _, proxy := range h.proxies {
		if err := proxy.run(); err != nil {
			mErr = multierror.Append(mErr, err)
		}
	}
	return mErr.ErrorOrNil()
}

func (h *consulGRPCSocketHook) Postrun() error {
	h.mu.Lock()
	defer h.mu.Unlock()

	for _, proxy := range h.proxies {
		if err := proxy.stop(); err != nil {
			// Only log failures to stop proxies. Worst case scenario is a small

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Verify Prerun ran successfully before Update for this allocation
  2. Ensure the job's group actually has Connect services defined
  3. Resubmit the job or restart the allocation instead of an in-place update
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at client/allocrunner/consul_grpc_sock_hook.go:163 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/04e0379a33c887f0. Report an issue: GitHub.