{"id":"0975a8579a75b135","repo":"docker/cli","slug":"env-file-w","errorCode":null,"errorMessage":"--env-file: %w","messagePattern":"--env-file: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/container/opts.go","lineNumber":509,"sourceCode":"\t\tif cdi.IsQualifiedName(device) {\n\t\t\tcdiDeviceNames = append(cdiDeviceNames, device)\n\t\t\tcontinue\n\t\t}\n\t\tvalidated, err := validateDevice(device, serverOS)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdeviceMapping, err := parseDevice(validated, serverOS)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdeviceMappings = append(deviceMappings, deviceMapping)\n\t}\n\n\t// collect all the environment variables for the container\n\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","sourceCodeStart":491,"sourceCodeEnd":527,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/container/opts.go#L491-L527","documentation":"Error \"--env-file: %w\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/container/opts.go:509 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}