What does Windows error code 3004 (ERROR_SPL_NO_ADDJOB) mean?

 
Previous Next
ERROR_SPL_NO_STARTDOC ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED

ERROR_SPL_NO_ADDJOB

The print job was not prepared by AddJob.

ERROR_SPL_NO_ADDJOB is Win32 error 3004 (0xBBC). The direct spool-file workflow is ordered: AddJob creates a job and returns a spool-file path and job identifier; the caller writes the data; ScheduleJob then submits that exact job. Calling the scheduling step without a successful matching AddJob violates the spooler state machine.

How the sequence is broken

  • AddJob failed, but code continued with an uninitialized or previous job identifier
  • the job ID belongs to another printer handle, queue, process path, or completed attempt
  • exception or cancellation cleanup discarded the AddJob state before scheduling
  • parallel print submissions mix job identifiers and spool paths
  • application code incorrectly substitutes StartDocPrinter for the AddJob/ScheduleJob contract

Print-lifecycle evidence

Log the printer name, printer-handle correlation ID, AddJob result, returned job ID and bounded spool path, file-open/write/flush/close results, ScheduleJob arguments, thread, datatype, and cleanup decisions. Do not log document data; retain a content hash or job correlation ID when needed.

Diagnostic sequence

Trace one job from OpenPrinter through successful AddJob, spool-file creation and closure, then ScheduleJob using the same queue and ID. Ensure no scheduling occurs when any earlier stage fails.

Compare the chosen print API family. The AddJob path is distinct from StartDocPrinter/WritePrinter/EndDocPrinter. Mixing state from both models can produce a valid-looking ID that is not schedulable under the current handle.

Recovery and implementation rules

Discard the invalid attempt, call AddJob again, write and close the new spool file, and schedule the returned ID once. Delete only temporary state owned by the failed attempt.

Represent each direct spool submission as a noncopyable state object with explicit Created, Written, Closed, Scheduled, and Aborted transitions. Serialize access to its job ID and never reuse IDs across retries.

Difference from ERROR_SPL_NO_STARTDOC

ERROR_SPL_NO_STARTDOC belongs to the StartDocPrinter document lifecycle. Error 3004 belongs specifically to the separate AddJob/ScheduleJob spool-file workflow.

Example

A print service calls AddJob, but a disk-full error prevents spool-file creation. Its generic finally block still invokes ScheduleJob with the previous job ID and receives 3004. Gating scheduling on the successful current AddJob state fixes the defect.

References


Looking for a different code? Search another status or error code.