IBM Support

Line Printer Daemon (LPD) Problem Determination and Common Problems

Troubleshooting


Problem

This document provide a list of common LPD problems and solutions.

Resolving The Problem

This document provides information on problem determination for Line Printer Daemon (LPD), as well as a list of common LPD problems and their solutions.

This document was last updated on 3 February 2015.





An Overview of the Line Printer Daemon (LPD) Protocol

LPR/LPD is a network protocol for sending and receiving print jobs using TCP/IP. Line Printer Requester (LPR) is the protocol that sends a print job to a remote printer or a server, and Line Printer Daemon (LPD) is the protocol for receiving a print job on a printer or a server.

In i5/OS, the Line Printer Requester (LPR) protocol is used by the Send TCP/IP Spooled File (SNDTCPSPLF) command or by a Remote Output Queue (RMTOUTQ) that has the Connection type (CNNTYPE) parameter set to *IP, and the Line Printer Daemon (LPD) protocol is used by the QTLPDxxxxx jobs.

The i5/OSLPD daemon jobs can be setup to start automatically when TCP/IP is started, or it can be started manually using the Start TCP/IP Server (STRTCPSVR) command. For example:

STRTCPSVR SERVER(*LPD)

The Line Printer Daemon (LPD) job in i5/OS can be used to received print jobs from many sources, including:
oa Remote Output Queue (RMTOUTQ) configured on an IBM i system that sends spooled files to an output queue. The RMTOUTQ could be configured on another IBM i system, in another partition (or LPAR) on the same IBM i system, or on the same partition (or LPAR).
othe Start TCP/IP Server (STRTCPSVR) command running an another IBM i system, in another partition (or LPAR) on the same IBM i system, or on the same partition (or LPAR).
othe LPR command running on a PC or server running Windows, Linux or Mac OS.





Line Printer Daemon (LPD) Problem Determination

Once you have verified the TCP/IP connectivity, use this document to identify possible causes of problems with LPD (Line Printer Daemon). Additional information can be found in Appendix E: TCP/IP Problem Analysis, of the OS/400 TCP/IP Configuration and Reference Version 3 manual, SC41-3420.





LPD Server
oLPD Server jobs (QTLPDxxxxx) active in QSYSWRK subsystem.
oExamine the LPD Server joblogs.
oVerify the passive listening connection under NETSTAT Option 3.
oDisplay the messages sent to LPD to determine where the spooled file was placed.
oIf logged on with the same user ID as was used to issue the LPR command, use the DSPMSG command.
oIf logged on as different user ID, use DSPMSG MSG(userid); if the user does not exist, use DSPMSG MSGQ(QTCP/QTMPLPD) (the LPD Server job runs under the QTMPLPD user profile).
oCheck QPRINT in QGPL; this is the default destination for spooled files.





Materials Required for Reporting LPD Problems
oThe LPD Daemon job logs (QTLPDxxxxx under QSYSWRK)

Note: You may need to change the QTCP/QTMPLPD job description to increase message logging and then end and restart the LPD Daemon job. For example:

CHGJOBD JOBD(QTCP/QTMPLPD) LOG(4 00 *SECLVL)

ENDTCPSVR SERVER(*LPD)

wait for all of the QTLPDxxxxx jobs to end, and check by doing a "WRKACTJOB SBS(QSYSWRK) JOB(QTLPD*)"

STRTCPSVR SERVER(*LPD)
oThe QTCPIP joblogs
oIf there is a problem with the data integrity then collect the spooled files that are generated on the system, and the spooled files that are being sent if possible.
oTCP/IP communications trace. Refer to the following Rochester Support Center Knowledge Base document for instructions:

N1019135: Running a TRCCNN Trace for LAN Printing Problems
oInformation about the remote host that is sending the print data, and what commands/settings are used to send the print data.
oLPD Flight Recorder. Refer to the following Rochester Support Center Knowledge Base document for instructions:

N1017910: Line Printer Daemon (LPD) Flight Recorder Trace Instructions





LPD -- Common Problems

Problem: Spooled file is not on the print queue (output queue) requested, it goes to QUSRSYS/QPRINT output queue instead

