Bug 553147

Summary: Configuring printer in Yast2 fails to start CUPs server daemon
Product: [openSUSE] openSUSE 11.0 Reporter: Marc Chamberlin <marc>
Component: YaST2Assignee: Michal Zugec <mzugec>
Status: RESOLVED WONTFIX QA Contact: Jiri Srain <jsrain>
Severity: Major    
Priority: P5 - None CC: jsmeix
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 11.0   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Marc Chamberlin 2009-11-06 05:32:50 UTC
User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.15) Gecko/2009102100 SUSE/3.0.15-0.1 Firefox/3.0.15

I have gone through the process of configuring a printer, and was at a loss as to why it was always failing. Apparently upon completion, YaST's printer configuration tool fails to start up the CUPS server daemon. I discovered this by doing an rccups status immediately after using the YaST printer setup tool and discovered the CUPs daemon was NOT running. I then immediately started the cups server with rccups start and it would start running. This shows that while the printer configuration process works fine, and does not generate any configuration errors, that the CUPs daemon was not started properly, nor apparently is the CUPS daemon even tested to insure that it is up and running by YaST's printer setup tool.

THIS IS A SERIOUS FLAW! The user cannot use the CUP's web setup if the CUP's server is not up an running. The only other GUI that is capable of guiding a user through the process of setting up a printer is via YaST2. And if YaST2 fails then the user will be left in the dark without any understanding of why a printer is not working! I KNOW! TOOK ME HOURS AND HOURS TO TRACK THIS DOWN!

Reproducible: Always

Steps to Reproduce:
1. Set up a cupsd.conf with an error that prevents the CUPS daemon from running
2. Use YaST2 to configure a printer (an corrects the previous error)
3. Do an rccups status to determine if CUPs server is running.
Actual Results:  
CUPs server is not started nor tested properly to determine if it was successfully configured and started.

Expected Results:  
I expect the CUPs server to be started automatically, and tested, upon completion of the printer setup in YaST2
Comment 1 Johannes Meixner 2009-11-06 09:02:32 UTC
Do you really mean:
"Steps to Reproduce:
 1. Set up a cupsd.conf with an error that
    prevents the CUPS daemon from running"?

If you really mean this, it would make the bug report invalid.

What do you expect from YaST when the cupsd config file is broken?
Some kind of magic healer for any possible error?

When the cupsd config file /etc/cups/cupsd.conf is broken
there is a /etc/cups/cupsd.conf.default installed
which you can copy to /etc/cups/cupsd.conf as root with
  cp /etc/cups/cupsd.conf.default /etc/cups/cupsd.conf
to start cupsd with a clean default cupsd config file.


Instead of only long and verbose complaints you should have
better provided here also the hard facts which you provided
in you mail on opensuse@opensuse.org which I found there
by pure luck in
http://lists.opensuse.org/opensuse/2009-11/msg00258.html
--------------------------------------------------------------------
I looked at the y2log file ... and see several messages generated
by ... Crash.ycp ... Such as -

2009-11-05 09:41:29 <1> marcslaptop(13748) [YCP] Crash.ycp:51
  Read settings: $["all_failed":["printer.ycp"],
  "last_done":"printer_detection", "last_failed":["printer.ycp"]]
2009-11-05 09:41:29 <1> marcslaptop(13748) [YCP] Crash.ycp:68
  Written settings: $["all_failed":[], "last_done":"printer.ycp",
  "last_failed":[]]
--------------------------------------------------------------------
and in
http://lists.opensuse.org/opensuse/2009-11/msg00271.html
--------------------------------------------------------------------
I am using KDE 3.5. Here is the output from the rpm query that you requested.

marcslaptop:/var/log/cups # rpm -qa | grep 'yast'
yast2-update-2.16.10-4.1
yast2-irda-2.16.1-25.1
yast2-runlevel-2.16.5-15.1
yast2-security-2.16.1-16.1
yast2-iscsi-client-2.16.14-6.1
yast2-users-2.16.33-6.1
autoyast2-installation-2.16.19-0.1
yast2-pam-2.16.2-17.1
yast2-scanner-2.16.10-13.1
yast2-support-2.16.1-6.1
yast2-tv-2.16.6-7.1
yast2-network-2.16.48-3.1
yast2-printer-2.16.32-3.1
yast2-qt-2.16.53-5.1
yast2-libyui-2.16.48-3.1
yast2-ncurses-2.16.27-8.1
yast2-xml-2.16.1-14.1
yast2-ntp-client-2.16.9-11.1
yast2-mouse-2.16.1-26.1
yast2-sysconfig-2.16.0-28.1
yast2-nis-client-2.16.3-6.1
yast2-repair-2.16.12-4.1
yast2-online-update-frontend-2.16.15-6.1
yast2-inetd-2.16.0-27.1
yast2-trans-stats-2.15.0-87.1
yast2-core-2.16.51-6.1
yast2-ycp-ui-bindings-2.16.47-5.1
yast2-slp-2.16.0-25.1
yast2-hardware-detection-2.16.1-49.1
yast2-2.16.71-6.1
yast2-apparmor-2.16.4-4.1
yast2-vm-2.16.5-7.1
yast2-x11-2.15.12-15.1
yast2-ldap-2.16.0-52.1
yast2-restore-2.16.2-26.1
yast2-packager-2.16.53-3.1
yast2-metapackage-handler-0.8.5-16.1
yast2-ldap-client-2.16.16-6.1
yast2-mail-2.16.6-2.1
yast2-pkg-bindings-2.16.42-0.2
yast2-qt-pkg-2.16.49-0.1
yast2-backup-2.16.7-0.1
yast2-country-data-2.16.26-6.1
yast2-storage-lib-2.16.26-0.1
yast2-sound-2.16.11-6.1
yast2-firewall-2.16.2-25.1
yast2-country-2.16.26-6.1
yast2-bootloader-2.16.20-0.1
yast2-installation-2.16.50-3.1
yast2-add-on-2.16.8-6.1
yast2-profile-manager-2.16.1-27.1
yast2-control-center-2.16.2-11.1
yast2-control-center-qt-2.16.2-11.1
yast2-theme-openSUSE-2.16.38-2.1
yast2-perl-bindings-2.16.7-14.1
yast2-nfs-client-2.16.1-26.1
yast2-tune-2.16.2-2.1
yast2-online-update-2.16.15-6.1
yast2-sudo-2.16.1-27.1
yast2-transfer-2.16.1-76.1
yast2-storage-2.16.26-0.1
yast2-kerberos-client-2.16.11-9.1
yast2-samba-client-2.16.9-3.1
yast2-registration-2.16.7-4.1
yast2-samba-server-2.16.3-15.1
yast2-trans-en_US-2.16.9-1.1
yast2-ncurses-pkg-2.16.14-0.4
--------------------------------------------------------------------

You had a crash somewhere in YaST.
Note that I really mean "somewhere" because it is not necessarily
the printer module which actually crashed here but perhaps whatever
underlying YaST base stuff or whatever other YaST module which was
called by the YaST printer module (e.g. the package install module
or the module to start and stop services like the cupsd or
whatever else...).

To analyze the crash wee need your complete YaST log files.
We need the history of what happened before the crash.

Regarding how to attach a log for bugs related to YaST see
http://en.opensuse.org/Bugs/YaST
Comment 2 Johannes Meixner 2009-11-06 09:11:37 UTC
The issue here is about openSUSE 11.0 - i.e. the one with
the old YaST printer module yast2-printer-2.16.32
which is known to destroy sometimes /etc/cups/cupsd.conf
because it uses the YaST "INI" agent to manipulate cupsd.conf
but the "INI" agent is either insufficient for config files
like cupsd.conf or nobody can tame the "INI" agent beast
to work even for cupsd.conf ;-)
Comment 3 Marc Chamberlin 2009-11-06 22:12:38 UTC
I will respond to some of your comments, the rest I will ignore for the moment, as I think you are confused about the purpose of this bug report.

> Do you really mean:
> "Steps to Reproduce:
>  1. Set up a cupsd.conf with an error that
>     prevents the CUPS daemon from running"?
>
> If you really mean this, it would make the bug report invalid.


No, that step is probably not necessary. I added it just to simulate the sort of problem I was having. The point was to try and use YaST's printer setup process to correct the artificially introduced error, and see if the ability to print to a printer would work, AFTER completing the setting up of the printer via YaST. But because the YaST printer setup does not start the CUP's server daemon, and reports everything was a success, the user is left wondering why he/she cannot print something, after completing the printer setup steps. 

THIS is the point of this bug report! Not that there was an error in my CUP's configuration file, that I wanted to have "magically healed", but that YaST did NOT properly guide me to a solution for getting the printing subsystem up and running. Instead it mislead me and gave no indication about whether the CUPs server was actually running or not. It implied that everything was OK in fact! And as I eventually found out that was NOT the case. The CUPs server was not restarted by YaST, and therefore not running, and therefore I became confused as to why not! If there was a problem then I should have been given a very plain warning that it had failed, and possibly an explanation as to why.. 

But in fact, there was NO failure of misconfiguration, YaST simply is not even trying to start the CUPs server apparently, or testing it! Therefore the setup of a printer is incomplete and this will confuse users! Because I could not print, after using YaST, my assumption was that I must be configuring things wrong, or some other kind of problem existed. (Man I spent hours trying to guess what was wrong! Chasing things like possible authorization problems, wondering if the firewall was screwed up.. etc)  In order to print, the CUPS server must be started, and why should a user have to KNOW that this step must be done manually and separately? I sure didn't, YaST sure as heck did not tell me, so I assumed YaST was attempting to start the CUPs server and would report any problems if any were encountered! Most other YaST routines that configure some server DO in fact attempt to restart their associated server. Any user is going to make this same assumption, that once done configuring a printer in YaST, that one should be able to IMMEDIATELY start printing! Therefore the CUP's server should have been restarted, as part of the printer setup process, in order to allow a user to print.


> Instead of only long and verbose complaints you should have
> better provided here also the hard facts which you provided
> in you mail on opensuse@opensuse.org which I found there
> by pure luck in
> http://lists.opensuse.org/opensuse/2009-11/msg00258.html

What you found was some of my early attempts at trying to figure out what was wrong, before I eventually came to realize that YaST was misleading me. There may indeed be other errors that need to be address, with crashes and/or misconfigured CUPs files... I am not yet ready to address those or submit a bug report against them yet..

My "long and verbose complaint" here was to try and provide enough information to differentiate between problems caused by a misconfiguration of a printer, and problems cause by a tool that is incorrectly doing the job expected of it, i.e. guiding the user to a complete and acceptable solution.

Let me study the crash issue further, and if I can replicate it, I will submit a separate bug report. But again, let me repeat, the crash is NOT the point of this bug report. The incorrect behavior of the YaST printer setup tool is. IT IS FAILING TO AUTOMATICALLY RESTART THE CUPS SERVER DAEMON UPON COMPLETION OF THE SETUP PROCESS. 

I don't believe the YaST printer setup is even trying to restart the CUPS Server daemon, since I can do so immediately, and without any problems, manually, after I have completed the YaST printer setup process.
Comment 4 Johannes Meixner 2009-11-10 09:06:00 UTC
When it doesn't crash, the old (up to 11.0) YaST printer module
does actually a cupsd restart much too often, compare bug #116446.

If it wouldn't restart the cupsd, we would have got zillions
of bug reports like your's but actually we didn't which shows
that it works o.k. - provided it does not crash.
Comment 5 Michal Zugec 2009-11-18 13:09:26 UTC
This works fine in new yast2-printer (11.1 and newer) because of completely rewrite of this yast module (unfortunately not backported). It's not security issue so I won't fix it, but patches are welcome ...