OpenPrinting / system-config-printer

Graphical user interface for CUPS administration
GNU General Public License v2.0
160 stars 88 forks source link

Error pop-up: Option 'finishings' has value '3' and cannot be edited #122

Closed tillkamppeter closed 4 years ago

tillkamppeter commented 5 years ago

The following bug report appeared at Ubuntu:

https://bugs.launchpad.net/ubuntu/+source/system-config-printer/+bug/1780310

For some IPP printers appears an error pop-up with the message mentioned above (or similar message) when opening the printer properties dialog. It does not come to anything going wrong afterwards. There is only this dialog annoying the user with a message he does not understand. A simple symptomatic fix would be to turn this error dialog into a debug message which appears in the terminal when running s-c-p with the --debug option. This should also be done when the actual cause of the bug gets fixed. An actual fix would be to check s-c-p's compatibility with modern driverless IPP printers, for example supporting correctly all the attributes reported on a get-printer-attributes IPP request (IPP 2.x) and also taking into account that the options for driverless printing reported by IPP are NOT identical with the options in PPD files, even if the file is supplied by the printer's manufacturer.

zdohnal commented 5 years ago

Hi Till, I'm sorry, I am unable to reproduce the issue - I have old HP Officejet Pro 8500 at the office (even older HP printer at home...), which provides only 'finishings-supported' and 'finishing-default' attributes, both set to number 3, which is 'None'. I even tried to push forcefully different values of attributes or push only 'finishing' attribute into dictionary, which is gotten from getPrinterAttributes() method (defined in python-cups project), but without triggering the error message. I tried to open 'Printer properities' - which got into scope, where the error message can show - and 'View printer queue' - which the reporter said he used, at least IIUC.

@tillkamppeter , are you able to reproduce the issue? Then we can see the variables contents during debugging...

From what I see from code: attributes seems to be taken from printer by getPrinterAttributes() (even IPP 2.* ones), then got processed in cupshelpers/cupshelpers.py and divided into possible_attributes and other_attributes and in several object attributes. I thought this can be outcome of 'finishings' isn't in correct dictionary, but it seems it doesn't trigger the message too.

petersilva commented 5 years ago

I´m on ubuntu 18.04 printing to a ricoh network printer, and I see this problem.

zdohnal commented 5 years ago

@petersilva Would you mind debugging the issue then? Since I'm not able to reproduce it with my printer.

merlijn-sebrechts commented 5 years ago

I'm having the same issue, I can help debugging if you tell me what to do.

zdohnal commented 5 years ago

@galgalesh Thank you! I don't know which debugger you use - I use pudb - https://documen.tician.de/pudb/starting.html . For start I would like to see what is in 'attrs' variable in getAttributes() method in cupshelpers/cupshelpers.py (line 118) after calling getPrinterAttributes() and contents of self.other_attributes and self.possible_attributes at the end of getAttributes() method. Then from printerproperities.py (about lines 1399) I would like to see contents of 'option' variable, when option.name is 'finishings', self.printer.attributes and self.printer.possible_attributes. If you would like more info how to do it, feel free to ask. Thank you!

merlijn-sebrechts commented 5 years ago

@zdohnal

I can see the value of these variables, but they are very big so they are cropped in the pudb UI. Is there an easy way for me to copy the full contents to clipboard or display it elsewhere?

image

zdohnal commented 5 years ago

Sorry, I don't know - but you can try to print out in python console in pudb UI and copy it from there (or use python commands to get variable contents) into some files, which you can attach here (they need to have .txt suffix to attach it here on github). I'm sorry for the inconvenience, and thank you again for helping me debugging!

merlijn-sebrechts commented 5 years ago

I did it with good-old print statements in the end. This didn't work for the options variable though, so I added screenshots of the vscode debugger for those. I have two printers that trow errors.

(note that the issue with "finishings" is in the second printer, the first printer has two other but similar errors.)

Printer 1: a driverless printer that was automatically added

Logs: https://pastebin.com/ghyi2Kw6 Errors: image

image

Value of option in debugger for orientation-requested:

image

Value of option in debugger for print-quality:

image

Printer 2: a Ricoh Secure print queue configured with the ppd file supplied by ricoh

Logs: https://pastebin.com/mL8bWze6 Errors: image

image

merlijn-sebrechts commented 5 years ago

@zdohnal Did you manage to take a look at this yet?

zdohnal commented 5 years ago

@galgalesh Sorry, not yet, other urgent issues on the plate... :(

tillkamppeter commented 5 years ago

See also this Ubuntu bug report: https://bugs.launchpad.net/ubuntu/+source/system-config-printer/+bug/1766107

zdohnal commented 5 years ago

I did a temporary fix for now as you suggested, please check commit 04ddf2fba0 . Hope, I'll get into more permanent solution in the future.

tillkamppeter commented 5 years ago

Thank you very much for this temporary fix. I have applied it to the system-config-printer package of Ubuntu 19.04 (Disco) now.

PorkCharsui79 commented 5 years ago

I get the same error. Linux Mint 19 Tara system-config-printer=1.5.11-1ubuntu2 (from ubuntu bionic repo) The temporary workaround from commit 04ddf2f does get rid of the error message, but the setting remains unset.

prlw1 commented 5 years ago

Reached this bug as once again it was reproduced (ubuntu). (Remove label?)

zdohnal commented 5 years ago

(Remove label?)

The label is there because 'I' as upstream cannot reproduce it, because I do not have HW for it. IMO the label is correct, because I can only study logs of @galgalesh , who was so kind to provide debugging logs. To sum it up, it makes its fixing harder, because I cannot test it immediately....

zdohnal commented 4 years ago

Temporary fixed in 1.5.12.