Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"+"s removed from device URIs. Causes, "client-error-not-possible". #208

Closed
Greatnessguru opened this issue Jan 17, 2021 · 36 comments
Closed

Comments

@Greatnessguru
Copy link

Bug: system-config-printer removes "+" from the device URI.
system-config-printer will not let me enter the missing "+", either.

Result when loading driver: "client-error-not-possible".
Not able to print anything with CUPS.

Impact: everything that needs a "+" in the device URI.
Example: gutenprint53+usb...

CUPS 2.2.10, system-config-printer 1.5.11.
Raspberry Pi OS current as of 15 JAN 2021.

$ lpinfo -v
... gutenprint53+usb://canon-cp800/G200081700003253 (Canon SELPHY CP800, USB cable)
... gutenprint53+usb://canon-cp1300/B620111123382351 (Canon SELPHY CP1300, USB cable)

Main RPi system menu > Preferences > Print Settings (system-config-printer)
... gutenprint53usb://canon-cp800/G200081700003253 (Missing "+" before "usb".)
... gutenprint53usb://canon-cp1300/B620111123382351 (Missing "+" before "usb".)

CUPS gui (localhost:631), USB cable

Description: Canon CP800
Location:
Driver: Canon SELPHY CP800 - CUPS+Gutenprint v5.3.1 (color)
Connection: gutenprint53+usb://canon-cp800/G200081700003253
Defaults: job-sheets=none, none media=jpn_hagaki_100x148mm sides=one-sided
(system-config-printer now shows same/correct device URI with "+".)
(Test prints: good.)

Description: Canon SELPHY CP1300
Location:
Driver: Canon SELPHY CP1300 - CUPS+Gutenprint v5.3.1 (color)
Connection: gutenprint53+usb://canon-cp1300/B620111123382351
Defaults: job-sheets=none, none media=jpn_hagaki_100x148mm sides=one-sided
(system-config-printer now shows same/correct device URI with "+".)
(Test print: good.)

@zdohnal
Copy link
Member

zdohnal commented Jan 19, 2021

Hi @Greatnessguru Eddie,

thank you for reporting this issue!

I personally don't have any gutenprint supported printer, would you mind testing a following patch?

--- a/newprinter.py
+++ b/newprinter.py
@@ -2941,7 +2941,7 @@ class NewPrinterGUI(GtkGUI):
             entry.set_text(new_text)
 
     def on_entNPTDevice_changed(self, ent):
-        allowed_chars = string.ascii_letters+string.digits+'_-./:%[]()@?=&'
+        allowed_chars = string.ascii_letters+string.digits+'_-./:%[]()@?=&+'
         self.entry_changed(ent, allowed_chars)
         self.setNPButtons()

You can just add the change to your newprinter.py you have installed - f.e. it is in /usr/share/system-config-printer dir in Fedora. I would make a backup of original newprinter.py before applying the patch and put it back after testing the patch.

I'm able to test if + is not removed if I enter the whole uri (it works with this patch), but I'm not sure if it is applied during device discovery in s-c-p (I would need a device for it).

Thank you in advance!

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 19, 2021 via email

@zdohnal
Copy link
Member

zdohnal commented Jan 19, 2021

@Greatnessguru IMO the easiest way for you would be to clone the repo and compile it by itself, because I don't have python3.7 here.
I pushed the change to branch called plus_in_uris.

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 19, 2021 via email

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 19, 2021 via email

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 19, 2021 via email

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 19, 2021 via email

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 19, 2021 via email

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 19, 2021 via email

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 19, 2021 via email

@zdohnal
Copy link
Member

zdohnal commented Jan 20, 2021

@Greatnessguru https links don't change regarding the branch you pulled - meaning 'plus_in_uris' branch is under the same link.

You can pull the remote branches this way (or any other google result of git how to get remote branches) after you cloned the repo or just apply the change on master branch, which is downloaded by default.

Then follow the steps in INSTALL file (the new system-config-printer will be installed in /usr/local, so it will overshadow your original s-c-p), test the change and uninstall the testing version by 'make uninstall'.

You will need some development packages for python3, cups and glib2, then packages containing intltool, automake, autoconf and xmlto. The actual package names can be different - it depends on your distro.

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 20, 2021 via email

@zdohnal
Copy link
Member

zdohnal commented Jan 21, 2021

$ git clone https://github.com/OpenPrinting/system-config-printer.git
$ cd system-config-printer
$ git fetch origin plus_in_uris
$ git checkout plus_in_uris

this way you get the correct branch via git.

Aha, I'm sorry about INSTALL file - it is generated after ./bootstrap step, so it is even missing in github and it is correct behavior - I was looking into my local git, where I had generated files...

So I updated README.md now with the correct steps for compilation and installation - README.md is the zip :) or you can read it here on github.

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 21, 2021 via email

@zdohnal
Copy link
Member

zdohnal commented Jan 21, 2021

Please read the README.md here or in the zip - intltool should be somewhere in the OS. It will not compile unless you install build dependencies.

Or report this bug for your OS and the package maintainer can provide you with updated package for testing.

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 21, 2021 via email

@zdohnal
Copy link
Member

zdohnal commented Jan 22, 2021

@Greatnessguru Now please read the README.md file, as I suggested before. Every project has some build dependencies, which need to be install before compiling.

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 22, 2021 via email

@zdohnal
Copy link
Member

zdohnal commented Jan 22, 2021

It is supplied by CUPS project, but it doesn't mean it is supplied in cups package. OS usually divides a project into several packages based on purpose of programs shipped in the package. The most common split during packaging is to separate files which are needed by common users, and which are needed by developers.
If you check the README.md file, you will know you need a development packages. It depends on your OS how those packages are called, you need to find that by yourself.

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 22, 2021 via email

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 22, 2021 via email

@zdohnal
Copy link
Member

zdohnal commented Jan 22, 2021

@Greatnessguru *-dev?

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 22, 2021 via email

@zdohnal
Copy link
Member

zdohnal commented Jan 22, 2021

@Greatnessguru no, I meant it as a hint for you how development packages look like in your (seems like some Ubuntu/Debian clone) OS. They have '-dev' as the suffix.

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 22, 2021 via email

@zdohnal
Copy link
Member

zdohnal commented Jan 22, 2021

pi@raspberrypi:~ $ apt list | grep cups WARNING: apt does not have a stable CLI interface. Use with caution in scripts. apcupsd-cgi/stable 3.14.14-2 armhf apcupsd-doc/stable 3.14.14-2 all apcupsd/stable 3.14.14-2 armhf bluez-cups-dbgsym/testing 5.50-1.2deb10u1+rpt2 armhf bluez-cups/testing 5.50-1.2deb10u1+rpt2 armhf cups-backend-bjnp/stable 2.0.1-1 armhf cups-browsed-dbgsym/testing 1.21.6-5+rpt1 armhf cups-browsed/testing,now 1.21.6-5+rpt1 armhf [installed,automatic] cups-bsd/stable 2.2.10-6+deb10u4 armhf cups-client/stable,now 2.2.10-6+deb10u4 armhf [installed,automatic] cups-common/stable,now 2.2.10-6+deb10u4 all [installed,automatic] cups-core-drivers/stable,now 2.2.10-6+deb10u4 armhf [installed,automatic] cups-daemon/stable,now 2.2.10-6+deb10u4 armhf [installed,automatic] cups-filters-core-drivers-dbgsym/testing 1.21.6-5+rpt1 armhf cups-filters-core-drivers/testing,now 1.21.6-5+rpt1 armhf [installed,automatic] cups-filters-dbgsym/testing 1.21.6-5+rpt1 armhf cups-filters/testing,now 1.21.6-5+rpt1 armhf [installed,automatic] cups-ipp-utils/stable,now 2.2.10-6+deb10u4 armhf [installed,automatic] cups-pk-helper-dbgsym/testing 0.2.6-1+rpi1 armhf cups-pk-helper/testing,now 0.2.6-1+rpi1 armhf [installed,automatic] cups-ppdc/stable,now 2.2.10-6+deb10u4 armhf [installed,automatic] cups-server-common/stable,now 2.2.10-6+deb10u4 all [installed,automatic] cups-tea4cups/stable 3.14~alpha0+svn3576-1 all cups-x2go/stable 3.0.1.4-1 all cups/stable,now 2.2.10-6+deb10u4 armhf [installed,automatic] gnuspool-cupspy/stable 1.7 all

