Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree - Users - 500 Internal Server Error #5

Open
utianayuba opened this issue Jun 3, 2016 · 6 comments
Open

Tree - Users - 500 Internal Server Error #5

utianayuba opened this issue Jun 3, 2016 · 6 comments

Comments

@utianayuba
Copy link

Hi,

Try to use this with number of users is around 1500.
The error appear when I click the Users tree.
The error message on the web:
"The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application."

::ffff:172.17.1.1 - - [04/Jun/2016 02:10:41] "GET /tree/CN=Users,DC=example,DC=com HTTP/1.1" 500 -
Any suggestion on this?

Best,

@stgraber
Copy link
Owner

stgraber commented Jun 3, 2016

Set DEBUG to True and try again

@utianayuba
Copy link
Author

Hi @stgraber,

Thanks for reply.

Web browser message:

File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1836, in call
return self.wsgi_app(environ, start_response)
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
Display the sourcecode for this frameOpen an interactive python shell in this framerv = self.dispatch_request()
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functionsrule.endpoint
File "/root/utian/samba4-manager-master/libs/ldap_func.py", line 516, in _decorator
return view_func(_args, *_kwargs)
File "/root/utian/samba4-manager-master/plugins/tree.py", line 45, in tree_base
"onelevel"), key=lambda entry: entry['name']):
File "/root/utian/samba4-manager-master/libs/ldap_func.py", line 233, in ldap_get_entries
attributes[key] = _ldap_decode_attribute(key, value)
File "/root/utian/samba4-manager-master/libs/ldap_func.py", line 497, in _ldap_decode_attribute
raise Exception("Unknown type: %s" % key)
Exception: Unknown type: logonHours

Console messages:

::ffff:172.17.1.1 - - [04/Jun/2016 02:24:11] "GET /tree/CN=Users,DC=example,DC=com HTTP/1.1" 500 -
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1836, in call
return self.wsgi_app(environ, start_response)
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functionsrule.endpoint
File "/root/utian/samba4-manager-master/libs/ldap_func.py", line 516, in _decorator
return view_func(_args, *_kwargs)
File "/root/utian/samba4-manager-master/plugins/tree.py", line 45, in tree_base
"onelevel"), key=lambda entry: entry['name']):
File "/root/utian/samba4-manager-master/libs/ldap_func.py", line 233, in ldap_get_entries
attributes[key] = _ldap_decode_attribute(key, value)
File "/root/utian/samba4-manager-master/libs/ldap_func.py", line 497, in _ldap_decode_attribute
raise Exception("Unknown type: %s" % key)
Exception: Unknown type: logonHours

@stgraber
Copy link
Owner

stgraber commented Jun 3, 2016

Can you see if something like this fixes it? http://paste.ubuntu.com/16960089/

@stgraber
Copy link
Owner

stgraber commented Jun 3, 2016

I'm not finding much information on the exact type of that field...

It's clearly not a string since that's what caused the error, it doesn't appear to be a list either, so kinda hoping it can be unpacked as a uint.

@utianayuba
Copy link
Author

Hi,

That patch resulting different error messages:

....................
File "/root/utian/samba4-manager-master/libs/ldap_func.py", line 516, in _decorator
return view_func(_args, *_kwargs)
File "/root/utian/samba4-manager-master/plugins/tree.py", line 45, in tree_base
"onelevel"), key=lambda entry: entry['name']):
File "/root/utian/samba4-manager-master/libs/ldap_func.py", line 233, in ldap_get_entries
attributes[key] = _ldap_decode_attribute(key, value)
File "/root/utian/samba4-manager-master/libs/ldap_func.py", line 487, in _ldap_decode_attribute
return struct.unpack("I", struct.pack("i", int(value)))[0]
ValueError: invalid literal for int() with base 10: '\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff'

Best,

@stgraber
Copy link
Owner

stgraber commented Jun 4, 2016

Fun, so not something that can be represented as a uint...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants