Bug 9945 - setting specific logger levels in smb.conf makes samba-tool drs showrepl crash
setting specific logger levels in smb.conf makes samba-tool drs showrepl crash
Status: RESOLVED FIXED
Product: Samba 4.0
Classification: Unclassified
Component: Python
4.0.6
All Linux
: P5 minor
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
: 12188 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-11 17:53 UTC by Michael De Groote
Modified: 2016-10-25 07:38 UTC (History)
3 users (show)

See Also:


Attachments
patches for 4.4.x and 4.5.x with cherry-pick information (6.69 KB, patch)
2016-09-23 11:00 UTC, Christian Ambach
abartlet: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael De Groote 2013-06-11 17:53:57 UTC
when setting e.g. the following in smb.conf

  log level = 2 acls:5

You get this when running samba-tool drs showrepl

root@samba4-3:/usr/local/samba# samba-tool drs kcc
ERROR(<type 'exceptions.ValueError'>): DRS connection to samba4-3.stp4.stp.internal failed - invalid literal for int() with base 10: '2 acls:5'
  File "/usr/local/samba/lib/python2.7/site-packages/samba/netcmd/drs.py", line 39, in drsuapi_connect
    (ctx.drsuapi, ctx.drsuapi_handle, ctx.bind_supported_extensions) = drs_utils.drsuapi_connect(ctx.server, ctx.lp, ctx.creds)
  File "/usr/local/samba/lib/python2.7/site-packages/samba/drs_utils.py", line 47, in drsuapi_connect
    if int(lp.get("log level")) >= 5:

When running with 

  log level = 2

Everything is fine.

For me, this is annoying, nothing more... It scared me off tho the first time i saw it :)

Version 4.1.0pre1-GIT-3b3b5b0
Distro: debian wheezy
Comment 1 Denis Cardon 2015-11-05 14:56:46 UTC
This isssue is still present in samba 4.3.1 / Debian Jessie / compiled from source :

# samba -V
Version 4.3.1

# cat /etc/samba/smb.conf | grep "log level"
    log level = 2 auth:4 dmapi:4 

# samba-tool  drs showrepl 
debug_lookup_classname(drsapi): Unknown class
ERROR(<type 'exceptions.ValueError'>): DRS connection to srvads.tranquilit.local failed - invalid literal for int() with base 10: '2 auth:4 dmapi:4 drsapi:9'
  File "/usr/local/samba/lib/python2.7/site-packages/samba/netcmd/drs.py", line 39, in drsuapi_connect
    (ctx.drsuapi, ctx.drsuapi_handle, ctx.bind_supported_extensions) = drs_utils.drsuapi_connect(ctx.server, ctx.lp, ctx.creds)
  File "/usr/local/samba/lib/python2.7/site-packages/samba/drs_utils.py", line 47, in drsuapi_connect
    if int(lp.get("log level")) >= 5:


Workaround : set debug level on the command line:

# samba-tool dns showrepl -d0
Comment 2 Christian Ambach 2016-09-16 09:01:29 UTC
*** Bug 12188 has been marked as a duplicate of this bug. ***
Comment 3 Christian Ambach 2016-09-23 11:00:00 UTC
Created attachment 12509 [details]
patches for 4.4.x and 4.5.x with cherry-pick information
Comment 4 Christian Ambach 2016-09-23 13:25:10 UTC
Karolin,

please pick for 4.4.x and 4.5.x.
Comment 5 Karolin Seeger 2016-10-19 06:50:58 UTC
(In reply to Christian Ambach from comment #4)
Pushed to autobuild-v4-{5,4}-test.
Comment 6 Karolin Seeger 2016-10-25 07:38:34 UTC
(In reply to Karolin Seeger from comment #5)
Pushed to both branches.
Closing out bug report.

Thanks!