Internal Server Error 7.1.3

today i’ve upgraded to 7.1.3 … but the webinterface shows internal server error

log shows many syntax errors like this:

2020-03-26 15:03:20,621 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /favicon.ico
Traceback (most recent call last):
File “/home/mario/haiwen/seafile-server-7.1.3/seahub/thirdpart/django/core/handlers/exception.py”, line 41, in inner
response = get_response(request)
File “/home/mario/haiwen/seafile-server-7.1.3/seahub/thirdpart/django/core/handlers/base.py”, line 244, in _legacy_get_response
response = middleware_method(request)
File “/home/mario/haiwen/seafile-server-7.1.3/seahub/thirdpart/django/middleware/locale.py”, line 24, in process_request
i18n_patterns_used, prefixed_default_language = is_language_prefix_patterns_used(urlconf)
File “/home/mario/haiwen/seafile-server-7.1.3/seahub/thirdpart/django/conf/urls/i18n.py”, line 29, in is_language_prefix_patterns_used
for url_pattern in get_resolver(urlconf).url_patterns:
File “/home/mario/haiwen/seafile-server-7.1.3/seahub/thirdpart/django/utils/functional.py”, line 35, in get
res = instance.dict[self.name] = self.func(instance)
File “/home/mario/haiwen/seafile-server-7.1.3/seahub/thirdpart/django/urls/resolvers.py”, line 407, in url_patterns
patterns = getattr(self.urlconf_module, “urlpatterns”, self.urlconf_module)
File “/home/mario/haiwen/seafile-server-7.1.3/seahub/thirdpart/django/utils/functional.py”, line 35, in get
res = instance.dict[self.name] = self.func(instance)
File “/home/mario/haiwen/seafile-server-7.1.3/seahub/thirdpart/django/urls/resolvers.py”, line 400, in urlconf_module
return import_module(self.urlconf_name)
File “/usr/lib/python3.5/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 986, in _gcd_import
File “”, line 969, in _find_and_load
File “”, line 958, in _find_and_load_unlocked
File “”, line 673, in _load_unlocked
File “”, line 673, in exec_module
File “”, line 222, in _call_with_frames_removed
File “/home/mario/haiwen/seafile-server-7.1.3/seahub/seahub/utils/rooturl.py”, line 41, in
url(r’^%s’ % settings.SITE_ROOT[1:], include(settings.SITE_ROOT_URLCONF)),
File “/home/mario/haiwen/seafile-server-7.1.3/seahub/thirdpart/django/conf/urls/init.py”, line 50, in include
urlconf_module = import_module(urlconf_module)
File “/usr/lib/python3.5/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 986, in _gcd_import
File “”, line 969, in _find_and_load
File “”, line 958, in _find_and_load_unlocked
File “”, line 673, in _load_unlocked
File “”, line 673, in exec_module
File “”, line 222, in _call_with_frames_removed
File “/home/mario/haiwen/seafile-server-7.1.3/seahub/seahub/urls.py”, line 8, in
from seahub.views.sysadmin import *
File “/home/mario/haiwen/seafile-server-7.1.3/seahub/seahub/views/sysadmin.py”, line 13, in
from openpyxl import load_workbook
File “/home/mario/haiwen/seafile-server-7.1.3/seahub/thirdpart/openpyxl/init.py”, line 6, in
from openpyxl.workbook import Workbook
File “/home/mario/haiwen/seafile-server-7.1.3/seahub/thirdpart/openpyxl/workbook/init.py”, line 4, in
from .workbook import Workbook
File “/home/mario/haiwen/seafile-server-7.1.3/seahub/thirdpart/openpyxl/workbook/workbook.py”, line 7, in
from openpyxl.worksheet.worksheet import Worksheet
File “/home/mario/haiwen/seafile-server-7.1.3/seahub/thirdpart/openpyxl/worksheet/worksheet.py”, line 392
return f"{get_column_letter(min_col)}{min_row}:{get_column_letter(max_col)}{max_row}"
^
SyntaxError: invalid syntax

What OS and version do you use?

Hi!
Same error here. I’m using Ubuntu 16.04.6 LTS server.

Same error here with Ubuntu 16.04.12 LTS after upgrading from 7.0.5 to 7.1.3

Same error, with DEBIAN 9.5 after upgrading from 7.0.5 to 7.1.3

I`ve update to pyhton 3.7.3 and the problem has solved
But now i have another.
when i create a folder to share (donwload) with password and time gave me this error

“Sorry, but the requested page is unavailable due to a server hiccup.”

[ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /d/66bcbaaab23d4f62bdf8/#012Traceback (most recent call last):#012 File “xxxxxxxxxxxxxxx/seafileseafile-server-7.1.3/seahub/thirdpart/django/core/handlers/exception.py”, line 41, in inner#012 response = get_response(request)#012 File “xxxxxxxxxxxxxxx/seafileseafile-server-7.1.3/seahub/thirdpart/django/core/handlers/base.py”, line 249, in _legacy_get_response#012 response = self._get_response(request)#012 File xxxxxxxxxxxxxxx/seafile/seafile-server-7.1.3/seahub/thirdpart/django/core/handlers/base.py", line 187, in _get_response#012 response = self.process_exception_by_middleware(e, request)#012 File “xxxxxxxxxxxxxxx/seafile/seafile-server-7.1.3/seahub/thirdpart/django/core/handlers/base.py”, line 185, in _get_response#012 response = wrapped_callback(request, *callback_args, **callback_kwargs)#012 File “/xxxxxxxxxxxxxxx/seafile/seafile-server-7.1.3/seahub/seahub/share/decorators.py”, line 21, in _decorated#012 return func(request, fileshare, *args, **kwargs)#012 File “xxxxxxxxxxxxxxx/seafile/seafile-server-7.1.3/seahub/seahub/share/decorators.py”, line 67, in _decorated#012 return func(request, *args, **kwargs)#012 File “/xxxxxxxxxxxxxxx/seafile-server-7.1.3/seahub/seahub/views/repo.py”, line 265, in view_shared_dir#012 if req_path[-1] != ‘/’:#012IndexError: string index out of range

this error only happen wiht password active in download link
upload link works with/out password
and download link wihtout password also works ok

It sounds like Seahub’s Github issue 4478 (can’t include links in my post).

yes is the same issue.
this only happens with password protected and download mode.
if you try without password it works and also with upload

Debian 9 here with Python 3.5 - same error like in my start post.

Ubuntu Server 16.04.6 LTS with Python 3.5 same problem.
Seemes like upgrading to 18.04 could fix the issue. I would probably try it.

Reverting back to 7.0.5 doesn’t solve a problem. :frowning:
I’ve got an Nginx error 502 Bad Gateway
In the log files there are tons of error messages
2020/03/30 12:09:46 [error] 371#371: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 37.192.131.XXX, server: example.ru, request: “GET /seafhttp/repo/9e3a5a24-2978-41ef-9f79-547607465ee4/commit/HEAD HTTP/1.1”, upstream: “http://127.0.0.1:8082/repo/9e3a5a24-2978-41ef-9f79-547607465ee4/commit/HEAD”, host: “example.ru

Python 3.6 or 3.7 is required.

That is the Problem, Debian 9 have only 3.5…

I’ve compiled python 3.7.7 and now following error appears:

2020-03-31 03:08:55,430 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /favicon.ico
Traceback (most recent call last):
File “/seafile/seafile-server-7.1.3/seahub/thirdpart/django/core/handlers/exception.py”, line 41, in inner
response = get_response(request)
File “/seafile/seafile-server-7.1.3/seahub/thirdpart/django/core/handlers/base.py”, line 244, in _legacy_get_response
response = middleware_method(request)
File “/seafile/seafile-server-7.1.3/seahub/seahub/base/middleware.py”, line 68, in process_request
cur_note = cache.get(‘CUR_TOPINFO’) if cache.get(‘CUR_TOPINFO’) else
File “/seafile/seafile-server-7.1.3/seahub/thirdpart/django/core/cache/backends/filebased.py”, line 40, in get
if not self._is_expired(f):
File “/seafile/seafile-server-7.1.3/seahub/thirdpart/django/core/cache/backends/filebased.py”, line 137, in _is_expired
exp = pickle.load(f)
ValueError: unsupported pickle protocol: 5

Probably install and upgrade scripts should check whether OS is not supported.
It shouldn’t be hard to implement.
Also I’ve checked documentation before upgrading to 7.1.3 and it obviously says Ubuntu 16.04 is supported. I’ve broken my installation with the last update. Reverting to 7.0.5 doesn’t work now either. :frowning:
It’s my fault also as I didn’t have enough free space to create VM image backup, but it’s documentation that leaded me to an error. :frowning:

We have had the same problem after upgrading from 7.0.5.

The exception is caused by the programming in seahub/views/repo.py, method view_shared_dir:

def view_shared_dir(request, fileshare):

    token = fileshare.token

    password_check_passed, err_msg = check_share_link_common(request, fileshare)
    if not password_check_passed:
        d = {'token': token, 'view_name': 'view_shared_dir', 'err_msg': err_msg}
        return render(request, 'share_access_validation.html', d)

    username = fileshare.username
    repo_id = fileshare.repo_id

    # Get path from frontend, use '/' if missing, and construct request path
    # with fileshare.path to real path, used to fetch dirents by RPC.
    req_path = request.GET.get('p', '/')
    if req_path[-1] != '/':  
        req_path += '/'

If a password is required, the data for the html template contains no path field, so
req_path is an empty string and req_path[-1] crashes.

Solutions:

  1. delete the path form variable from the template
    or
  2. check req_path for an empty string, i.e.
# Get path from frontend, use '/' if missing, and construct request path  
# with fileshare.path to real path, used to fetch dirents by RPC.
req_path = request.GET.get('p', '/')
if req_path=="" or req_path[-1] != '/':
    req_path += '/'
5 Likes

i’ve try 7.1.3 with self compilated 3.7.3, 3.7.7, 3.8.2 python but not work. giving up…

i’ve downgraded to 7.0.5, but in webinterface avatars not working, in admin webinterface avatar works fine…

hi, this works perfect, thanks

I’ve upgraded Ubuntu to 18.04 with do-release-upgrade
Then installed required packages from manual
apt-get install python3 python3-setuptools python3-pip python3-ldap -y

Installing required python packages failed firstly. In my case upgrading setuptools fixed the problem.
pip install --upgrade setuptools

Then I’ve installed required packages and started Seahub.
pip3 install --timeout=3600 Pillow pylibmc captcha jinja2 sqlalchemy psd-tools

Thanks for the solution, works perfectly.