docker/compose · error

invalid response from plugin: %s

Error message

invalid response from plugin: %s

What it means

Compose speaks a line protocol with service-provider plugins. A SetEnv message must be KEY=VALUE; when the message contains no '=', it cannot be split and this error is returned, aborting plugin variable collection for the service.

Source

Thrown at pkg/compose/plugins.go:160

	for {
		var msg JsonMessage
		err = decoder.Decode(&msg)
		if errors.Is(err, io.EOF) {
			break
		}
		if err != nil {
			return pluginVariables{}, err
		}
		switch msg.Type {
		case ErrorType:
			s.events.On(newEvent(service.Name, api.Error, firstLine(msg.Message)))
			return pluginVariables{}, errors.New(msg.Message)
		case InfoType:
			s.events.On(newEvent(service.Name, api.Working, firstLine(msg.Message)))
		case SetEnvType:
			key, val, found := strings.Cut(msg.Message, "=")
			if !found {
				return pluginVariables{}, fmt.Errorf("invalid response from plugin: %s", msg.Message)
			}
			variables.prefixed[key] = val
		case RawSetEnvType:
			key, val, found := strings.Cut(msg.Message, "=")
			if !found {
				return pluginVariables{}, fmt.Errorf("invalid response from plugin: %s", msg.Message)
			}
			variables.raw[key] = val
		case DebugType:
			logrus.Debugf("%s: %s", service.Name, msg.Message)
		default:
			return pluginVariables{}, fmt.Errorf("invalid response from plugin: %s", msg.Type)
		}
	}

	err = cmd.Wait()
	if err != nil {
		s.events.On(errorEvent(service.Name, err.Error()))

View on GitHub (pinned to ddc4b044b6)

Solutions

  1. Fix the plugin to emit strict KEY=VALUE for set-env messages
  2. Update the provider plugin to a version matching this compose release's protocol
  3. Reproduce with the plugin in debug mode (COMPOSE_DEBUG/verbose logs) to capture the offending line
Defensive patterns

Strategy: try-catch

Try / catch

vars, err := runProvider(ctx, service)
if err != nil && strings.Contains(err.Error(), "invalid response from plugin") {
    // plugin protocol bug: capture the message, report against the plugin, do not retry blindly
}

Prevention

When it happens

Trigger: A service provider plugin emits a SetEnv-type message whose payload lacks '=' (e.g. just a key, or free text). Reachable via docker compose up on a service declared with provider:.

Common situations: Custom/third-party provider plugins with a buggy message emitter; protocol drift between plugin and compose versions.

Related errors


AI-assisted analysis of docker/compose@ddc4b044b6 (2026-08-15). Data as JSON: /api/errors/3e3710f37c88a766. Report an issue: GitHub.