-
Notifications
You must be signed in to change notification settings - Fork 26
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
getJobs is unable to return completed jobs #19
Comments
Hi @TheLure , does 'lpstat -W completed' return anything? pycups is just python module above CUPS, using its API to do the stuff - so if CUPS does not return anything, so it is correct in pycups. IMO it can be due the default settings to do not save successfully printed jobs - see PreserveJobFiles/PreserveJobHistory. |
Thanks for the reply @zdohnal, Yes, lpstat -W completed returns completed job according to my PreserveJobFiles setting (set to 2w). PreserveJobHistory is unset so from the docs it should default to "Yes" and be the same value as PreserveJobFiles. |
I worked around the issue by storing the Job IDs of all job as they are created outside of cups so I can use getJobAttributes when needed at a later time. |
@TheLure would you mind telling me if you are connecting to local CUPS or remote? I connected to the local in my test and it works:
(done in Fedora 31) |
@zdohnal I am connecting to localhost. |
|
@TheLure Strange... I'll try to create some cancelled jobs too and check it later. Otherwise if I will not be able to reproduce, please contact SuSe support about it too. |
I'm not sure how to address the SuSe ticket as I can only reproduce the behaviour via pycups, I'm sure they will just say it's a pycups problem. The cups core tools seems to report correctly. If you can verify the problem is inside cups however I will create a ticket for sure. As I worked around the problem I will not be doing more testing unless requested. I need to move forward with our project. I will try to revisit this issue in a few weeks and see if I can get the same behavior just using cups tools so I can contact SuSe. Edit: Oh, suse DO supply pycups in a official repo for Sles 15. :) I will submit a ticket. |
I can confirm it's a bug in centos/rhel 7, however it worked well in el6. The issue is that it failed to get a valid job_id. Even though it is fixed, it still has some other issue that failed to get some attributes. #22 is closed and related to this issue. https://github.com/caot/pycups/blob/1.9.74-el7/cupsconnection.c fixed the issue to get a valid job_id, however it still has some other issue that failed to get some attributes such as that mentioned at #10 |
It seems getJobs is not able to able to return completed jobs no matter what I set "which_jobs" to.
I'm using this documentation:
http://nagyak.eastron.hu/doc/system-config-printer-libs-1.2.4/pycups-1.9.51/html/
getJobs accept three values for which_jobs: 'completed', 'not-completed', 'all'
'not-completed', 'all' both only returns not-completed jobs.
'completed' returns nothing.
If I use getJobAttributes on a known completed job ID it works as expected and I can get information about the job.
I am using a fresh install of Cups 2.2.7 and latest pycups (2020-04-08) on SuSe SLES 15sp1.
The text was updated successfully, but these errors were encountered: