Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CUPS and error dialogs



I was the original poster asking the question and I've exchanged a number of emails off line with Apple engineers to get to the bottom of how it works and what problems currently exist. I'll summarize my findings below from my perspective. I think Paul or someone else at Apple will be posting a followup to the list in the next week or so.

- CUPS strips the "ERROR" tag off of error strings before the queue proxy gets them. Thus, queue proxies will never get messages of the form "ERROR: My error message".

- Apple adds their own tags after ERROR to work around this. Thus, strings of the form "ERROR: fatal: My error string" should work. Apple also defines "recoverable" and :"recovered".

- Apple's recognition of "fatal" is broken. On my machine it does nothing. On a machine at Apple an error sheet bounces up and down repeatedly in the queue proxy. Apple is looking into this...

- "Recoverable" and "Recovered" work as advertised, with the exception of queue proxies apparently only look at the current status string every five seconds. Thus, if you post an error string and another string (e.g. an INFO string from the backend) overwrites it before the proxy updates, it's lost. Future versions of the OS will notice all error messages posted.

- From Apple: "The backends will add and remove entries to the "printer-state-reasons" array via "STATE: +needs-media" and "STATE: -needs-media" log entries. PrintCenter will use this to display "out of paper" and "cover open" type of messages (see rfc2911 for more info)." I have not looked at this yet.

- From Apple: "The cups model is if a backend exits non-zero it must be a printer problem so the queue is stopped (they try the initial connection forever). If a filter or driver exits non-zero it must be a job problem so the job is canceled and the next one starts. There's no current way of getting around this cupsd policy." This was the fist time I've seen this documented.

The final recommendation from Apple was to be creative with my usage of INFO and recoverable errors. To get recoverable errors to work right with the 5 second polling, I'll need to post them repeatedly and sleep, and then terminate my job when I get a SIGTERM. This seems to work okay for posting errors and having the error sheet display in the proxy. I have not had a lot of luck getting the error sheet to go away with the "recovered" message. The problem is you have no way of knowing when the sheet will go away and if you don't repeatedly post the recovered message someone else can overwrite it and it will get lost.

Dave


On Mar 26, 2004, at 8:25 AM, Bob Sander-Cederlof wrote:

Okay, I answered my own question. I may not have all the details correct, so if you see an error, please let me know.

Printing from a cups filter or backend to stderr has special effects, as it is processed by CUPS and by the PrinterProxy application.

(A PrinterProxy is created by the system when a printer is installed. It is named the same as the printer, and placed in ~/Library/Printers/ This is the app that runs the print job, and it monitors stderr messages by polling.

If you open this application, either from the Printer Setup Utility or by task switching, you will see that any message printed to stderr will, after a few seconds, appear in the dialog box above the progress bar.

If the message printed is of the form "ERROR: ...", the message is written to /var/cups/error_log. If several seconds pass before the job finishes or another message is printed, the same message but with "ERROR: " stripped off, will appear above the progress bar in the dialog box.

If the message printed is of the form "ERROR: recoverable: ...", the message is written to /var/cups/error_log, "ERROR: " If several seconds pass before the job finishes or another message is printed, the same message but with "ERROR: " stripped off, be picked up by the PrinterProxy. PrinterProxy will in turn strip off "recoverable: ", and the remainder of the message will be displayed in a sheet that drops down from the top of the dialog box. (If the PrinterProxy was not already opened, this will cause it to be opened.) The sheet gives options to Delete Job, Stop All Jobs, or Stop Job.

It is supposed to be possible to write messages of the form "ERROR: fatal: ..." also. But when I tried that the dropdown sheet kept dropping down, sliding up, dropping down, sliding up, endlessly. I had to terminate the task to get it to stop.


Earlier this month there was a thread about CUPS and error dialogs, but it was dropped with no satisfactory answer. The problem is, a printer may have a paper jam or run out of paper during printing. somehow, the user must be notified. Some printers are successful in doing so, but some of us writng new drivers have not been able to figure out how to make this happen.
Printing to stderr does not do it, all that does is add a line to the cups error_log.
So what is the secret?

--
= Bob Sander-Cederlof <email@hidden>, <email@hidden>
= On the web at <http://bobsc5.home.comcast.net>
= Macromedia, 1500 N. Greenville, Suite 500, Richardson, TX 75081
= Phone: (972) 664-7260 FAX: (972) 680-0537
_______________________________________________
printing mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/printing
Do not post admin requests to the list. They will be ignored.



---
The path of least resistance, it's not just for electricity any more.
_______________________________________________
printing mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/printing
Do not post admin requests to the list. They will be ignored.


References: 
 >CUPS and error dialogs (From: Bob Sander-Cederlof <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.