Print job shows in network printer queue, but spooler deletes it and it does not print - printing

We have a Windows 10 machine that can print from applications like MS Word. (Print server 2019) However, when we try to send a print job to the printer from another in-house application, the print job gets deleted by the spooler.
You can see the print job in the printer queue on the originating machine, you can see it in the queue on the print server, but then that's where it stops. It does not get to the status of "Printing job ". Instead the job gets deleted then throws an error (ox2) when trying to delete the file that is already gone.
We tried
changing the printer protocol from LPR to RAW
printing directly to the printer instead of through the print server
sharing the printer from the client machine and printing to that
turning on the EMF Spool option
updating the drivers on the client machine and the print server

Related

Recent Microsoft patch breaks UWP printing to serial printers

Recently Microsoft deployed some security patch that has broken UWP printing to serial printers. These are printers that interface to Windows through either a USB serial port or a Bluetooth serial port. Symptoms -
Upon printing, a print notification appears:
Print Notification
Error printing on [printer name]
The printer couldn't print [print job name]
The print job appears in the printer queue with "Error - Printing" as status. Restarting the print job from the queue causes the page to successfully print, however having to restart every print job is not an acceptable solution for any application.
In the Windows event viewer, under Custom Views, Administrative Events, the following error is logged at the time of print failure:
"The document Print Document, owned by [user], failed to print on printer [printer name]. Try to print the document again, or restart the print spooler.
Data type: XPS2GDI. Size of the spool file in bytes: 182104. Number of bytes printed: 0. Total number of pages in the document: 1. Number of pages printed: 0. Client computer: [\COMPUTERNAME]. Win32 error code returned by the print processor: 3012. No printers were found."
I have duplicated this bug using the Windows Universal printing example from Microsoft
I have duplicated the issue on multiple PCs, running Windows 10 21H1, 21H2, and Windows 11. I believe the issue to be related to some recent security fix deployed by Microsoft but I cannot identify which one is the cause. The problem did not exist until recently.
Are other people seeing this? Does anyone know which KB patch is the culprit? Is there any fix of which anyone is aware?
Here is the fix. The fix takes care of both Bluetooth and serial printing issue in Windows with the symptoms as described above. In an elevated command prompt:
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers" /v {CA791BB3-9742-4A0F-87B8-B3C4B1065856} /t REG_DWORD /d 1 /f
After issuing this command, reboot the PC. The fix works for both Windows 10 and 11.
I’m hopeful that Microsoft is going to patch the issue in the near future.

Process Monitor Troubleshooting custom print driver, print spooler

Our users upgraded from Windows 7 to 10.
When they try to print using a custom print driver they get this error
The document Print Document, owned by User, failed to print on printer TEST-PRINT. Try to print the document again, or restart the print spooler.
Data type: NT EMF 1.008. Size of the spool file in bytes: 628788. Number of bytes printed: 12900. Total number of pages in the document: 6. Number of pages printed: 0.
Client computer: Devcomp. Win32 error code returned by the print processor: 2147500037. Unspecified error
Some of my observations: Internally we cannot reproduce this error internally. I have a windows 10 surface and also tried on a windows 8 machine. Our support tried it here too.
The customer can reproduce the issue without. The issue happens for some documents on some workstations. The PDF is generated from a 3rd party application for tellers. The customer saves the pdf from this signature desktop application to a PDF and uses our print driver to print to the our application.
Our print driver converts the file to PCL and sends it to the subscriber for further processing.
I can provide more info if needed regarding print driver. First of is it a problem with the print driver?
All the users who upgraded from windows 7 to a windows 10 laptop can see the issue happening. There are some windows 10 workstations that print just fine. Could it be something with the group policy or some registry settings. If I were to compare the registry or policies on the workstation that prints and the one that fails what would be the settings I need to look for? The customer's IT says that there is no difference between the two workstations except that it’s the production workstation that fails. Typical response nothing different but it doesn't work.
We also tried to disable “render print jobs on the client workstation” but this didn’t seem to make difference. I am happy to try any suggestions you’ll have.
I am looking for ideas of what kind of research and where should I start troubleshooting.
I won't be troubled if anyone chooses to vote the question down that I didn't do any research since I really don't know where to start. I am a .NET developer not a windows driver expert or systems admin.
Process Monitor Good File. The file gets created.
Create file success, create file name not found and finally create file succcess
Bad File: Create file success, create file name not found. The last create file is not called by the print.exe driver.
This solved my problem. Thanks Papercut!.
https://www.papercut.com/kb/Main/FixingPrintSpoolerCrashes
https://www.papercut.com/kb/Main/EnableAdvancedPrintingFeatures

Printing From VIP fails to print

