[cups] CUPS sometimes losing jobs upon restart

Johannes Meixner jsmeix at suse.de
Tue Aug 25 04:39:31 PDT 2015


Hello,

On Aug 24 12:46 Nick Hall wrote (excerpt):
> In our typical day we print orders with CUPS every few minutes,
> but at 5pm the printer gets shut off ...

What exactly do you mean with "the printer gets shut off"?
Is the printer device simply switched off?

> ... but orders continue to come in and are printed.
> These orders queue up in CUPS until the printer is turned
> back on around 7am, at which point all the orders that
> came in overnight are printed.
>
> CUPS is reloaded every morning at 6:35am by logrotate.
>
> For most jobs this process works totally fine. But we have
> noticed that every few days, CUPS loses a job. The job it loses
> appears to be the first job that was printed after the printer
> was turned off at 5pm, so the first job in a queue of
> perhaps 100 jobs.
>
> Here is some output from error_log for an example job:
>
> This was the first job printed after the printer was turned off:
> I [07/Aug/2015:17:24:36 -0500] [Job 498606] Adding start banner page "none".
>
> Now jobs continue to print and are queued up as CUPS cannot talk to the
> printer since it is up.
>
> The next day, logrotate reloads CUPS:
>
> D [08/Aug/2015:06:36:28 -0500] [Job 498606] Loading from cache...
> I [08/Aug/2015:06:36:28 -0500] [Job 498606] Data files have gone away!
> E [08/Aug/2015:06:36:28 -0500] Bad File number 1 on line 88798!
> D [08/Aug/2015:06:36:28 -0500] [Job 498606] Loading attributes...
> E [08/Aug/2015:06:36:37 -0500] [Job 498606] Aborting job because it has no
> files.

I guess that the following may have happened:

I guess that what you think is "the first job after the printer
was turned off" is actually a job that is already active while
the printer is turned off.

I mean that for this job the data transfer into the printer is
going on and is completed just before the printer is turned off.

For the cupsd a print job is completed when the data transfer into
the printer has finished (more precisely when the CUPS backend has
exited with zero exit code) and then cupsd removes the print job from
the queue which means it removes by default the print job data file.


Kind Regards
Johannes Meixner
-- 
SUSE LINUX GmbH - GF: Felix Imendoerffer, Jane Smithard,
Graham Norton - HRB 21284 (AG Nuernberg)




More information about the cups mailing list