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

1030: The printer or class does not exist #30

Open
carstenblt opened this issue Feb 27, 2021 · 5 comments
Open

1030: The printer or class does not exist #30

carstenblt opened this issue Feb 27, 2021 · 5 comments

Comments

@carstenblt
Copy link

carstenblt commented Feb 27, 2021

I cannot get it to print - the printer shows up with getPrinters(), but trying to print a file with

conn.printFile(printer='L805', filename='myfile', title='mytitle' , options={})

results in

cups.IPPError: (1030, 'The printer or class does not exist.')

This is weird. If I supply a printer name that does not exist, I instead get a cups.IPPError: (1280, 'No such file or directory') instead.

I am sure there is some fault on my side, but I can't figure it out. Printing with lp -h myhost -d L805 somefile works as expected though.

Some more details: The CUPS server is in another subnet than the printer and client, connected through a VPN.

Pycups somehow wants to call the printer via its URI, which fails. First it queries the printer via its correct address, which succeeds, then the second request fails:

D [28/Feb/2021:15:48:47 +0000] [Client 48] 2.0 Get-Printer-Attributes 55
D [28/Feb/2021:15:48:47 +0000] Get-Printer-Attributes ipp://localhost:631/printers/L805
D [28/Feb/2021:15:48:47 +0000] [Client 48] Returning IPP successful-ok for Get-Printer-Attributes (ipp://localhost:631/printers/L805) from 192.168.1.206.
...
D [28/Feb/2021:15:48:47 +0000] [Client 48] 2.0 Get-Printer-Attributes 56
D [28/Feb/2021:15:48:47 +0000] Get-Printer-Attributes socket://epsonl805
D [28/Feb/2021:15:48:47 +0000] Get-Printer-Attributes client-error-not-found: The printer or class does not exist.
D [28/Feb/2021:15:48:47 +0000] [Client 48] Returning IPP client-error-not-found for Get-Printer-Attributes (socket://epsonl805) from 192.168.1.206.
@carstenblt
Copy link
Author

Even on the same subnet. lp ... works, pycups does not.

@hugho-ad
Copy link

Hello @carstenblt

I got the same error, and I make it work with

import cups
cups.setServer("host:port")
cups.Connection(host, port)

Currently, I don't why the above is necessary. hope it helps you out

@hugho-ad
Copy link

after several tests

the solution that work for me was

cups.setServer(host)
cups.setPort(port)
conn = cups.Connection(host, port)

see http://nagyak.eastron.hu/doc/system-config-printer-libs-1.2.4/pycups-1.9.51/html/cups.Connection-class.html

LoisRForgeFlow added a commit to ForgeFlow/report-print-send that referenced this issue Nov 16, 2021
Error code: 1030, 'The printer or class does not exist.')".
An explicit call to `setServer` and `setPort` fixed the issue.
(see OpenPrinting/pycups#30)

Also, added serve_id to printer views
LoisRForgeFlow added a commit to ForgeFlow/report-print-send that referenced this issue Nov 16, 2021
Error code: 1030, 'The printer or class does not exist.')".
An explicit call to `setServer` and `setPort` fixed the issue.
(see OpenPrinting/pycups#30)

Also, added serve_id to printer views
BT-dmontull pushed a commit to BT-dmontull/report-print-send that referenced this issue Mar 3, 2022
Error code: 1030, 'The printer or class does not exist.')".
An explicit call to `setServer` and `setPort` fixed the issue.
(see OpenPrinting/pycups#30)

Also, added serve_id to printer views
flachica pushed a commit to flachica/report-print-send that referenced this issue Oct 1, 2022
Error code: 1030, 'The printer or class does not exist.')".
An explicit call to `setServer` and `setPort` fixed the issue.
(see OpenPrinting/pycups#30)

Also, added serve_id to printer views
glitchov pushed a commit to acsone/report-print-send that referenced this issue Dec 7, 2022
Error code: 1030, 'The printer or class does not exist.')".
An explicit call to `setServer` and `setPort` fixed the issue.
(see OpenPrinting/pycups#30)

Also, added serve_id to printer views
@zdohnal
Copy link
Member

zdohnal commented Nov 16, 2023

Hi @hugho-ad ,

does the cups.Connection() work for you without the arguments? (I expect you connect to the local cupsd, not remote and you use default CUPS settings - port 631 and localhost).

I've tried the following code (based on examples/cupstree.py):

import cups
c = cups.Connection()
c.printFile(printer='test', filename='/etc/fstab', title='mytitle', options={})

and it worked.

@zdohnal
Copy link
Member

zdohnal commented Nov 16, 2023

In case you connect to remote CUPS:

import cups
cups.setServer(host)
c = cups.Connection()
c.printFile(printer='test', filename='/etc/fstab', title='mytitle', options={})

john-herholz-dt pushed a commit to DeineTuer-GmbH/OCA_report-print-send that referenced this issue Jan 17, 2024
Error code: 1030, 'The printer or class does not exist.')".
An explicit call to `setServer` and `setPort` fixed the issue.
(see OpenPrinting/pycups#30)

Also, added serve_id to printer views
john-herholz-dt pushed a commit to DeineTuer-GmbH/OCA_report-print-send that referenced this issue Mar 8, 2024
Error code: 1030, 'The printer or class does not exist.')".
An explicit call to `setServer` and `setPort` fixed the issue.
(see OpenPrinting/pycups#30)

Also, added serve_id to printer views
TobiasSorg pushed a commit to AmetrasIntelligence/report-print-send that referenced this issue Jun 18, 2024
trisdoan pushed a commit to trisdoan/report-print-send that referenced this issue Oct 3, 2024
Error code: 1030, 'The printer or class does not exist.')".
An explicit call to `setServer` and `setPort` fixed the issue.
(see OpenPrinting/pycups#30)

Also, added serve_id to printer views
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

3 participants