Page 1 of 1

problem with cups <SOLVED>

Posted: Wed Mar 11, 2020 5:44 pm
by javiercamano90
Hi,

i print from my brother printer model HL1202 from several months ago and recently i couldn't do it anymore, because of a problem with the "cups", when i go to the printers icon, i realize that i was not connected to the server and i get this messages:
1.- "failed to connect to server"
2.- cups service stopped, the cups print spooler does not appear to be running. To correct this, choose system-> Administration->Services from the main menu and look for the "cups" service.
what can i do?

Best regards

Javier

Re: problem with cups

Posted: Sun Mar 15, 2020 11:15 pm
by B2WJ
Sorry to have missed your post earlier in the week, @javiercamano90. You must be using Mint Mate or Cinnamon and because I'm currently on my Mint 19.3 Xfce computer I don't have "system-> Administration->Services" so try restarting CUPS from the terminal using:

Code: Select all

sudo /etc/init.d/cups restart
If that doesn't get the Brother printing once again, access the CUPS web interface by pasting http://localhost:631/admin (also http://127.0.0.1:631/) into a browser. When the Administration page comes up select "Manage Printers." See if your Brother HL1202 is there. You may need to reconnect it and should you find managing printers from the CUPS interface too difficult close it and open a terminal or press alt+F2. In the terminal type:

Code: Select all

system-config-printer
And press Enter.

This will open a configuration utility that allows you to select printer drivers and otherwise configure your printer. If the utility is not installed (it should be by default in all more recent Mint series), you need to install the package:

Code: Select all

system-config-printer-gnome
You can also access the configuration utility from the Start Menu but because I don't know what Mint desktop you're using I can't direct you.

As I said hopefully all it will take is the restart method I provided. Should all else fail, however, you will want to enable CUPS debug logging through "cupsctl."

In Mint and all other Ubuntu flavours (also Kubuntu and server editions) you can run:

Code: Select all

$ sudo cupsctl Loglevel=debug
to enable debug logging. An alternate command with the same function is:

Code: Select all

cupsctl --debug-logging
Disabling CUPS debug logging is also done via cupsctl:

Code: Select all

cupsctl --no-debug-logging
Then restart CUPS again using:

Code: Select all

sudo /etc/init.d/cups restart
Once you have enabled debug in CUPS, you will want to review the bug report. It is located under Home->File System in /var/log/cups/error_log. Or you can review it from the terminal by accessing it as root. To view the file run:

Code: Select all

$ sudo less /var/log/cups/error_log
and to copy it for attaching to </> here run:

Code: Select all

$ sudo cp /var/log/cups/error_log ~
$ sudo chmod 777 ~/error_log

Re: problem with cups

Posted: Mon Mar 16, 2020 3:54 pm
by javiercamano90
Hi B2WJ,

I'm using the desktop Cinnamon, i can't connect to http://localhost:631/admin or http://127.0.0.1:631/), i find weird the fact that my printer was operative a few days ago and now it's not :(

Thanks for your help

Best regards

Javier

Re: problem with cups

Posted: Mon Mar 16, 2020 4:49 pm
by B2WJ
javiercamano90 wrote: Mon Mar 16, 2020 3:54 pm I'm using the desktop Cinnamon, i can't connect to http://localhost:631/admin or http://127.0.0.1:631/), i find weird the fact that my printer was operative a few days ago and now it's not :(
You are our second Mint user in 11-day period unable to reach http://localhost:631/admin or http://127.0.0.1:631/. Very strange as you say about this happening for no apparent reason; it's as though the Common UNIX Printing System (CUPS) is vanishing from your computers. What response did the terminal give you when you entered the command

Code: Select all

sudo /etc/init.d/cups restart
?
If you determine CUPS has in fact vanished from your computer, to install it on your Linux Mint computer like with any Ubuntu computer, simply use sudo with the apt command and give the packages to install as the first parameter. A complete CUPS install has many package dependencies, but all may be specified on the same command line. Enter the following at a terminal prompt to install CUPS:

Code: Select all

sudo apt install cups
Upon authenticating with your user password, the packages should be downloaded and installed without error. Upon the conclusion of installation, the CUPS server will be started automatically.

Re: problem with cups

Posted: Mon Mar 16, 2020 6:19 pm
by javiercamano90
Hi B2WJ,

This is the output from the terminal when i write "sudo /etc/init.d/cups restart":

[ ok ] Restarting cups (via systemctl): cups.service.

i'm still unable to connect to the localhost:631 and i have already downloaded the cups, but the problem persists :(

Best regards

Javier

Re: problem with cups

Posted: Mon Mar 16, 2020 7:00 pm
by B2WJ
Alright, javiercamano90, that "[ ok ]" with restart confirmation is what you should see. CUPS still intact. So the first thing to determine is whether your version of CUPS may be using an outdated certificate/encryption protocol. OpenSSL should be able to tell you whether the server is available, and if so, which encryption protocols it supports and if the certificate is valid. Try running this command:

