Note: Similar question has been posted years ago. Yet the debugging procudure provided by the long answer didn't help. And the last posted, supposedly the solution for it is very unintuitive. So here I am, post the question again.

My printer is connected through socket://ip.of.printer:9100. The model of printer is LaserJet P4015n. My computer is running Arch Linux. The version of cup related modules are:


The printing system of my computer used to be working fine. Yet today when I try to print a document, the printer do not respond. Downgrading all cup related packages to earliest version I have on my computer doesn't help. Neither does reinstalling the printer driver.

When debugging, # nc -vz ip.of.printer 9100 returning normal connection,

...[ip.of.printer] 9100 (hp-pdl-datastr) open

Checking /var/log/cups/error_log, only related message was

E [22/Aug/2015:01:15:33 +0800] [Job 35] Unable to write print data: Broken pipe

And printer related result of tcpdump is posted as below(localhost name is Saturn, I traced Saturn.57142 due to it's the connection with HP LaserJet P4015):

00:42:12.748387 IP Saturn.57142 > NPI7B3356.DynIP.ntu.edu.sg.snmp:  GetRequest(28)
00:42:12.753755 IP NPI7B3356.DynIP.ntu.edu.sg.snmp > Saturn.57142:  GetResponse(45)"HP LaserJet P4015"
00:42:12.753904 IP Saturn.57142 > NPI7B3356.DynIP.ntu.edu.sg.snmp:  GetNextRequest(27)
00:42:12.758850 IP NPI7B3356.DynIP.ntu.edu.sg.snmp > Saturn.57142:  GetResponse(34)"black"
00:42:12.758900 IP Saturn.57142 > NPI7B3356.DynIP.ntu.edu.sg.snmp:  GetNextRequest(29)
00:42:12.763940 IP NPI7B3356.DynIP.ntu.edu.sg.snmp > Saturn.57142:  GetResponse(30)
00:42:12.764116 IP Saturn.57142 > NPI7B3356.DynIP.ntu.edu.sg.snmp:  GetRequest(28)
00:42:12.771071 IP NPI7B3356.DynIP.ntu.edu.sg.snmp > Saturn.57142:  GetResponse(29)
00:42:12.771123 IP Saturn.57142 > NPI7B3356.DynIP.ntu.edu.sg.snmp:  GetRequest(29)
00:42:12.775906 IP NPI7B3356.DynIP.ntu.edu.sg.snmp > Saturn.57142:  GetResponse(32)

00:42:12.838656 IP Saturn.57142 > NPI7B3356.DynIP.ntu.edu.sg.snmp:  GetNextRequest(27)
00:42:12.843572 IP NPI7B3356.DynIP.ntu.edu.sg.snmp > Saturn.57142:  GetResponse(31)
00:42:12.843675 IP Saturn.57142 > NPI7B3356.DynIP.ntu.edu.sg.snmp:  GetNextRequest(29)
00:42:12.848515 IP NPI7B3356.DynIP.ntu.edu.sg.snmp > Saturn.57142:  GetResponse(32)
00:42:12.848630 IP Saturn.57142 > NPI7B3356.DynIP.ntu.edu.sg.snmp:  GetNextRequest(29)
00:42:12.854099 IP NPI7B3356.DynIP.ntu.edu.sg.snmp > Saturn.57142:  GetResponse(30)
00:42:12.854138 IP Saturn.57142 > NPI7B3356.DynIP.ntu.edu.sg.snmp:  GetRequest(28)
00:42:12.861080 IP NPI7B3356.DynIP.ntu.edu.sg.snmp > Saturn.57142:  GetResponse(29)

00:42:13.261306 IP Saturn.57142 > NPI7B3356.DynIP.ntu.edu.sg.snmp:  GetNextRequest(27)
00:42:13.266306 IP NPI7B3356.DynIP.ntu.edu.sg.snmp > Saturn.57142:  GetResponse(31)
00:42:13.266332 IP Saturn.57142 > NPI7B3356.DynIP.ntu.edu.sg.snmp:  GetNextRequest(29)
00:42:13.271211 IP NPI7B3356.DynIP.ntu.edu.sg.snmp > Saturn.57142:  GetResponse(32)
00:42:13.271254 IP Saturn.57142 > NPI7B3356.DynIP.ntu.edu.sg.snmp:  GetNextRequest(29)
00:42:13.276577 IP NPI7B3356.DynIP.ntu.edu.sg.snmp > Saturn.57142:  GetResponse(30)
00:42:13.276675 IP Saturn.57142 > NPI7B3356.DynIP.ntu.edu.sg.snmp:  GetRequest(28)
00:42:13.283540 IP NPI7B3356.DynIP.ntu.edu.sg.snmp > Saturn.57142:  GetResponse(29)
00:42:13.283623 IP Saturn.57142 > NPI7B3356.DynIP.ntu.edu.sg.snmp:  GetRequest(29)
00:42:13.288444 IP NPI7B3356.DynIP.ntu.edu.sg.snmp > Saturn.57142:  GetResponse(32)

Any idea on how to solve the issue?

  • Did you follow the steps laid out at - unix.findincity.net/view/635395087004115229122202/… – Leptonator Aug 21 '15 at 17:54
  • I haven't activate iptable or enforce SElinux. Rest of the debugging procedure are done, result is posted above. The last solution... I don't understand what that person mean. – Chong Aug 21 '15 at 18:00
  • 1
    I see you've already answered this, but did you try telnet [ip] 9100 and try performing something like the display change command to see if it would still allow connections that way? – Cole Busby Oct 26 '15 at 14:34
  • @ColeBusby Just tried telnet [ip] 9100. It connected succesfully, and then the connection is immediately "closed by foreign host". What does it mean? – Chong Oct 26 '15 at 14:41
  • 1
    Means exactly what you've already found out, the printer disallows direct connections at port 9100 and that the connection was closed by the printer. – Cole Busby Oct 27 '15 at 19:14

Sometimes a hardware issue is indeed -- simply hardware issue... In my case, it turned out that our school changed the way printing jobs are organized. They blocked the direct printing, maybe through firewall policy. And redirect all printing jobs through a central server with SAMBA protocol. Hence I can ping the office printer, yet I can't send any printing data to the printer. The issue eventually got solved after contacting the IT staff and reconfigured my computer according to their change.

If you met a similar problem, and cannot figure out the source of it on your own end. You should probably contact the IT staff of your company/organization. Maybe they simply changed some settings without informing you.

Thanks to @ColeBusby, one way to check if the problem is indeed caused by company/organization's restriction on directly connecting to the printer through port 9100 is to use

telnet [ip.of.the.printer] 9100

in your terminal. If the output is

Connected to
Escape character is '^]'.

And immediately followed by Connection closed by foreign host.

Then it is clear that you successfully access the printer and yet the printer rejected your access through 9100 port. When this happens, ask your IT staff to see if the policy is changed without telling you and how to configure to use the new printing system.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.