hashicorp/nomad · error

failed to launch docker logger process %s: %v

Error message

failed to launch docker logger process %s: %v

What it means

After the docker-logger plugin binary launches successfully, the driver calls dlogger.Start with the Docker endpoint, container ID, TLS material and start time. If the plugin reports an error starting log streaming for the container, the driver kills the plugin client and wraps the failure with this message, naming the container ID.

Source

Thrown at drivers/docker/driver.go:237

		if pluginClient != nil {
			pluginClient.Kill()
		}
		return nil, nil, fmt.Errorf("failed to launch docker logger plugin: %v", err)
	}

	if err := dlogger.Start(&docklog.StartOpts{
		Endpoint:    d.config.Endpoint,
		ContainerID: container.Container.ID,
		TTY:         container.Container.Config.Tty,
		Stdout:      cfg.StdoutPath,
		Stderr:      cfg.StderrPath,
		TLSCert:     d.config.TLS.Cert,
		TLSKey:      d.config.TLS.Key,
		TLSCA:       d.config.TLS.CA,
		StartTime:   startTime.Unix(),
	}); err != nil {
		pluginClient.Kill()
		return nil, nil, fmt.Errorf("failed to launch docker logger process %s: %v", container.Container.ID, err)
	}

	return dlogger, pluginClient, nil
}

func (d *Driver) RecoverTask(handle *drivers.TaskHandle) error {
	if _, ok := d.tasks.Get(handle.Config.ID); ok {
		return nil
	}

	var handleState taskHandleState
	if err := handle.GetDriverState(&handleState); err != nil {
		return fmt.Errorf("failed to decode driver task state: %v", err)
	}

	dockerClient, err := d.getDockerClient()
	if err != nil {
		return fmt.Errorf("failed to get docker client: %w", err)

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Verify the container ID still exists (`docker inspect <id>`); if not, the task is racing with teardown and can be rescheduled.
  2. Check the docker_endpoint config and Docker daemon reachability from the client host.
  3. Validate TLS config (cert, key, CA) paths exist, are readable, and are signed by the daemon's CA; regenerate expired certs.
  4. Read the plugin's underlying error in client logs to distinguish Docker API failure from TLS failure.

Example fix

// before: driver config with wrong endpoint/TLS
config {
  docker_endpoint = "tcp://127.0.0.1:2375"
}
// after: correct daemon endpoint with valid TLS
config {
  docker_endpoint = "unix:///var/run/docker.sock"
}
Defensive patterns

Strategy: validation

Validate before calling

if cfg, err := client.ContainerInspect(ctx, containerID); err != nil || cfg.State.Running == false {
    return fmt.Errorf("container %s not running; cannot start logger", containerID)
}

Type guard

func isLoggerStartErr(err error) bool { return err != nil && strings.Contains(err.Error(), "failed to launch docker logger process") }

Try / catch

if err := dlogger.Start(&docklog.StartOpts{...}); err != nil {
    pluginClient.Kill()
    if isLoggerStartErr(err) {
        logger.Error("logger start failed; check daemon/TLS/container", "container", containerID, "err", err)
    }
    return err
}

Prevention

When it happens

Trigger: setupNewDockerLogger (called by StartTask/RecoverTask) calls dlogger.Start and the plugin fails to attach to the container's logs: the container no longer exists or exited, the Docker endpoint/DaemonConfig is wrong, TLS certs (TLSCert/TLSKey/TLSCA) are invalid or unreadable, or the container was already torn down.

Common situations: Misconfigured docker_endpoint in the driver config; TLS client certs expired or not trusted by the Docker daemon; a race where the container is removed between inspect and logger start; the daemon connection was never healthy (docker.sock not mounted).

Related errors


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