Internal Server error due to Python Problems



Hello there! :slight_smile:

I’m setting up a seafile server (Version 6.3.4) on a Raspbian Jessie. Im to the point where i can start and, but when trying to get to the Web interface, I’m getting an “Internal Server error”. Just to make sure: I understood that I don’t need apache2 or nginx and can run seahub just by its own, right?

In seahub.log i got the following, so i think there is a problem with the python packages (PS: No comment on using bananapi, i never had problems with it).

2018-11-07 13:52:46,334 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /favicon.ico
Traceback (most recent call last):
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/core/handlers/”, line 41, in inner
response = get_response(request)
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/core/handlers/”, line 244, in _legacy_get_response
response = middleware_method(request)
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/middleware/”, line 24, in process_request
i18n_patterns_used, prefixed_default_language = is_language_prefix_patterns_used(urlconf)
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/utils/”, line 100, in wrapper
result = user_function(*args, **kwds)
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/conf/urls/”, line 29, in is_language_prefix_patterns_used
for url_pattern in get_resolver(urlconf).url_patterns:
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/utils/”, line 35, in get
res = instance.dict[] = self.func(instance)
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/urls/”, line 407, in url_patterns
patterns = getattr(self.urlconf_module, “urlpatterns”, self.urlconf_module)
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/utils/”, line 35, in get
res = instance.dict[] = self.func(instance)
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/urls/”, line 400, in urlconf_module
return import_module(self.urlconf_name)
File “/usr/lib/python2.7/importlib/”, line 37, in import_module
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/seahub/utils/”, line 41, in
url(r’^%s’ % settings.SITE_ROOT[1:], include(settings.SITE_ROOT_URLCONF)),
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/conf/urls/”, line 50, in include
urlconf_module = import_module(urlconf_module)
File “/usr/lib/python2.7/importlib/”, line 37, in import_module
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/seahub/”, line 12, in
from seahub.views.file import view_history_file, view_trash_file,
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/seahub/views/”, line 41, in
from seahub.wopi.utils import get_wopi_dict
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/seahub/wopi/”, line 7, in
import requests
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/thirdpart/requests-2.18.4-py2.7.egg/requests/”, line 97, in
from . import utils
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/thirdpart/requests-2.18.4-py2.7.egg/requests/”, line 26, in
from ._internal_utils import to_native_string
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/thirdpart/requests-2.18.4-py2.7.egg/requests/”, line 11, in
from .compat import is_py2, builtin_str, str
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/thirdpart/requests-2.18.4-py2.7.egg/requests/”, line 47, in
from urllib3.packages.ordered_dict import OrderedDict
ImportError: No module named ordered_dict


apt-get update && apt-get install python-setuptools python-imaging \ python-ldap python-mysqldb python-memcache python-urllib3 should help, but you should upgrade your OS first jessie ist LTS now, wheezy now deprecated.


Hello bionade24,

Actually I did update to jessie, why do you think i’m still on wheezy, are there any old repos? Tried to install these things, but python-ldap wasn’t found. Searched the web and installed python-dev libldap2-dev libssl-dev instead, restarted everything but still get an Internal Server Error. :confused:


But you need Debian 9 “Stretch”, not jessie. You don’t need ldap.


you must be using python package urllib3==v.1.24 and that version has compatibility issue with package requests==v.2.20.0
for now downgrade to urllib3==v.1.23 to resolve this issue


Thank you both!

@bionade24 updating to stretch didnt help, i tried a reinstall and that worked. @dony71 this could have been the problem, so i will mark this answer as solved as it could help others.


Is this a Pi version problem?