Causes: Possible causes include the following:
oThe requested print queue (output queue) name is misspelled.
oThe requested print queue (output queue) did not specify the library name and the output queue is not in the library list for the QTCP user profile.
oThe user did not have authority to the requested print queue.

Problem: LPD receives only a portion of the spooled file

Cause: The LPR job on the sending system failed before sending all of the print data. The LPD server (QTLPDxxxxx) assumes that the connection is closed and that all data has been sent.

Solution: Resend the spooled file from the remote host.


Problem: All files received are of the same printer device type but not *USERASCII

Cause: The QPTMPLPD printer file is set to a type other than *USERASCII.

Solution: Change the QPTMPLPD printer file to printer device type *USERASCII using the following Change Printer File (CHGPRTF) command:

CHGPRTF FILE(QPTMPLPD) DEVTYPE(*USERASCII)

Note: LPR/LPD is designed for sending ASCII print data from a host system to a printer, or from one host system to another, so the system-supplied QPTMPLPD printer file is shipped with the Printer device type (DEVTYPE) parameter set to *USERASCII. Customers have been known to change the QPTMPLPD printer file to *SCS or *AFPDS for sending print data from a mainframe to the IBM System i, but this is not recommended and not supported. Any change to the QPTMPLPD printer file affects all spooled files sent to the system using LPR/LPD, so there is no way to change the printer file to generate *SCS or *AFPDS spooled files sent from a mainframe and to generate *USERASCII spooled files sent from a Windows PC, Linux server, Unix server, and so on.

Problem: Data integrity problems within the printed output

Cause: Unknown -- Need a communications trace.

Solution: A TCP/IP communications trace will show if the file is arriving already corrupted or if the IBM iSeries family of servers is causing the problem. Also, collect the spooled files that are generated on the system, and the spooled files being sent if possible.


Problem: LPD Server Job fails with MSGTCP2617 "TCP/IP connection to remote system &2 closed, reason code 2"

Message TCP2617 "TCP/IP connection to remote system closed, reason code 2" in QSYSOPR, and the remote port is 515. If the user cannot identify the LPD server/remote OUTQD with the remote IP address listed in TCP2617, use NETSTAT Option 3 to identify the writer job: NETSTAT Option 3, F17=Position to, specify the remote IP address listed in TCP2617, select 8=Display jobs to see the remote writer job name.

For more information, refer to the following document:

N1016564: Message TCP2617


Problem: LPD Server Job fails with MSGTCP3427 "Remote host system rejected the open attempt"

Message TCP3427 "Remote host system rejected the open attempt." If the remote system is another IBM System i system, run NETSTAT Option 3 to check whether LPD is in LISTEN state on the target System i™ system. If the LPD server is available on the target/server system, collect a communications trace (run the TRCCNN command) on both systems. If there is a firewall between the systems, it is possible that the firewall is blocking the traffic.

For more information, refer to the information on message TCP3427 in the following document:

N1019579: Configuration Settings and Error Messages for Remote Output Queues (RMTOUTQs)


Problem: Running the "STRTCPSVR SERVER(*LPD)" command results in a WRKPRB entry.

Job log for the QTLPDnnnnn job shows message CPF1075 referring to a missing job description; however, the profile issuing the STRTCPSVR *LPD command was not defined to use this missing job description?

CPF1075: Job description is not found
CPF1893: Errors occurred while changing job

When a spooled file is sent from one System i system to another, the LPD server swaps the client's user profile with another user that has the correct privileges (QTMPLPD profile). If the job description and library of the client's user profile are not found, messages CPF1075 and CPF1893 messages are sent to the job log. Display the user profile in CPF1075, and determine if the job description and library specified really exist.


Problem: MSGCPF2181 "Library QTCP in system and user parts of library list"

The Line Printer Daemon (LPD) server job requires having the QTCP library in the library list, so the code adds the QTCP library to the end of the user portion of the library list. If the QSYSLIBL (System part of the library list) system value has been set to include the QTCP library, then the Line Printer Daemon (LPD) server job will post message CPF2181, Library QTCP in system and user parts of library list. This will also cause the spooled file to go the QGPL/QPRINT output queue instead of the requested print queue/output queue.

Resolution: This problem can be resolved by doing the following:

1.Run the following Work with System Value (WRKSYSVAL) command:

WRKSYSVAL SYSVAL(QSYSLIBL)
2.Take Option 2 (Change) on the QSYSLIBL (System part of the library list) system value and remove library QTCP from the list.
3.End the LPD server jobs by running the following End TCP/IP Server (ENDTCPSVR) command:

ENDTCPSVR SERVER(*LPD)
4.Restart the LPD server jobs by running the following Start TCP/IP Server (STRTCPSVR) command:

STRTCPSVR SERVER(*LPD)

Problem: The customer uses TCP/IP LPR to send a spooled file from an IBM AIX system to an IBM System i LPD server. Message TCP3602 - Spooled file received from remote user is received; however, the spooled file is not found on the System i. The AIX sender's user ID exists on the System i and the output queue exists on the System i system. A trace shows that the System i system received a spooled file with zero bytes. The problem was that the user sent a flat file from the AIX rather than a spooled file.


Problem: TCP3712 TCP/IP LPD server job failed with RC1 -- The maximum number of allowed user spaces (999) for LPD server jobs has been reached. All user spaces are in use and a new one could not be created. Excerpt from a CPS discussion:

Solution: The system is very busy and/or very slow. It would mean there are 999 LPD jobs running concurrently actively processing LPR requests. The recovery is to reclaim the user spaces by cycling the LPD server by using the following End TCP/IP Server (ENDTCPSVR) and Start TCP/IP Server (STRTCPSVR) commands:

ENDTCPSVR SERVER(*LPD)

STRTCPSVR SERVER(*LPD)

Sometimes user spaces get "lost" because and LPD server job that was using it terminates abnormally and does not get a chance to put the user space back on the shelf; that is, it looks like it is in use when it really is not.

The current design using a pool of user spaces and re-using them. A better design would be to create a userspace each time and then delete it when done. Back in V2R3 timeframe, we thought user spaces were a scarce resource.

You can reclaim the user space also by using the following Delete User Space (DLTUSRSPC) command:

DLTUSRSPC USRSPC(QUSRSYS/QTMPLPD*)


Problem: Cannot view the spooled files received from another iSeries.

Solution: Check the Remote Output Queue (RMTOUTQ) description on the sending system to ensure that the Destination type (DESTTYPE) parameter is set to *OS400 and that the Host print transform (TRANSFORM) parameter is set to *NO.


Problem: LPD works most efficiently when two or more servers are running. Running only one server works, but no jobs can be received while a current job is running. If a large print job is running, new jobs have to wait before LPD is ready to accept any new LPR requests. If only one LPD server job is running and an unrecoverable error ends the LPD job abnormally, then the 515 listening port could be the one that terminates, which will end the LPD service.





Issues Reported through First Failure Data Capture (FFDC) and the Work with Problem (WRKPRB) Command, Including ECSFUP PMRs