Code: Select all

openssl s_client -connect localhost:631

Re: problem with cups

Posted: Mon Mar 16, 2020 7:49 pm
by javiercamano90
Hi,

Here is the output from the terminal because of the code "openssl s_client -connect localhost:631"

140148229895168:error:0200206F:system library:connect:Connection refused:crypto/bio/b_sock2.c:110:
140148229895168:error:2008A067:BIO routines:BIO_connect:connect error:crypto/bio/b_sock2.c:111:
connect:errno=111

Best regards

Javier

Re: problem with cups

Posted: Mon Mar 16, 2020 9:43 pm
by B2WJ
Since the connection is refused there is either no server at this address or a firewall is blocking the connection. Not much more can be said from the information received but did you add or make adjustments to a firewall around the time you lost print ability? The codes 110 and 111 are generally caused by:
  • An application-level or system-level firewall on the local machine
  • A firewall on the same physical network or upstream network
To investigate, use tcptraceroute to determine which host is refusing the connection. TCP Traceroute uses TCP packets so can bypass the most common firewall filters. To run TCP Traceroute in Linux Mint open the Terminal >> type the following command >> press Enter:

Code: Select all

traceroute http://localhost:631/admin
or

Code: Select all

traceroute http://127.0.0.1:631/
You may need to put "sudo" in front for root, but try the above syntax first. It's also possible including "http://" won't be necessary. If traceroute is not installed in Cinnamon you will need to install it. The command to install traceroute is

Code: Select all

sudo apt-get install traceroute

Re: problem with cups

Posted: Mon Mar 16, 2020 11:20 pm
by javiercamano90
Hi,

i've installed traceroute as you said, this is the output:

http://localhost:631/admin: Nombre o servicio desconocido
Cannot handle "host" cmdline arg `http://localhost:631/admin' on position 1 (argc 1)

perhaps it's the firewall, i've tried to modify the configuration from there, but nothing...

Javier

Re: problem with cups

Posted: Tue Mar 17, 2020 10:14 am
by B2WJ
So, "Unknown name or service." You might have a DNS problem. Did you also try the IP address (127.0.0.1:631) instead of the domain name to see what happens? If you did not and IP works then you need to look at your DNS setup. DNS settings are changed in /etc/resolv.conf.

A simple solution when one can't connect to localhost:631 -- though I confess very likely won't help your circumstance -- is to try changing the proxy settings in your browser to "no proxy." Then restart the browser, enter "localhost:631" in the address bar and you may get the CUPS server. If not, simply go to your terminal and enter:

Code: Select all

sudo cups restart

Re: problem with cups

Posted: Tue Mar 17, 2020 11:55 pm
by javiercamano90
Hi,

As you said before, "sudo cups restart" didn't work for me, is there a chance that you guide me how to configure the DNS, i really like this operative system, i was thinking to format my pc and re-install linux mint 19.2 to correct the problem.

best regards

Javier

Re: problem with cups

Posted: Wed Mar 18, 2020 10:21 am
by B2WJ
Can try, Javier. But first, we need to be sure you may have a DNS issue. Did you also try TCP Traceroute for the following?

Code: Select all

traceroute http://127.0.0.1:631/
As I said, if you get response there, it must be DNS. If no response, there are about six more tests I can think of. As you know, DNS stands for Domain Name System, or Domain Name Server. DNS resolves an IP address to a hostname or vice versa.

Also, did you ever try Cinnamon's instruction to navigate to System-> Administration->Services from the main menu and look for the "CUPS" service? As I said, I use Mate and Xfce on two PCs so can't mimic that, but please check that out and let me know what you find, and then check if CUPS continues running with:

Code: Select all

ps -ef |grep cups
And let's see if there is a problem with your network setup:

Code: Select all

ping localhost
Last, two questions for you:
  • What firewall are you using -- the standard Linux Mint one? Whatever the firewall, I'm wondering if you may have momentarily shut it down to see if that helped. Obviously not a solution -- as you need to keep firewall active -- but it would eliminate one possibility.
  • What browser are you using, the standard Firefox issue? If you have another -- perhaps Chromium or Opera -- see if you can reach the CUPS domain and URL from one or both of those.
P.S. I will be away from computers for much of today and tomorrow. I understand if you become frustrated and wish to revert to Mint 19.2. But I find 19.3 to be a fine improvement so hope you can avoid that. Plus I don't know if you have many files already on 19.3 -- a big hassle.

Re: problem with cups

Posted: Mon Mar 23, 2020 3:32 am
by jet1946
These symptoms match mine exactly. Linux Mint 19.3, Cinnamon 4.4.8, Linux Kernel 5.3.0-42-generic.