Bug 239805 - failed when saving "share published printers connected to this system"
failed when saving "share published printers connected to this system"
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: system-config-printer (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
: Reopened
Depends On:
Blocks: F7Update
  Show dependency treegraph
 
Reported: 2007-05-11 09:55 EDT by eric magaoay
Modified: 2007-11-30 17:12 EST (History)
2 users (show)

See Also:
Fixed In Version: 0.7.63.2-2.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-06-13 17:04:56 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
cupsd config file (2.39 KB, application/octet-stream)
2007-05-23 12:11 EDT, eric magaoay
no flags Details

  None (edit)
Description eric magaoay 2007-05-11 09:55:49 EDT
Description of problem:
I received the following traceback when trying to apply/save the following option:
"Server Settings" > "[x]Share published printers connected to this system" 

Traceback (most recent call last):
  File "/usr/share/system-config-printer/system-config-printer.py", line 1099,
in on_btnApply_clicked
    err = self.apply()
  File "/usr/share/system-config-printer/system-config-printer.py", line 1110,
in apply
    return self.save_serversettings()
  File "/usr/share/system-config-printer/system-config-printer.py", line 3109,
in save_serversettings
    self.cups.adminSetServerSettings(setting_dict)
RuntimeError: Failed to set settings

Version-Release number of selected component (if applicable):
system-config-printer 0.7.63.1.x86_64

How reproducible:
persistent

Steps to Reproduce:
1. system-config-printer
2. Select the following options
   "Server Settings" > "[x]Share published printers connected to this system"
3. Press [apply] button
  
Actual results:
display traceback shown above
Comment 1 Tim Waugh 2007-05-23 08:09:15 EDT
Do you still see this?  Can you attach your /etc/cups/cupsd.conf file please?
Comment 2 eric magaoay 2007-05-23 12:11:58 EDT
Created attachment 155271 [details]
cupsd config file
Comment 3 Nils Philippsen 2007-05-26 09:47:02 EDT
I see this with a pristine cupsd.conf from cups-1.2.10-10.fc7 -- I upgraded from
FC6 to F7, then moved the cupsd.conf.rpmnew over the old cupsd.conf file, then
started s-c-printer and attempted to share the printers as described above.
Comment 4 Tim Waugh 2007-05-29 14:04:59 EDT
Hmm, I haven't been able to reproduce that behaviour here.  If you fetch
1.2.0-11.fc7 from here (both the cups and cups-libs packages):

http://koji.fedoraproject.org/koji/taskinfo?taskID=19891

can you still reproduce the problem?
Comment 5 eric magaoay 2007-05-29 14:36:29 EDT
I just installed and tested i386 build tree, cups-1.2.10-10.fc7 works OK while
it failed under x86_64. I will re-install x86_64 again, and update to 1.2.10-11.fc7

I will update on the result a little later today.  
Comment 6 eric magaoay 2007-05-29 20:05:43 EDT
The mirror I'm using do not have the complete x86_64 build tree at the moment.
The missing files are the boot files that reside beneath isolinux and images
directory. I can't install the system without the boot files. Will try again
later...
Comment 7 Nils Philippsen 2007-05-30 09:05:03 EDT
This is on x86_64, the traceback is when trying to apply the changed server
settings:

root@wombat:~> system-config-printer
Traceback (most recent call last):
  File "/usr/share/system-config-printer/system-config-printer.py", line 1099,
in on_btnApply_clicked
    err = self.apply()
  File "/usr/share/system-config-printer/system-config-printer.py", line 1110,
in apply
    return self.save_serversettings()
  File "/usr/share/system-config-printer/system-config-printer.py", line 3109,
in save_serversettings
    self.cups.adminSetServerSettings(setting_dict)
RuntimeError: Failed to set settings
root@wombat:~> rpm -q system-config-printer cups cups-libs
system-config-printer-0.7.63.1-1.fc7
cups-1.2.10-11.fc7
cups-libs-1.2.10-11.fc7
cups-libs-1.2.10-11.fc7
root@wombat:~> 
Comment 8 Tim Waugh 2007-05-30 09:53:26 EDT
I haven't been able to reproduce this, even on x86_64. :-(

Nils, would it be possible for you to try single-stepping through the
_cupsAdminSetServerSettings() function to see where it fails?  This function
comes from libcups, cups-1.2.10/cups/adminutil.c in the source.

Once you've installed cups-debuginfo-1.2.10-11.fc7 you should be able to do this:

$ gdb --args python /usr/sbin/system-config-printer
(gdb) b _cupsAdminSetServerSettings
(gdb) run

and get a prompt at the point you press Apply.
Comment 9 Nils Philippsen 2007-05-30 11:57:02 EDT
Is the following enough?

971     {
(gdb) 
(gdb) list
966     int                                     /* O - 1 on success, 0 on failure */
967     _cupsAdminSetServerSettings(
968         http_t        *http,                /* I - Connection to server */
969         int           num_settings,         /* I - Number of settings */
970         cups_option_t *settings)            /* I - Settings */
971     {
972       int           i;                      /* Looping var */
973       http_status_t status;                 /* GET/PUT status */
974       const char    *server_port_env;       /* SERVER_PORT env var */
975       int           server_port;            /* IPP port for server */
(gdb) n
1013      _cups_globals_t *cg = _cupsGlobals(); /* Global data */
(gdb) n
1020      if (!http || !num_settings || !settings)
(gdb) n
1013      _cups_globals_t *cg = _cupsGlobals(); /* Global data */
(gdb) n
1020      if (!http || !num_settings || !settings)
(gdb) n
1022        _cupsSetError(IPP_INTERNAL_ERROR, NULL);
(gdb) n
1834    }
(gdb) n
0x00002aaab0be0839 in ?? () from /usr/lib64/python2.5/site-packages/cups.so
(gdb) n
Cannot find bounds of current function
(gdb) 
Comment 10 Tim Waugh 2007-05-30 14:25:39 EDT
Do you have the rest of that session still saved?  I would like to know what
http, num_settings, and settings, are..
Comment 11 Nils Philippsen 2007-05-31 04:10:57 EDT
I've just repeated what I did above, then single steppeed past the
_cupsSetError() call:

(gdb) print http
$1 = (http_t *) 0xc5a5e0
(gdb) print num_settings
$2 = 0
(gdb) print settings
$3 = (cups_option_t *) 0x0
Comment 12 Tim Waugh 2007-06-04 13:43:50 EDT
Can you try adjusting /usr/share/system-config-printer/system-config-printer.py
so that it looks like this, starting at line 3108?:

        try:
            print setting_dict ## i.e. just add this line
            self.cups.adminSetServerSettings(setting_dict)
        except cups.IPPError, (e, m):
            self.show_IPP_Error(e, m)
            return True

What it setting_dict before the call to set the settings?
Comment 13 Nils Philippsen 2007-06-04 14:25:01 EDT
setting_dict is:

{'SystemGroup': 'sys root', '_remote_admin': '0', 'DefaultAuthType': 'Basic',
'_share_printers': '1', '_debug_logging': '0', '_remote_printers': '1',
'_user_cancel_any': '0'}
Comment 14 Tim Waugh 2007-06-07 13:28:42 EDT
Please get system-config-printer-0.7.63.2-1.fc7 from updates-testing and then
run this in a terminal:

PYCUPS_DEBUG=1 /usr/sbin/system-config-printer

When you trigger the problem this time, we should get to see what values the
Python bindings saw.
Comment 15 Nils Philippsen 2007-06-08 04:44:16 EDT
root@wombat:~> PYCUPS_DEBUG=1 /usr/sbin/system-config-printer
-> Connection_init()
httpConnectEncrypt(...)
<- Connection_init() = 0
-> Connection_getPrinters()
cupsDoRequest("/")
Attribute: printer-is-shared
Added printer-is-shared to dict
Attribute: printer-state
Added printer-state to dict
Attribute: printer-state-message
Added printer-state-message to dict
Attribute: printer-state-reasons
-> build_list_from_attribute_strings()
none
<- build_list_from_attribute_strings()
Added printer-state-reasons to dict
Attribute: printer-type
Added printer-type to dict
Attribute: printer-uri-supported
Added printer-uri-supported to dict
Attribute: printer-name
Attribute: printer-location
Added printer-location to dict
Attribute: printer-info
Added printer-info to dict
Attribute: device-uri
Added device-uri to dict
Attribute: printer-make-and-model
Added printer-make-and-model to dict
Attribute: printer-is-shared
Added printer-is-shared to dict
Attribute: printer-state
Added printer-state to dict
Attribute: printer-state-message
Added printer-state-message to dict
Attribute: printer-state-reasons
-> build_list_from_attribute_strings()
none
<- build_list_from_attribute_strings()
Added printer-state-reasons to dict
Attribute: printer-type
Added printer-type to dict
Attribute: printer-uri-supported
Added printer-uri-supported to dict
Attribute: printer-name
Attribute: printer-location
Added printer-location to dict
Attribute: printer-info
Added printer-info to dict
Attribute: device-uri
Added device-uri to dict
Attribute: printer-make-and-model
Added printer-make-and-model to dict
<- Connection_getPrinters() = dict
-> Connection_getClasses()cupsDoRequest("/")
<- Connection_getClasses() = dict
-> Connection_adminSetServerSettings()
num_settings=0, settings=(nil)
<- Connection_adminSetServerSettings() EXCEPTION
Traceback (most recent call last):
  File "/usr/share/system-config-printer/system-config-printer.py", line 1106,
in on_btnApply_clicked
    err = self.apply()
  File "/usr/share/system-config-printer/system-config-printer.py", line 1117,
in apply
    return self.save_serversettings()
  File "/usr/share/system-config-printer/system-config-printer.py", line 3125,
in save_serversettings
    self.cups.adminSetServerSettings(setting_dict)
RuntimeError: Failed to set settings
Comment 16 Tim Waugh 2007-06-08 04:52:21 EDT
Can you try the change from comment #12 again?  This time it starts at line
3124.  I'd like to be able to catch both the 'print setting_dict' output from
the Python *and* the pycups debugging output saying what it found.  Thanks.
Comment 17 Nils Philippsen 2007-06-08 05:45:42 EDT
just the changed snippet:

Added printer-make-and-model to dict
<- Connection_getPrinters() = dict
-> Connection_getClasses()cupsDoRequest("/")
<- Connection_getClasses() = dict
{'SystemGroup': 'sys root', '_remote_admin': '0', 'DefaultAuthType': 'Basic',
'_share_printers': '1', '_debug_logging': '0', '_remote_printers': '1',
'_user_cancel_any': '0'}
-> Connection_adminSetServerSettings()
num_settings=0, settings=(nil)
<- Connection_adminSetServerSettings() EXCEPTION
Comment 18 Tim Waugh 2007-06-08 06:44:36 EDT
Can you please try these packages (system-config-printer and
system-config-printer-libs):

http://koji.fedoraproject.org/koji/taskinfo?taskID=30879

I think it might be to do with the fact that Python 2.5 changed the function
signature of PyDict_Next().
Comment 19 Tim Waugh 2007-06-08 07:39:14 EDT
This is the link to the actual packages:

http://koji.fedoraproject.org/koji/buildinfo?buildID=8397
Comment 20 eric magaoay 2007-06-08 14:03:21 EDT
Sorry Tim for not getting back too soon, got problem with the mirrors not
updating. Anyway, I just downloaded
system-config-printer-0.7.63.2-2.fc7.x86_64.rpm and it seem to work now. 

I can also see the share from remote client and did a quick test to print.
Result: Successful!

Great job... Closing this bug now.
Comment 21 Tim Waugh 2007-06-10 05:28:50 EDT
Thanks for testing.  I'll set this to MODIFIED until the update is actually pushed.
Comment 22 Fedora Update System 2007-06-11 18:03:41 EDT
system-config-printer-0.7.63.2-2.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.
Comment 23 Fedora Update System 2007-06-13 17:04:44 EDT
system-config-printer-0.7.63.2-2.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.