| Previous | Next |
| ERROR_CONTAINER_ASSIGNED | ERROR_INVALID_TASK_NAME |
ERROR_JOB_NO_CONTAINER
The specified job object has no container association.
ERROR_JOB_NO_CONTAINER is Win32 error 1505 (0x5E1). The job handle may be valid and may already contain processes, limits, or accounting information, yet it lacks the container state required by the requested operation. An ordinary job object is not automatically a container. The caller must establish the association through the subsystem that owns container creation before using container-specific functions.
Why the expected association is missing
- the code created a normal job but skipped the container initialization stage
- a failure path continued after container setup returned an earlier error
- the wrong named job or stale handle was selected
- teardown removed the container while queued work still referenced the job
- a process job was confused with the separate job used by the container broker
Required telemetry
Record the job’s creation path and name, handle access rights, owning service, expected container ID, initialization state machine, process list, and the exact container-specific operation. Include earlier errors from the same transaction. A single 1505 often reflects an ignored setup failure several calls before the visible operation.
Diagnostic method
Follow the job from creation through association and process launch. Verify that the code checks every return value and publishes the job to workers only after container setup commits. Compare stable identifiers rather than raw handles when multiple jobs exist. Inspect whether teardown can race with asynchronous requests.
Use public job-object queries for limits and membership, but do not infer container presence solely from those ordinary properties. The API or service returning 1505 is the authoritative source for the missing association. If public documentation does not expose the container state, keep the diagnosis at the lifecycle boundary instead of manipulating undocumented information classes.
Recovery and design
Abort the container-specific operation, complete supported container initialization, and retry only when the job has reached a committed ready state. If the job belongs to another lifecycle, select the correct one or create a new instance. Gate worker access with explicit state and generation numbers so operations queued for an old container cannot run after teardown.
Related container error
ERROR_CONTAINER_ASSIGNED reports the opposite state: association already exists when another assignment is attempted. Error 1505 means association is absent when required. Together they usually reveal a non-idempotent initialization or cleanup state machine.
Example
A host creates two jobs: one for resource accounting and one for an isolated workload. A lookup bug passes the accounting job to a container operation and receives 1505. Storing the container ID beside the correct job object and validating it before dispatch prevents the mix-up.
References
- Microsoft: System Error Codes (1300–1699)
- Microsoft: Job Objects
- Microsoft: AssignProcessToJobObject
Looking for a different code? Search another status or error code.
