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 seafile.sh and seahub.sh, 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/exception.py”, 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/base.py”, 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/locale.py”, 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/lru_cache.py”, 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/i18n.py”, 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/functional.py”, line 35, in get
res = instance.dict[self.name] = self.func(instance)
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/urls/resolvers.py”, 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/functional.py”, line 35, in get
res = instance.dict[self.name] = self.func(instance)
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/thirdpart/Django-1.11.15-py2.7.egg/django/urls/resolvers.py”, line 400, in urlconf_module
return import_module(self.urlconf_name)
File “/usr/lib/python2.7/importlib/init.py”, line 37, in import_module
import(name)
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/seahub/utils/rooturl.py”, 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/init.py”, line 50, in include
urlconf_module = import_module(urlconf_module)
File “/usr/lib/python2.7/importlib/init.py”, line 37, in import_module
import(name)
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/seahub/urls.py”, 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/file.py”, line 41, in
from seahub.wopi.utils import get_wopi_dict
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/seahub/wopi/utils.py”, line 7, in
import requests
File “/home/bananapi/seafile/seafile-server-6.3.4/seahub/thirdpart/requests-2.18.4-py2.7.egg/requests/init.py”, 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/utils.py”, 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/_internal_utils.py”, 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/compat.py”, 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?