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
cups-browsed 1.24.0 does not create local queues for remote cups queues (cups-1.4.2) #124
Comments
|
@deepak0405 can you have a look into this? Thanks. |
|
I am trying to reproduce the errors.
https://github.com/steveathon/cups/blob/master/test/get-printer-attributes-2.0.test |
The uri is uri of print queue on server, uri to device itself is different (socket://printer_ip:9100) - and client machine, server and printer are all in different subnets. |
|
@zdohnal, the CUPS server server_hostname is not answering the standard get-printer-attributes IPP request, according to your ipptool_output.txt. As CUPS is supposed to fully conform to IPP 2.x this is not expected. |
|
@tillkamppeter Ad cups version - please see issue subject, I explicitly defined version there - and yes, because it is old CUPS, it runs only IPP 1.x. |
|
@deepak0405, perhaps we should re-introduce the old clustering method for legacy server support. Not having this especially defeats the support for legacy CUPS browsing (as a client).
WDYT? How should we implement the legacy printer (IPP 1.x + CUPS browsing) support? |
|
@zdohnal, as your servers have such an old CUPS (1.4.x), are you using cups-browsed's feature to create local queues based on legacy CUPS browsing (the feature Tim Waugh had added near the beginning of cups-browsed development in 2013)? |
|
@tillkamppeter ad first question - AFAIK yes, cups-browsed is set to find remote shared printers by dnssd protocol and CUPS legacy protocol. |
|
Footnote: |
|
@tillkamppeter I think the method suggested by Till is the best way to solve the issue. The new Clustering code does IPP requests three times:
Will we be able to do the last two mentioned IPP request for the legacy printer ? Implementing a function to get printer attributes from ppd will be a difficult task. We will have to parse the ppd file and after parsing we may have to convert the ppd data into different form for eg. There is a function to convert the second format to the first one, but I am not aware of a function for the reverse work. We can do one of these two things here:
IMO, the second one will be easier. |
|
@zdohnal, the implicitclass backend is needed for clustering and it is easier to handle when a single printer also uses implicitclass instead of changing when a second printer gets added or all but one printers of a cluster disappear. See also the |
|
@deepak0405, CUPS started with DNS-SD printer advertising only in 1.3.x but it does not change anything for us here as @zdohnal has CUPS 1.4.x on his servers. But having CUPS 1.4.x already doing IPP 2.x but not answering a get-printer-attributes IPP request properly looks like a bug in this old CUPS for me. @deepak0405 could you have a look into the IPP specs whether the IPP 2.0.x/2.1.x conformance is enough for the get-printer-attributes IPP response we expect? |
|
@tillkamppeter |
|
@deepak0405, perhaps we need to work with a fallback. First, we do, as before, our get-printer-attributes request with "all" and "media-col-database", if we get a failure or broken data, we get into the fallback, which is the same get-printer-attributes request but only with "all" and no "media-col-database". This can even in addition to support for old printers/CUPS queues solve the Canon printer problem of issue #22 (or apple/cups#5512). |
|
Hi @deepak0405 ! |
|
Thanks, @zdohnal, this looks like that the fallback as I described in my previous comment would work with this output, as the output lists the available paper sizes ("media-supported") and input PDLs ("document-format-supported") which is the minimum information for generating a valid PPD file, but it has also some point where it is not consistent, as under "job-settable-attributes-supported" the attributes "print-quality" and "printer-resolution" are listed and there are no "print-quality-supported" and "printer-resolution-supported" entries telling about valid choices. This is possibly a bug in the CUPS running on the server. |
|
@tillkamppeter I checked clean CUPS 1.4.2 which Mike provided at that time and current upstream master - actually those two missing attrs were only in requested attributes field at that time and they were missing from load_ppd() function, where they are handled now in current upstream. So they are missing in the request because server did not take them from ppd file and was not meant to do it at that time... |
|
@zdohnal, the missing "print-quality-supported" and "printer-resolution-supported" (or generally missing "...-supported" if "..." is listed in "job-settable-attributes-supported") I consider a bug and not a feature addition as it breaks IPP standard compliance, so being legitimate to fix this in an already released distribution, but it is not a security bug or otherwise very severe. You could ask your release team whether they would accept the backport of the fix to this bug as it improves user experience a lot when modern clients (new OS versions, mobile devices) access printers on RHEL servers. |
|
@deepak0405 Sure thing, I'll test it right away. Thank you for the patch! |
|
@deepak0405 I cherry-picked your two commits, applied on 1.24.0 and tried it in Fedora rawhide. Unfortunately, there are no local queues. I'll send the logs on Monday. |
|
@zdohnal, thank you very much. I have already found a bug in the patch which renders the fallback completely non-functional. Please see my comment on the pull request. You could try again with this bug corrected. |
|
@tillkamppeter now I see - the fallback is very good idea, but it is unfortunate it is not set to 1 in any call of get_printer_attributes() :) |
|
@zdohnal, in calls outside of get_printer_attributes() outside get_printer_attributes() itself the fallback mode is always set to 0 so that get_printer_attributes() does the standard ("all" + "media-col-database") first. If this fails, get_printer_attributes() calls itself with 1 as fallback mode, so that then the attempt with only "all" is initiated. |
|
I'm sorry, I have not tested it yet - just arrived into the office. I'll post an update around the noon. |
|
@tillkamppeter Actually I do not see any comment on pull request, so I looked into the code and IMO there is the other issue - when you call get_printer_attributes(uri, 1), you do not store the return value, so the output of get_printer_attributes is still NULL from previous call. |
|
@zdohnal, take deepak's repo on which he has created this pull request. There edit line 6659 in the file with Now use the freshly built cups-browsed, either by terminating any other cups-browsed instance and then running |
|
@zdohnal Please also upload the ppd file, if it is generated. |
|
I'm sorry, tried pure deepak's version, but still no created queues - here is the log |
|
@zdohnal, could you do the get-ipp-attributes requests with only the "all" attribute using ipptool (copy file Especially I need the results for |
|
It seems that CUPS 1.4.2 on your VM is generally not accessible for a remote machine. Have you checked cupsd.conf on your VM whether all settings are correct? |
|
@deepak0405, also note that I am assuming that your VM's host name is "ubuntu", following your examples. If it is not the case or needs something extra, like "ubuntu.local", please substitute the "ubuntu" in my examples for whatever is correct as a host name or IP for your VM. |
|
On my vm I am running cups in a different directory, i.e. I used |
|
With ip-address, one of the command works but this one doesn't |
|
Installing into an alternative directory on the VM is no problem as long as you do not have the original CUPS running in parallel. |
|
The error message of Unfortunately, both steps have the same error message if they fail, so only modifying this piece of code (on the client) can tell you where it exactly fails. But for me it looks like that it is the second one, because the |
|
I am able to do The In case of @logTom, we are getting the error IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED and thus we are doing a fallback IPP1.1 request, while in case of @zdohnal, the ipp_status is null( but it should not be) and no data is returned by the printer. But if we do a request without media-col-database, the printer returns the required info. @zdohnal Please try this dummy branch, for my case I was able to create a cups queue with sufficient printer info. @zdohnal I am not quite sure whether the printing will work after it, as it is not working for @logTom, but I think this PR should be able to generate ppd files and job should also be sent. @tillkamppeter If this branch works, we can follow this strategy : @tillkamppeter @zdohnal I don't think there is need to revert back to previous code of downloading a ppd file for legacy printer, as in case of @zdohnal and @logTom, we get sufficient output for get-printer-attributes request. |
|
@deepak0405, OK, let us go this way. |
|
@deepak0405 The print queues are now visible. Thank you, Deepak! Although it takes about 20-30s to 1st print queue to show up now. Regarding printing, the job ends with error: implicitclass://BRQ-TPBC-1D124-North/: Unable to create job - No such file or directory. Retrying. |
|
Sorry for the late response, I was not well the last week. I tried reproducing the error, but the printing is working for my setup. Can you please attach the error logs ? |
|
@deepak0405 No problem, Deepak. I hope you feel better. Here are logs for the job |
|
This issues has become too long. @zdohnal, can you please create a new one, and reference it here? |
|
@tillkamppeter This PR #173 contains the complete implementation of the fallback logic. I hope after this PR, we can close this issue, since queues will be generated for all the cases. But the issue for printing will still remain open, and I am currently working on it. @zdohnal @logTom Can you please verify this PR ? Also Can you please attach the |
|
@deepak0405 Yeah, I tested it. But, in my case the queues seem to be fixed already before the pr. Printing still doesn't work. I guess you only need the logs if it still doesn't work for zdohnal. |
|
@logTom, as printing does not work for you and this PR is about making printing work, we need also your logs. Can you please attach them? Both the CUPS error_log and the cups-browsed_log? |
|
@deepak0405 Ok, I'll test it on clean cups-filters without your dummy branch. I hope I'll manage it today, but tomorrow is more possible. |
|
@deepak0405 Ok, I can see the first print queue now after 1m 20s - cups-browsed 1.22.5 was able to found and create the first queue in 3s. The printing still does not work, as you expected. |
|
@zdohnal 1m is too much time, let me see why its taking this much. For your case we will be doing the request thrice
I was expecting some delay, but not this much. Can you please attach the cups_browsed-error-log. |
|
@zdohnal, please also attach the cups-browsed_log. |
|
@tillkamppeter @deepak0405 Here you are |
|
Note: I stopped the service after the first queue came up, so the log should be more relevant than log of whole process. |
|
I have fixed several bugs in cups-filters now. Could you try the newest GIT snapshot? Note that there is no workaround for a Poppler segfault on the server (as you mention in issue #163). |
|
To solve issue #181 I have done several fixes and improvements on the implicitclass backend. Please re-test to see whether this also solves this bug. |
|
@logTom, @zdohnal, I have now restructured the get_printer_attributes() function of cups-browsed and moved it into libcupsfilters, to share it with the driverless utility (commit 20c4773). |
|
@tillkamppeter I'm able to print with cups-filters-1.26.0 after fixing poppler. When I set: the first queue of 124 queues appeared after 55s - here is the cups-browsed_log It is better than previous interval though, but I'm not sure if it is expected. |
|
This means that this issue is fixed. The slowness of queue creation needs to get investigated, a near-future feature request. |
|
@zdohnal, what makes it take 55 seconds before the first queue is created is the fact that all your 124 printers are BrowsePolled from one server, so they are discovered in one single event response (timeout event to trigger a BrowsePoll on a given server) and in this single event response all entries for the local queues are generated in cups-browsed's internal data structure. For queues to be created, the current event response must terminate, so that another one (the queue creation, triggered by the earliest timeout in the printer entries) can start. So what has to be improved is that also BrowsePoll event responses can be split in smaller portions, like we already do with the CUPS queue update event response. |
|
@tillkamppeter Ok, I'll open the new issue for it to track it. Thank you for explanation and fixing the issue! |

Hi!
I tested the newest release - 1.24.0 - in our company environment, where print server is served by cups-1.4.2, and local queues are not created anymore. Here are the logs
cups-browsed-log.txt .
From logs - it seems some of remote queues did not pass get-printer-attributes request at cups-browsed.c:6793 , thougn the last cups error is 'Success':
Jun 04 03:29:31 host-client-ip cups-browsed[2420]: Tue Jun 4 03:29:31 2019 Request for IPP attributes (get-printer-attributes) for printer with URI ipp://server_hostname:631/printers/brno4-tpbc-0th-north failed: Success
Jun 04 03:29:31 host-client-ip cups-browsed[2420]: Tue Jun 4 03:29:31 2019 get-printer-attributes IPP call failed on printer brno4-tpbc-0th-north (ipp://server_hostname:631/printers/brno4-tpbc-0th-north).
But what is interesting, some remote print queues passed that (or missed that request) and tried to load PPD, but with no luck:
Jun 04 03:29:33 host-client-ip cups-browsed[2420]: Tue Jun 4 03:29:33 2019 Failed reading file /var/cache/cups/cups-browsed-options-brno1-0th-cafe, probably no options recorded yet
Jun 04 03:29:33 host-client-ip cups-browsed[2420]: Tue Jun 4 03:29:33 2019 Print queue brno1-0th-cafe is for remote CUPS queue(s) and we get notifications from CUPS, using implicit class device URI implicitclass://brno1-0th-cafe/
Jun 04 03:29:33 host-client-ip cups-browsed[2420]: Tue Jun 4 03:29:33 2019 Unable to create PPD file: No such file or directory
IMO This two errors are connected - errno is not cleared after load_printer_options(), which ends with error, sets errno and it is again checked after ppdCreateFromIPP2() without clearing errno -> fails.
But the same print queue goes to record_printer_options() and produces following error:
Jun 04 03:29:33 host-client-ip cups-browsed[2420]: Tue Jun 4 03:29:33 2019 Unable to get PPD file for brno1-0th-cafe: The printer or class does not exist.
Jun 04 03:29:33 host-client-ip cups-browsed[2420]: Tue Jun 4 03:29:33 2019 lpstat: No destinations added.
Jun 04 03:29:33 host-client-ip cups-browsed[2420]: Tue Jun 4 03:29:33 2019 Unable to load PPD from local queue brno1-0th-cafe, queue seems to be raw.
Jun 04 03:29:33 host-client-ip cups-browsed[2420]: Tue Jun 4 03:29:33 2019 Queue has still jobs or CUPS error!
Jun 04 03:29:33 host-client-ip cups-browsed[2420]: Tue Jun 4 03:29:33 2019 ERROR: Failed disabling printer 'brno1-0th-cafe': The printer or class does not exist.
The text was updated successfully, but these errors were encountered: