{"id":"40799e3f5fbca4dc","repo":"docker/cli","slug":"uts-invalid-uts-mode","errorCode":null,"errorMessage":"--uts: invalid UTS mode","messagePattern":"--uts: invalid UTS mode","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/container/opts.go","lineNumber":525,"sourceCode":"\tenvVariables, err := opts.ReadKVEnvStrings(copts.envFile.GetSlice(), copts.env.GetSlice())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"--env-file: %w\", err)\n\t}\n\n\t// collect all the labels for the container\n\tlabels, err := opts.ReadKVStrings(copts.labelsFile.GetSlice(), copts.labels.GetSlice())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"--label-file: %w\", err)\n\t}\n\n\tpidMode := container.PidMode(copts.pidMode)\n\tif !pidMode.Valid() {\n\t\treturn nil, errors.New(\"--pid: invalid PID mode\")\n\t}\n\n\tutsMode := container.UTSMode(copts.utsMode)\n\tif !utsMode.Valid() {\n\t\treturn nil, errors.New(\"--uts: invalid UTS mode\")\n\t}\n\n\tusernsMode := container.UsernsMode(copts.usernsMode)\n\tif !usernsMode.Valid() {\n\t\treturn nil, errors.New(\"--userns: invalid USER mode\")\n\t}\n\n\tcgroupnsMode := container.CgroupnsMode(copts.cgroupnsMode)\n\tif !cgroupnsMode.Valid() {\n\t\treturn nil, errors.New(\"--cgroupns: invalid CGROUP mode\")\n\t}\n\n\trestartPolicy, err := opts.ParseRestartPolicy(copts.restartPolicy)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tloggingOpts, err := parseLoggingOpts(copts.loggingDriver, copts.loggingOpts.GetSlice())","sourceCodeStart":507,"sourceCodeEnd":543,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/container/opts.go#L507-L543","documentation":"Immediately after the PID-mode check, the --uts flag value is wrapped in container.UTSMode and validated. UTSMode only accepts an empty value (default: private UTS namespace) or \"host\" (share the host's hostname/domainname namespace); any other value fails Valid() and the CLI rejects it before container creation.","triggerScenarios":"`docker run --uts=<value>` with any value other than \"host\" or empty — e.g. `--uts=private`, `--uts=container:xyz` (not supported for UTS in the CLI), or a typo like `--uts=hsot`.","commonSituations":"Assuming --uts accepts `container:<id>` like --pid/--net do; carrying over `private` from other runtimes' syntax; typos of `host` in compose-generated or hand-written run commands.","solutions":["Use `--uts=host` to share the host UTS namespace, or omit the flag entirely for the default private namespace.","If you were trying to set the container hostname, use `--hostname=<name>` instead of --uts.","Fix typos in the flag value."],"exampleFix":"# before\ndocker run --uts=private --hostname=web myimage\n# after (private is the default; just set the hostname)\ndocker run --hostname=web myimage","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":["docker-cli","docker-run","uts-namespace","flag-validation"],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}