{"record":{"id":"8888dced52030d04","repo":"windmill-labs/windmill","slug":"setinformationjobobject-e","errorCode":null,"errorMessage":"SetInformationJobObject: {e}","messagePattern":"SetInformationJobObject: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/windmill-worker/src/common.rs","lineNumber":894,"sourceCode":"\n        let mut info = JOBOBJECT_EXTENDED_LIMIT_INFORMATION::default();\n        if kill_on_close {\n            info.BasicLimitInformation.LimitFlags |= JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;\n        }\n        if let Some(memory_limit) = memory_limit {\n            info.BasicLimitInformation.LimitFlags |= JOB_OBJECT_LIMIT_JOB_MEMORY;\n            info.JobMemoryLimit = memory_limit;\n        }\n\n        SetInformationJobObject(\n            job,\n            JobObjectExtendedLimitInformation,\n            &info as *const _ as _,\n            std::mem::size_of::<JOBOBJECT_EXTENDED_LIMIT_INFORMATION>() as u32,\n        )\n        .map_err(|e| {\n            let _ = windows::Win32::Foundation::CloseHandle(job);\n            std::io::Error::new(\n                std::io::ErrorKind::Other,\n                format!(\"SetInformationJobObject: {e}\"),\n            )\n        })?;\n\n        let process_handle = OpenProcess(PROCESS_SET_QUOTA | PROCESS_TERMINATE, false, pid)\n            .map_err(|e| {\n                let _ = windows::Win32::Foundation::CloseHandle(job);\n                std::io::Error::new(\n                    std::io::ErrorKind::Other,\n                    format!(\"OpenProcess({pid}): {e}\"),\n                )\n            })?;\n\n        let assign_result = AssignProcessToJobObject(job, process_handle);\n        let _ = windows::Win32::Foundation::CloseHandle(process_handle);\n        assign_result.map_err(|e| {\n            let _ = windows::Win32::Foundation::CloseHandle(job);","sourceCodeStart":876,"sourceCodeEnd":912,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/windmill-worker/src/common.rs#L876-L912","documentation":"After creating a Windows Job object, assign_job_object configures its limits (memory limits, and JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE when requested) via SetInformationJobObject. If that call fails, the job handle is closed and an io::Error with this message is returned.","triggerScenarios":"assign_job_object on Windows with JOBOBJECT_EXTENDED_LIMIT_INFORMATION that the OS rejects — e.g. requesting limit flags unsupported by the Windows edition (memory limits in certain containers/sessions) or invalid limit structure.","commonSituations":"Running inside nested job objects/containers where extended limit information is restricted; old or stripped Windows editions; misaligned struct size when the windows crate version mismatches the OS expectations.","solutions":["Read the Win32 error code in the message; ERROR_ACCESS_DENIED usually means a sandbox disallows the requested limits.","Drop the JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE / memory-limit flags if the environment forbids them, or run the worker outside the restricted container.","Update the `windows` crate; struct layout mismatches can cause the call to be rejected.","Retry the job; if consistent, it is environmental rather than transient."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-check not exposed; confirm the deployment OS supports JOBOBJECT_EXTENDED_LIMIT_INFORMATION (Windows with full job object support) and the worker is not inside a restricting sandbox.","typeGuard":null,"tryCatchPattern":"match assign_job_object(pid, true) {\n    Err(e) if e.to_string().contains(\"SetInformationJobObject\") => {\n        log::error!(\"job limits rejected by OS/environment: {e}; falling back to plain child\");\n        // degrade: spawn without job object, track pid for manual kill\n    }\n    other => other?,\n}","preventionTips":["Deploy workers outside nested-job containers when possible","Keep the `windows` crate version current to avoid struct-layout mismatches","Avoid security policies that strip job object limit rights"],"tags":["windows","win32","job-object","worker"],"backgroundTag":"win32-api-call-failed","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}