{"record":{"id":"ba8a348576a36d9d","repo":"GoogleContainerTools/skaffold","slug":"could-not-create-job-object-w","errorCode":null,"errorMessage":"could not create job object: %w","messagePattern":"could not create job object: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/kubectl/exec_windows.go","lineNumber":46,"sourceCode":")\n\n// Cmd represents an external command being prepared to run within a job object\ntype Cmd struct {\n\t*exec.Cmd\n\thandle windows.Handle\n\tctx    context.Context\n}\n\n// CommandContext creates a new Cmd\nfunc CommandContext(ctx context.Context, name string, arg ...string) *Cmd {\n\treturn &Cmd{Cmd: exec.CommandContext(ctx, name, arg...), ctx: ctx}\n}\n\n// Start starts the specified command in a job object but does not wait for it to complete\nfunc (c *Cmd) Start() error {\n\thandle, err := windows.CreateJobObject(nil, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not create job object: %w\", err)\n\t}\n\n\t// https://gist.github.com/hallazzang/76f3970bfc949831808bbebc8ca15209\n\tinfo := windows.JOBOBJECT_EXTENDED_LIMIT_INFORMATION{\n\t\tBasicLimitInformation: windows.JOBOBJECT_BASIC_LIMIT_INFORMATION{\n\t\t\tLimitFlags: windows.JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE,\n\t\t},\n\t}\n\tif _, err := windows.SetInformationJobObject(\n\t\thandle,\n\t\twindows.JobObjectExtendedLimitInformation,\n\t\tuintptr(unsafe.Pointer(&info)),\n\t\tuint32(unsafe.Sizeof(info))); err != nil {\n\t\treturn fmt.Errorf(\"could not set information job object: %w\", err)\n\t}\n\n\tif err := c.Cmd.Start(); err != nil {\n\t\treturn fmt.Errorf(\"could not start the command: %w\", err)","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/kubectl/exec_windows.go#L28-L64","documentation":"On Windows, Cmd.Start creates a Windows Job Object via windows.CreateJobObject so child processes can be killed as a group; this error wraps a failure to create that kernel job object. It means the OS refused the CreateJobObject call before the command was even started.","triggerScenarios":"windows.CreateJobObject(nil, nil) returns an error — typically due to Win32 API failure such as ERROR_ACCESS_DENIED in restricted environments, corrupted security settings, or resource exhaustion in the calling process.","commonSituations":"Running skaffold inside a hardened Windows sandbox/service with restricted token privileges, antivirus or endpoint software blocking job-object creation, running under restricted service accounts.","solutions":["Run the command from an elevated or less-restricted shell (normal user terminal rather than a restricted service context)","Check antivirus/EDP software logs and whitelist the executable","Update Windows/golang.org/x/sys/windows package to a current version","As a workaround, disable the process-group kill feature or run on a non-Windows environment"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := c.Start(); err != nil {\n    var pe *fs.PathError\n    if errors.As(err, &pe) {\n        return fmt.Errorf(\"job object create failed (%v); environment may restrict job objects\", err)\n    }\n    return err\n}","preventionTips":["Run long-lived process-group commands outside hardened service contexts when possible","Keep golang.org/x/sys/windows updated","Test k8s job streaming on the target Windows environment before production use","Whitelist the binary in AV/EDP software"],"tags":["windows","process","job-object"],"backgroundTag":"windows-job-object-creation-failed","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}