OpenPrinting / pappl-retrofit

PPD/Classic CUPS driver retro-fit Printer Application Library
Apache License 2.0
7 stars 10 forks source link

[HP LaserJet M1536] Test page printed, but the job still can be cancelled #2

Closed zdohnal closed 2 years ago

zdohnal commented 2 years ago

Hi Till,

I've tried ps-printer-app in SNAP in the meanwhile and a successful print job has a Cancel button available, which looks like it is still printing. Additionally, it shows only 0 pages printed.

I've hit several other issues, I will file them separately.

tillkamppeter commented 2 years ago

For me the jobs get finished correctly. After the job being printed (or at least completely transferred to the printer, the Printer Application reports it as completed. The problem of the pages not being counted I have also observed.

I need a debug log. To get one, go to the web interface https://localhost:8000/, click "View Logs" on the front page at the left. Set "Log Level" to "Debugging" and click "Change Log Level". At a later time come back to this page to get the log file via the "Download Log File" button or get the log file as /var/snap/ps-printer-app/common/ps-printer-app.log.

Do another print job which causes the problem, with debug logging active, then attach the log file (renamed to have .txt extension).

zdohnal commented 2 years ago

I need a debug log. To get one, go to the web interface https://localhost:8000/, click "View Logs" on the front page at the left. Set "Log Level" to "Debugging" and click "Change Log Level".

Here I sometimes hit an issue as well - the debug level looks to be reset back to error after some time. (yes, I do change the loglevel and the click to "Change Log Level"). Maybe it is connected to the connection reset errors I get some time? Like the app shuts down and forgot the settings of log level...

I hope I will be lucky to get the info I wanted.

tillkamppeter commented 2 years ago

Please check the log file whether the app stops/crashes and restarts (auto-restarted by systemd after a crash?). The app always starts with Log Level set to "error", but once the log level changed it is supposed to keep it. Also check syslog for messages indicating that a crash has happened.

zdohnal commented 2 years ago

Here is the log of such a print job - logfile.txt

tillkamppeter commented 2 years ago

It seems that it double-frees on end-of-job clean-up, but not in every situation (as I did not make such an observation).

tillkamppeter commented 2 years ago

Can you tell me the exact steps to set up the printer? Which of the discovered devices you have selected? Which model/driver/PPD?

zdohnal commented 2 years ago

Sorry, I keep switching between the issues and it confuses both of us - but I guess the sigabrt influences the showing "cancel" button as well.

Either way, the same steps are for OpenPrinting/ps-printer-app#15 as well - I chose "Network printer", entered IP and try "Auto Select Driver". It loads postscript driver from HPLIP, but since it is Postscript driver, I thought it should work fine with ps-printer-app.

The exact driver is generated if you install a queue with this model (output of lpinfo -m):

lsb/usr/HP/hp-laserjet_m1530_mfp_series-ps.ppd.gz
tillkamppeter commented 2 years ago

It can be that it is this particular PPD, I am testing with HP OfficeJet Pro 8730. I also did not try thr option of manually entering the IP.

zdohnal commented 2 years ago

I will try to get the sigabrt in snapd shell - is there a special way how to call the ps-printer-app there? Because calling the executable with or without sudo gives errors.

bash-5.0# /var/lib/snapd/snap/bin/ps-printer-app server &
[1] 141837
bash-5.0# 2022/05/18 14:47:35.911693 cmd_run.go:1044: WARNING: cannot create user data directory: failed to verify SELinux context of /root/snap: exec: "matchpathcon": executable file not found in $PATH
cannot join mount namespace of pid 1: Operation not permitted
bash-5.0# sudo !!
sudo /var/lib/snapd/snap/bin/ps-printer-app server &
[1] 141903
bash-5.0# sudo: unable to set runas group vector: Operation not permitted
sudo: unable to set runas group vector: Operation not permitted
sudo: PAM account management error: Operation not permitted
sudo: unable to open audit system: Operation not permitted
tillkamppeter commented 2 years ago

I created exactly your combo now, choosing "Network Printer", entering the IP of my printer, choosing the HP LaserJet M1536 as printer model manually and printed a test page. Everything worked correctly (test page came out in grayscale on my color printer but this is probably due to the fact that the M1536 is not a color printer) and job shown as finished correctly, Printer Application stayed in debug mode (meaning it did not get restarted after a crash).

tillkamppeter commented 2 years ago

The Snap starts ps-printer-app through a start-up script which sets a lot of env variables and also supplies command line options. All this points to the resources. The scripts are here:

/snap/ps-printer-app/current/scripts/run-ps-printer-app
/snap/ps-printer-app/current/scripts/run-ps-printer-app-server
tillkamppeter commented 2 years ago

I have worked on ink level check support with CUPS backends in pappl-retrofit and for testing I have used the (unsnapped) Legacy Printer Application of pappl-retrofit. Here I got the same crash and I found out that the calls for status update (which I have added some days ago for a first approach of ink level check with PAPPL's own backends) are misplaced. I have corrected this in commit 07d760259.

I will rebuild the Snaps in the Snap Store, so in an hour from now, you should re-test and if all works fine the crash should go away.

tillkamppeter commented 2 years ago

@zdohnal Did you test again? Is it working for you now?

zdohnal commented 2 years ago

Hi Till,

I haven't got into it yet - I'll reopen the issue if I have the issue again.