Run the Work with Problem (WRKPRB) command and look for Problem IDs with a problem description of “Software problem data for QTMPLPDC”. Select Option 5 (Display details), and page down two times to find the symptom string. These will typically have a Problem message ID of message CPI93B9 "Software problem data for &1 has been logged. Refer to help text for additional information" and may also be reported automatically through the ECSFUP
    • - Symptom String: 5722 F/QTMPLPDC MSGCPF22E3 or 5761 F/QTMPLPDC MSGCPF22E3



      Message CPF22E3 "User profile &1 is disabled" typically indicates that the QTMPLPD user profile is disabled. Verify that by running the following Display User Profile (DSPUSRPRF) command:

      DSPUSRPRF USRPRF(QTMPLPD)

      Also verify that the Date password expires has not passed. Use the Change User Profile (CHGUSRPRF) command to change the QTMPLPD user profile to set the User password (PASSWORD) parameter to *NONE, to set the Set password to expired (PWDEXP) parameter to *NO and to set the Status (STATUS) parameter to *ENABLED; for example:

      CHGUSRPRF USRPRF(QTMPLPD) PASSWORD(*NONE) PWDEXP(*NO) STATUS(*ENABLED)

      Note: The QTMPLPD can be prevented from being disabled in the future by adding it to the Active Profile List. This can be done by using the following Change Active Profile List (CHGACTPRFL) command:

      CHGACTPRFL USRPRF(QTMPLPD) ACTION(*ADD)

      • - Symptom String: 5722 F/QTMPLPDC RC04020008



        A problem with symptom string "57xx F/QTMPLPD RC04020008" has been reported through APAR SE29644 "TCPIP-LPD FFDC SYMPTOM F/QTMPLPDC RC04020008 JOB QTLPD00XXXX" (). If running V5R3M0 (R530) or V5R4M0 (R540) i5/OS, download and apply the appropriate PTF or its superseding PTF:

        R530 PTF SI33872 Database 'DCF Technotes (IBM i)', View 'Products', Document 'Configuration Settings and Error Messages for Remote Output Queues (RMTOUTQs)' 1000 (not in a cumulative)
        R540 PTF SI34207 C9104540

        If running a different version of i5/OS or if the PTF does not resolve the problem, collect LIC Sockets trace and LPD Flight Recorder trace.

        CPS 5XLTAZ: Excerpt from the LPD developer:

        This RC value points to the setsockopt() call in LPD where we attempt to set the transport option TCP_NODELAY. The call fails with errno=3021 that is described to be as follows:

        EINVAL 3021 The value specified for the argument is not correct.

        I will admit this makes no sense. I have to assume there is a problem in sockets below LPD (for example, the socket is gone or something). There really is no recovery from this kind of error at the application level; therefore, our throwing an FFDC is probably not the best thing.

        CPS 6LKR37
        Excerpt from the Sockets developer:

        This is not a "sockets" problem, and neither was CPS Discussion Item: 5XLTAZ. All sockets can do is tell an application that they are doing something invalid, which is what this error message indicates. Following is a list of the circumstances in which EINVAL is returned on a call to setsockopt() (From Infocenter API doc).

        [EINVAL]
        Parameter not valid.
        This error code indicates one of the following:

        1The level parameter specifies a level that is not supported.
        2The option_name parameter specifies a value that is not valid (except for when the level is SOL_SOCKET , in which case [ENOPROTOOPT] is returned).
        3The option_value parameter specifies a value that is not valid.
        4The option_length parameter specifies a negative or zero value.
        5An attempt was made to set a socket option that was read-only.

        A sockets trace might be able to show them what the application layer code is doing wrong. Refer to the following Rochester Support Center knowledgebase documents:

        N1017910, LPD - Flight Recorder Trace Instructions: Database 'DCF Technotes (IBM i)', View 'Products', Document 'Line Printer Daemon (LPD) Flight Recorder Trace Instructions'
        LIC Sockets Trace Using TRCINT (Collecting All Sockets Data):

        • - Symptom String: 5722 F/QTMPLPDC MSGCPF0001 or 5761 F/QTMPLPDC MSGCPF0001



          APAR SE38549 "TCPIP-LPD-F/QTMPLPDC-MSGCPF0001 INTERMITTENT FFDC REPORT FOR THE LPD SERVER" (Database 'DCF Technotes (IBM i)', View 'Products', Document 'Line Printer Daemon (LPD) Flight Recorder Trace Instructions') and a problem with symptom string "5761 F/QTMPLPDC MSGCPF0001" has been reported through APAR SE38572 "TCPIP-LPD-F/QTMPLPDC-MSGCPF0001 INTERMITTENT FFDC REPORT FOR THE LPD SERVER" (). If running V5R4M0 (R540) or V6R1M0 (R610) i5/OS, download and apply the appropriate PTF or its superseding PTF:

          R540 PTF SI35899 Database 'DCF Technotes (IBM i)', View 'Products', Document 'Line Printer Daemon (LPD) Flight Recorder Trace Instructions' C9321540
          R610 PTF SI35900 C9279610

          Apparently, the LPD daemon job is trying to issue the STRPRTWTR or CHGWTR command but is receiving message CPF0001 "Error found on &1 command". This FFDC does not prevent LPD from working, so if running a different version of i5/OS or if the PTF does not resolve the problem then this FFDC error should be ignored.

          • - Symptom String: 5722 F/QTMPLPDC MSGCPF22E7 or 5761 F/QTMPLPDC MSGCPF22E7



            CPF22E7 says ProfileHandle is not valid. The LPD server joblog shows CPF4AB8 Insufficient authority for user profile ILEVY prior to CPF22E7. CPF4AB8 indicates User profile ILEVY does not have *OBJOPER to his own profile. -- User profile ILEVY does not have *READ to one of his group profiles.

            Note: If the QTLPDxxxxx job log lists MSGCPF22E7 "ProfileHandle is not valid" without MSGCPF4AB8 "Insufficient authority for user profile &1" or any other messages, verify that the user profile that owns the spooled file on the sending iSeries system exists on the receiving system and that it is enabled.

            • - Symptom String: 5722 F/QTMPLPDC RC04020004 or 5761 F/QTMPLPDC RC04020004



              Server cannot bind to the LPD port (normally 515). If the customer has a port restriction in effect, it can cause this kind of symptom. To check TCP/IP port restrictions:
              CFGTCP, and select option 4 Work with TCP/IP port restrictions.

              • - Symptom String: 5722 F/QTMPLPDC MSGCPF9845 or 5761 F/QTMPLPDC MSGCPF9845



                CPF9845 Error occurred while opening file. The customer found a MCH1001 -
                Attempt to use permanent system object libraryname without authority.

                The user was not authorized to the job description’s library in the user’s profile.

                Note: This symptom string is also generated in cases where incoming spooled priority is higher than the priority limit on the QTMPLPD user profile. Resolve the problem using one of the following methods:

                o End the writer with OPTION(*IMMED), use the Change User Profile (CHGUSRPRF) command to increase the value in the Highest schedule priority (PTYLMT) parameter for the QTMPLPD user profile on the receiving system, then restart the remote writer. The QTMPLPD user profile ships with the Highest schedule priority (PTYLMT) parameter set to 3, but can be increased to 0 using the following Change User Profile (CHGUSRPRF) command:

                CHGUSRPRF USRPRF(QTMPLPD) PTYLMT(0)

                o End the writer with OPTION(*IMMED), select Option 2 (Change) on the spooled file in SND status, then set the Output priority (OUTPTY) parameter to the value for the Highest schedule priority (PTYLMT) parameter in the QTMPLPD user profile on the receiving system, and then restart the remote writer.







              Miscellaneous Notes
              oTo find the LPD server jobs (the QTLPDxxxxx server jobs running in the QSYSWRK subsystem), either run the following Work with Active Jobs (WRKACTJOB) command:

              WRKACTJOB SBS(QSYSWRK)

              or the following Work with User Jobs (WRKUSRJOB) command:

              WRKUSRJOB USER(QTCP)

              and press the Enter key, then press the Page Down key to find the QTLPDnnnnn jobs.
              oYou can use the Change LPD Attributes (CHGLPDA) command to change the LPD server attributes including:

              -- The Autostart servers (AUTOSTART) parameter which specifies whether the LPD server should be started automatically when TCP/IP is started, and

              -- The Number of initial servers (NBRSVR) parameter which specifies the initial number of LPD server jobs (or QTLPDxxxxx) jobs to start when the LPD server is started.
              oFor more information, refer to Chapter 12, Line Printer Daemon (LPD), in the obsolete publication OS/400 TCP/IP Configuration and Reference V4R4, SC41-5420-03, which is available online at:

              http://publib.boulder.ibm.com/pubs/html/as400/online/v4r5eng.htm
              oFor information on RFC1179, the Line Printer Daemon (LPD) protocol, is available at:

              //faqs.org/rfcs/rf`c1179.html


              [{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.1.0"}]

              Historical Number

              450953727

              Document Information

              Modified date:
              18 December 2019

              UID

              nas8N1018886