nektos/act · error

invalid logging opts for driver %s

Error message

invalid logging opts for driver %s

What it means

parseLoggingOpts rejects any --log-opt flags when the logging driver is 'none'. The 'none' driver discards logs and takes no options by definition, matching Docker CLI behavior, so combining '--log-driver none' with any '--log-opt k=v' fails container option parsing.

Source

Thrown at pkg/container/docker_cli.go:930

			for param := range strings.SplitSeq(publish, ",") {
				k, v, ok := strings.Cut(param, "=")
				if !ok || k == "" {
					return optsList, fmt.Errorf("invalid publish opts format (should be name=value but got '%s')", param)
				}
				params[k] = v
			}
			optsList = append(optsList, fmt.Sprintf("%s:%s/%s", params["published"], params["target"], params["protocol"]))
		} else {
			optsList = append(optsList, publish)
		}
	}
	return optsList, nil
}

func parseLoggingOpts(loggingDriver string, loggingOpts []string) (map[string]string, error) {
	loggingOptsMap := opts.ConvertKVStringsToMap(loggingOpts)
	if loggingDriver == "none" && len(loggingOpts) > 0 {
		return map[string]string{}, fmt.Errorf("invalid logging opts for driver %s", loggingDriver)
	}
	return loggingOptsMap, nil
}

// takes a local seccomp daemon, reads the file contents for sending to the daemon
func parseSecurityOpts(securityOpts []string) ([]string, error) {
	for key, opt := range securityOpts {
		k, v, ok := strings.Cut(opt, "=")
		if !ok && k != "no-new-privileges" {
			k, v, ok = strings.Cut(opt, ":")
		}
		if (!ok || v == "") && k != "no-new-privileges" {
			// "no-new-privileges" is the only option that does not require a value.
			return securityOpts, fmt.Errorf("invalid --security-opt: %q", opt)
		}
		if k == "seccomp" {
			switch v {
			case seccompProfileDefault, seccompProfileUnconfined:

View on GitHub (pinned to 4f41128141)

Solutions

  1. Remove all --log-opt flags when using --log-driver none
  2. Or switch to a driver that accepts options: --log-driver json-file --log-opt max-size=10m
  3. Audit combined option strings for leftover log-opts

Example fix

# before
options: --log-driver none --log-opt max-size=10m

# after
options: --log-driver none
Defensive patterns

Strategy: validation

Validate before calling

if loggingDriver == "none" && len(loggingOpts) > 0 {
    return fmt.Errorf("driver 'none' takes no --log-opt values")
}

Prevention

When it happens

Trigger: Passing options like '--log-driver none --log-opt max-size=10m' in a job's container options or act's docker arguments. Detected client-side before the daemon call.

Common situations: Copy-pasting a base options set that includes log-opts while switching the driver to none; trying to silence container logs but keeping tuning flags; template fragments merged from different services.

Related errors


AI-assisted analysis of nektos/act@4f41128141 (2026-08-15). Data as JSON: /api/errors/a0367b230774d4ad. Report an issue: GitHub.