-> libcups2-dev/stable 2.2.10-6+deb10u4 armhf

libcups2/stable,now 2.2.10-6+deb10u4 armhf [installed,automatic] libcupsfilters-dev/testing 1.21.6-5+rpt1 armhf libcupsfilters1-dbgsym/testing 1.21.6-5+rpt1 armhf libcupsfilters1/testing,now 1.21.6-5+rpt1 armhf [installed,automatic] libcupsimage2-dev/stable 2.2.10-6+deb10u4 armhf libcupsimage2/stable,now 2.2.10-6+deb10u4 armhf [installed,automatic] libnet-cups-perl/stable 0.64-1+b1 armhf printer-driver-cups-pdf/stable 3.0.1-5+b14 armhf printer-driver-hpcups/stable,now 3.18.12+dfsg0-2+b2 armhf [installed,automatic] python-cups/stable 1.9.73-2+b1 armhf python3-cups/stable,now 1.9.73-2+b1 armhf [installed,automatic] python3-cupshelpers/stable,now 1.5.11-4 all [installed,automatic] pi@raspberrypi:~ $

On Fri, Jan 22, 2021 at 12:42 AM Eddie Maddox @.> wrote: Reading through the CUPS package names, nothing identifies itself as being for developing. On Fri, Jan 22, 2021 at 12:33 AM zdohnal @.> wrote: > > It is supplied by CUPS project, but it doesn't mean it is supplied in cups package. OS usually divides a project into several packages based on purpose of programs shipped in the package. The most common split during packaging is to separate files which are needed by common users, and which are needed by developers. > If you check the README.md file, you will know you need a development packages. It depends on your OS how those packages are called, you need to find that by yourself. > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub, or unsubscribe. -- Thank you, Eddie Maddox @.*** Greatness: "Find a way to serve the many.", Jim Rohn, based on the Bible.
-- Thank you, Eddie Maddox greatnessguru@gmail.com Greatness: "Find a way to serve the many.", Jim Rohn, based on the Bible.

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 22, 2021 via email

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 22, 2021 via email

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 23, 2021 via email

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 23, 2021 via email

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 24, 2021 via email

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 24, 2021 via email

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 25, 2021 via email

@Greatnessguru
Copy link
Author

Greatnessguru commented Jan 25, 2021 via email

@zdohnal
Copy link
Member

zdohnal commented Jan 25, 2021

Thank you for testing it - it confirms it works with the real device, I'll commit the fix.

My weekly software maintainance:
pi@raspberrypi:~ $ sudo apt update
pi@raspberrypi:~ $ sudo apt full-upgrade
pi@raspberrypi:~ $ sudo apt autoremove
pi@raspberrypi:~ $ sudo apt clean

Don't do any software maintenance if you have testing stuff on your PC unless you know what are you doing. You removed all runtime dependencies of system-config-printer, that's the reason for the errors you got.

Please remove the testing system-config-printer, install the s-c-p from Raspberry OS (it will have the bug, but you can do your sw maintenance at your will) and report the issue to Raspberry OS to let them know to update their packaged system-config-printer with the fix from here.

@zdohnal
Copy link
Member

zdohnal commented Jan 25, 2021

Fixed with commit 1afdab2

@zdohnal zdohnal closed this as completed Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants