tpokorra / KolabScripts

some scripts useful for Kolab3 and higher, written by TBits.net, including patches already submitted to Kolab Bugzilla
14 stars 13 forks source link

kolab add-user ends up with BadStatusLine error #57

Open tpokorra opened 9 years ago

tpokorra commented 9 years ago

this happens on centos7 kolab 3.4 and fedora 22 kolab master. I have executed the initssl and initmultidomain scripts. see also https://issues.kolab.org/show_bug.cgi?id=2716 and http://lists.kolab.org/pipermail/users/2015-May/019385.html

[root@56-centos7stable kolab]# kolab add-user

1) Kolab User
3) Mail-enabled POSIX User
2) POSIX User
5) Mail Forwarding
4) Contact

Please select the user type: 1
Choose the preferredlanguage value [en_US]:
Choice (type '?' for options): 
givenname: Timotheus
sn: Pokorra
Traceback (most recent call last):
  File "/usr/sbin/kolab", line 39, in <module>
    kolab = Cli()
  File "/usr/lib/python2.7/site-packages/pykolab/cli/__init__.py", line 69, in __init__
    commands.execute('_'.join(to_execute))
  File "/usr/lib/python2.7/site-packages/pykolab/cli/commands.py", line 138, in execute
    commands[cmd_name]['function'](conf.cli_args, kw)
  File "/usr/lib/python2.7/site-packages/pykolab/cli/cmd_add_user.py", line 37, in execute
    wap_client.user_add()
  File "/usr/lib/python2.7/site-packages/pykolab/wap_client/__init__.py", line 542, in user_add
    params = get_user_input()
  File "/usr/lib/python2.7/site-packages/pykolab/wap_client/__init__.py", line 262, in get_user_input
    attribute_values = form_value_select_options('user', user_type_id, attribute)
  File "/usr/lib/python2.7/site-packages/pykolab/wap_client/__init__.py", line 174, in form_value_select_options
    return request('POST', 'form_value.select_options', post=post)
  File "/usr/lib/python2.7/site-packages/pykolab/wap_client/__init__.py", line 378, in request
    response_data = request_raw(method, api_uri, get, post, headers)
  File "/usr/lib/python2.7/site-packages/pykolab/wap_client/__init__.py", line 407, in request_raw
    response = conn.getresponse()
  File "/usr/lib64/python2.7/httplib.py", line 1045, in getresponse
    response.begin()
  File "/usr/lib64/python2.7/httplib.py", line 409, in begin
    version, status, reason = self._read_status()
  File "/usr/lib64/python2.7/httplib.py", line 373, in _read_status
    raise BadStatusLine(line)
httplib.BadStatusLine: ''
tpokorra commented 9 years ago

strange, when I type single letter for givenname and surname, it works.

it also works for longer names with kolab add-user -d 9

has this already been fixed in master?

tpokorra commented 9 years ago

ah, I think the solution is this commit: https://cgit.kolab.org/pykolab/commit/pykolab/wap_client/__init__.py?id=8755e0d1f12e96911859d9057424d1d9045a2e46

it is about a timeout issue, and catches the BadStatusLine exception

tpokorra commented 9 years ago

TODO see if fedora 22 master test works now on LBS