After PC crashes: all CUPS/network printers are gone

Hi,
I am trying to solve a problem with a pc, which got its power cable plugged out while it was running (openSUSE 12.2). After a reboot everything seems to be alright, except one thing: all network printers are gone.
Before the “crash” the printers where listed in YAST/printers, and even the settings are the same (the addresses of the print servers are still there and such).
But even restarting the CUPS service or disabling the firewall or restarting the pc did not helped.

Can anyone help me?

Please share /etc/cups/printers.conf so that we can see the printer URI’s.

The first step will be checking if you can successfully ping the network-attached printers by IP address and name.

there is no printers.conf do you mean cupsd.conf oder cupsd.conf.yast2orig maybe?

Anyway pinging the printer servers works fine.

Ah, so you actually mean remote printers attached to CUPS print servers?

Just to clarify further, local (eg usb) printers, and network-attached printers need tobe defined in /etc/cups/printers.conf, but if there is a remote CUPS server in the equation, then they are defined there (and picked up autmatically). However, CUPS 1.6 does away with the CUPS browser protocol for print sharing and discovery and now uses Bonjour/Avahi instead. This shouldn’t impact you at the openSUSE 12.2 client, but maybe the server has been upgraded?

What version of CUPS do you have installed at client end, and at the server end?

cups-config --version

Check the firewall (client), and also report the output from

nmap <print_server_ip

*For all print servers

The cups version is 1.5.3 (client)
and 1.5.4 (on one of the servers i do not know about the other, but none of them work)

using nmap for the print servers gives:


Starting Nmap 6.01 ( http://nmap.org ) at 2014-11-07 01:49 CET
Nmap scan report for xxx.xxx.xxx.xx (yyy.yy.yy.yy)
Host is up (0.00018s latency).
Not shown: 998 filtered ports
PORT    STATE SERVICE
22/tcp  open  ssh
631/tcp open  ipp
MAC Address: SECRET (Asiarock Incorporation)

Nmap done: 1 IP address (1 host up) scanned in 5.08 seconds

and for the other print servers it is basically the same (i removed the actually adresses and ips and MAC address from the ouptut)

But as i already said printing was working until yesterday, someone just plugged the power cable. Ok the pc was not rebooted for a few months, but other pcs were and they still can print via the print servers.

[QUOTE=sabo007;2673636]The cups version is 1.5.3 (client)
and 1.5.4 (on one of the servers i do not know about the other, but none of them work)

using nmap for the print servers gives:


Starting Nmap 6.01 ( http://nmap.org ) at 2014-11-07 01:49 CET
Nmap scan report for xxx.xxx.xxx.xx (yyy.yy.yy.yy)
Host is up (0.00018s latency).
Not shown: 998 filtered ports
PORT    STATE SERVICE
22/tcp  open  ssh
631/tcp open  ipp
MAC Address: SECRET (Asiarock Incorporation)

Nmap done: 1 IP address (1 host up) scanned in 5.08 seconds

Okay, so that confirms the CUPS server is operating.

But as i already said printing was working until yesterday, someone just plugged the power cable.

Yes, got that. :slight_smile: I can understand that such an action could cause all sorts of problems, but it would seem that only CUPS is affected from this action? Hard to believe, as i’d expect other inconsistencies and potential disk issues too.

Anyway, on the client, prove that cups is listeing on port 631

sudo netstat -tulpn|grep cups

or

sudo lsof -i -n | egrep 'COMMAND|LISTEN'

It might be useful to eamine the client /var/log/cups/error_log. If it’s a long file, upload it to pastebin and share the link to it here.

sudo netstat -tulpn|grep cups

gives:


udp        0      0 0.0.0.0:49038           0.0.0.0:*                           2684/cups-polld     
udp        0      0 0.0.0.0:39833           0.0.0.0:*                           2683/cups-polld

and

sudo lsof -i -n | egrep 'COMMAND|LISTEN'

gives:


COMMAND     PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
systemd       1    root   27u  IPv4   7277      0t0  TCP 127.0.0.1:ipp (LISTEN)
systemd       1    root   28u  IPv6   7278      0t0  TCP ::1]:ipp (LISTEN)
sshd       1203    root    3u  IPv4  10971      0t0  TCP *:global-wlink (LISTEN)
sshd       1203    root    4u  IPv6  10973      0t0  TCP *:global-wlink (LISTEN)
sshd       1210    root    3u  IPv4  10982      0t0  TCP *:ssh (LISTEN)
sshd       1210    root    4u  IPv6  10984      0t0  TCP *:ssh (LISTEN)
pbx_excha  1361    root    6u  IPv6  11572      0t0  TCP *:veritas_pbx (LISTEN)
pbx_excha  1361    root    7u  IPv4  11577      0t0  TCP *:veritas_pbx (LISTEN)
pbx_excha  1361    root    8u  IPv4  11578      0t0  TCP 127.0.0.1:arbortext-lm (LISTEN)
pbx_excha  1361    root    9u  IPv4  11579      0t0  TCP 127.0.0.1:43990 (LISTEN)
master     1598    root   12u  IPv4  11728      0t0  TCP 127.0.0.1:smtp (LISTEN)
vnetd      1656    root    5u  IPv4  11149      0t0  TCP *:vnetd (LISTEN)
bpcd       1683    root    6u  IPv4  11176      0t0  TCP *:bpcd (LISTEN)
cupsd      2660    root    4u  IPv4   7277      0t0  TCP 127.0.0.1:ipp (LISTEN)
cupsd      2660    root    5u  IPv6   7278      0t0  TCP ::1]:ipp (LISTEN)