I am working with MC9500 Motorola handhelds, Zebra RW-420 printers, and the VIP Application. When I go to print a test page it reads the error:
Failed to read 1 byte(0 read)
Troubleshooting:
-I have successfully printed from other RW-420 printers
-Sent the printers that had this error back to Zebra(now they can print via Bluetooth but still show that error)
-Made sure I have the correct COM Ports
-Reset the printers multiple times on the Zebra Setup Utilities
-I have updated the firmware on the printer
-Tried changing the printer language but nothing helps
I have tried searching for this error but I haven't seen anything relevant yet. Please let me know if there is anything I am missing.
There was a different way to change the printer language and a few other configuration settings that needed to be changed beforehand.

IBM i (AS/400) command works locally but not remotely

I have a Windows service written in VB.NET 2.0 which connects to an IBM AS/400 server. Queries work fine, but when I try to do something like deleting a spool file, I get errors. For example:
CPYSPLF FILE(PO630A) TOFILE(MPLCDATPAR/PO630APF) JOB(083064/ARUSER/POASYNCMON) SPLNBR(80) MBROPT(*REPLACE)
Running this command with ExecuteNonQuery yields:
CPF3342 - Job not found 083064/ARUSER/POASYNCMON
However, if I run that same command locally in AS/400, it works just fine. We already checked permissions. What else could be causing the command to fail this way? How can I get more information about the error, or go about troubleshooting this?
EDIT: This problem (and a lot of other ones) appeared when we migrated our server (where the .NET service runs) from Windows Server 2003 to Windows Server 2008.
How can I get more information about the error, or go about troubleshooting this?
The first thing is to verify that the IBM AS/400 server [what OS Version Release and Modification level, Technical Refresh (TR) level (if instead IBM i), Cumulative PTF level were all omitted.?.?] used for the connection is the same server used to perform the command-line invocation; i.e. on the server where the command-line invocation will be made to verify the command is functional, find the active server job in which the CPF3342 is still visible in the log.
The second thing to do is to get the spooled joblog showing the full details of the CPF3342 [and possibly any preceding message(s) that might be related]. If for example the message is not actually that message or is not sent by the expected program QSPCPYF, then immediately the direction of investigation probably would change. What is shown is apparently what is presented at the client, not what came from the server joblog; the USEnglish formatting I believe is "Job &5/&4/&3 not found." for which the formatting "CPF3342 - Job not found &5/&4/&3" is suspect.
To ensure the most appropriate comparison to the request made from the client:
• the local user that is signed-on to perform the same request should be the same user as the Current User of the active job found to be servicing the client request
• the local user should establish the same System Library List as the active job found to be servicing the client request
If such an incident recurs or even if the same incident persists, then verify the once again the re-create is still possible using the same interface [i.e. the condition\failure persists] and again verify the command-line request is successful [i.e. the circumvention is confirmed, that the same request is possible to be performed at the command-line]; and according to my earlier comment, first ensuring the same server by finding the active job that logs the CPF3342. Immediately afterward:
• Collect a job trace for the Copy Spooled File (CPYSPLF) request; for the failing case, review for any exception\interrupt conditions [with or without a message as accompanying trace data] that precede the program flow for the issuance of the msg CPF3342.
• Review the audit log for any T-AF or anything odd\unexpected at very close to the time of the failing request; expansive auditing should have been established since before the connection to the server.
• Contrast those data collections of the failing case with the same data taken from the successful processing.
Although the symptom [as lightly described, without the full joblog] the possibility of command-exits seems remote, the trace would reveal if the command in either scenario were intercepted by the Command Exit points; these can be reviewed separately [rather than looking in the trace] for any Exit Program, using the Work With Registration Information (WRKREGINF) to review any QIBM_QCA* entries in the repository for what exit programs might impact the CL Command request. But IIRC the trace-data shows which command was invoked, so the trace would also reveal if the unqualified command requests resolved to different *CMD objects.

Change line printer port to be used by gw-basic program

How to use lpt2 as the "line printer" in a gw-basic program. The goal is to change the printer port to lpt2 so i can use the "net use" command to redirect the printer output to a network printer. I can redirect lpt1 to the network printer but have to disable the hardware printer in device manager. However, I get the error printer is offline message.
All this is necessary to get data from the old program data files. I plan to reprint, OCR and import into new software.
You can use the emulator PC-BASIC to run your GW-BASIC program, read its data files and connect it to any printer. Point PC-BASIC to the printer by running it from the command line as
pcbasic --lpt1:PRINTER:MyNetworkPrinterName --print-trigger=page
where you replace MyNetworkPrinterName with the name of your printer in the operating system. If you want all output collected in a single print batch, replace --print-trigger=page with --print-trigger=close.
However, you mention that your final aim is to import the data into another program. A better solution, avoiding the error-prone and labour-intensive scanning and OCR step, might be to let PC-BASIC print to a file directly:
pcbasic --lpt1:FILE:MyOutputFile.txt
which will send the print output to a UTF-8 text file.

Resources