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

Cannot set temp queue as default destination if there is no permanent queue installed #833

Closed
zdohnal opened this issue Nov 24, 2023 · 6 comments
Assignees
Labels
bug Something isn't working priority-low
Milestone

Comments

@zdohnal
Copy link
Member

zdohnal commented Nov 24, 2023

CUPS 2.4.7, Fedora 38

$ lpstat -a
$ lpstat -e
test_linux
$ lpoptions -d test_linux
device-uri=ipps://test%20%40%20linux._ipps._tcp.local/cups printer-info='test @ linux' printer-make-and-model='PostScript Printer' printer-type=25178190
$ lpstat -d
no system default destination

It happens because because we use _cupsGetDests() in cupsSetDests2() for getting printers, but IPP_OP_GET_PRINTERS returns only permanent queues, thus cupsSetDests2() ends because it hits IPP_ERROR_NOT_FOUND.
I'm on the way with fix - I was able to set the default destination when I use cupsGetDests2() instead of _cupsGetDests(), but I was not able to remove the settings with lpoptions -x test_linux - I will look into it further.

@zdohnal zdohnal added bug Something isn't working investigating Investigating the issue labels Nov 24, 2023
@michaelrsweet
Copy link
Member

This is likely a timing issue, but I'd be interested in seeing what "lpstat -p" shows after running the lpoptions command. IPP_OP_CUPS_GET_PRINTERS (CUPS-Get-Printers) returns temporary queues that have been created with CUPS-Create-Local-Printer but haven't "expired"...

@michaelrsweet
Copy link
Member

@zdohnal Ping, just trying to close the loop on this...

@michaelrsweet michaelrsweet self-assigned this Apr 16, 2024
@michaelrsweet michaelrsweet added the waiting for reporter There are data requested from the reporter label Apr 16, 2024
@zdohnal
Copy link
Member Author

zdohnal commented Aug 14, 2024

I'm sorry for being late:

[root@default-0 tree]# lpstat -a
lpstat: No destinations added.
root@default-0 tree]# lpstat -e
test_default_0
[root@default-0 tree]# lpoptions -d test_default_0
device-uri=ipps://test%20%40%20default-0._ipps._tcp.local/cups printer-info='test @ default-0' printer-location printer-make-and-model='PostScript Printer' printer-type=25178190
[root@default-0 tree]# lpstat -d
no system default destination
[root@default-0 tree]# lpstat -p
lpstat: No destinations added.

CUPS 2.4.10

@zdohnal zdohnal reopened this Aug 14, 2024
@michaelrsweet
Copy link
Member

OK, so looking at the output - when you set lpoptions to set the default destination, the destination hasn't actually been added at all so there isn't a queue to back it. Seems like we should make sure the local queue exists before saving...

@michaelrsweet
Copy link
Member

Please try these fixes:

[master 85e977d] Add a temporary queue before setting the defaults for lpoptions (Issue #833)

[2.4.x 141153e] Add a temporary queue before setting the defaults for lpoptions (Issue #833)

@zdohnal
Copy link
Member Author

zdohnal commented Sep 23, 2024

It works (at least for 2.4.x, master encountered errors, probably related to CI failures on master pipeline), thanks!

@zdohnal zdohnal closed this as completed Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-low
Projects
None yet
Development

No branches or pull requests

2 participants