and here is the error_log:

http://pastebin.com/PZymJdxE

I don’t see any evidence that cupsd is listening on UDP port 631 (as expected)

For example I get

tcp        0      0 0.0.0.0:631             0.0.0.0:*               LISTEN      610/cupsd           
tcp        0      0 :::631                  :::*                    LISTEN      610/cupsd

Maybe you are using polling rather than browsing? I’ve only ever used the browsing method, and the first few lines of /etc/cups/cupsd.conf are as follows

LogLevel warn
SystemGroup sys root
Port 631
Listen /var/run/cups/cups.sock
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseRemoteProtocols cups
BrowseLocalProtocols cups

If polling from the client, do you have /etc/cups/client.conf?

See the following if you want further calification about browsing vs polling:

I tried the netstat command on one of the others pcs that still can use the printers they were confogured the same way but the other pc has opensuse 13.1 on it,
and the other pc has indeed this tcp 631 line shown. So i would say that the cupsd is not listening on the first pc is the error i need to solve.
But how to do that? I tried to restard the daemon but it does not seem to work then. What is strange too is when openning the yast printer options it seems that i have to reselect the option with the printer server list everytime.
Maybe there is something blocking the cupsd from strarting properly on the client?

Just to clarify that we’re referring to the client with openSUSE 12.2, right? (Socket-activation was brought in with openSUSE 13.1 which uses systemd, and works slightly differently.)

Can you share the first few lines of /etc/cups/cupsd.conf? Do you have /etc/cups/client.conf configured? If so, post that too.

Iam talking about the 12.2 client yes.
The cupsd.conf on it looks like this:


<Policy allowallforanybody>
  <Limit All>
    Order deny,allow
    Allow from all
  </Limit>
</Policy>
# Explicitly set the CUPS 'default' policy to be used by default:
DefaultPolicy default
# End of additions by SUSE.

# 2012-11-22,13:28:26 modify_cupsd_conf Browsing On
# 2012-11-22,13:28:26 modify_cupsd_conf BrowsePoll server1 server2
# 2014-11-06,10:47:02 modify_cupsd_conf Browsing On
# 2014-11-06,10:47:02 modify_cupsd_conf BrowsePoll server1 server2
# 2014-11-06,10:52:59 modify_cupsd_conf BrowseAllow none
# 2014-11-06,10:52:59 modify_cupsd_conf Browsing On
# 2014-11-06,10:52:59 modify_cupsd_conf BrowsePoll server1 server2

server1 and server2 are replacements for the real adresses.

I never configured anything but one thing: i added the printer servers to the yast -> printer options and then it worked.
The /etc/cups/client.conf looks unconfigured, commented out.

Are you sure? Is that all there is to it? It looks like you’ve just pasted the last part of it here. You should have add entries similar to what I posted, along with the expected policies.

There should also be /etc/cups/cupsd.conf.default (supplied by cups package), and I’d consider overwriting cupsd.conf with

cp /etc/cups/cupsd.conf.default /etc/cups/cupsd.conf

The default file has entries that make CUPS listen on port 631, so cupsd would pick up on the CUPS server broadcasts. (Although this isn’t required if you are using CUPS polling instead.)

2012-11-22,13:28:26 modify_cupsd_conf Browsing On

2012-11-22,13:28:26 modify_cupsd_conf BrowsePoll server1 server2

2014-11-06,10:47:02 modify_cupsd_conf Browsing On

2014-11-06,10:47:02 modify_cupsd_conf BrowsePoll server1 server2

2014-11-06,10:52:59 modify_cupsd_conf BrowseAllow none

2014-11-06,10:52:59 modify_cupsd_conf Browsing On

2014-11-06,10:52:59 modify_cupsd_conf BrowsePoll server1 server2

server1 and server2 are replacements for the real adresses.

I never configured anything but one thing: i added the printer servers to the yast → printer options and then it worked.
The /etc/cups/client.conf looks unconfigured, commented out.

That doesn’t make sense to me. There should be two ‘ServerName’ entries present somewhere (and that should be /etc/cups/client.conf AFAIU)

man client.conf

Maybe you have ‘BrowsePoll’ directives for the servers in /etc/cups/cupsd.conf?

I think you should read this too

https://www.cups.org/documentation.php/doc-1.5/sharing.html

In particular, the section ‘Automatic Configuration using CUPS Browsing’ and ‘Seeing Printer on Other Subnets’ (which mentions how to add a ‘BrowsePoll’ entry using ‘cupsctl’). I think a bit of configuration should get you back up and running.

Yes you are right i missed the top part of the cupsd.conf, here is the full file:
http://pastebin.com/DuG8V6PD

And here is the client.conf
http://pastebin.com/0vTHVdMk

I still was not able to solve the problem by myself, maybe someone else has an idea?

I am wondering if the CUPS protocol needs to be explicitly specified in cupsd.conf for remote printers. Try adding the following

Maybe try adding the following


Port 631
BrowseRemoteProtocols CUPS

Then restart CUPS

rccups restart

You should probably look at /var/log/cups/error_log to see if you’re getting any cups-polld errors.