Seahub v10.0.10 fails after Centos v7 OS upgrade

I thought this was a problem in v10.0.11 but I restored the server and just carried out OS updates via yum -y update and now Seahub won’t start:

Traceback (most recent call last):
  File "/data/seafile/seafile-pro-server-10.0.11/seahub/thirdpart/bin/gunicorn", line 5, in <module>
    from gunicorn.app.wsgiapp import run
  File "/data/seafile/seafile-pro-server-10.0.11/seahub/thirdpart/gunicorn/app/wsgiapp.py", line 9, in <module>
    from gunicorn.app.base import Application
  File "/data/seafile/seafile-pro-server-10.0.11/seahub/thirdpart/gunicorn/app/base.py", line 11, in <module>
    from gunicorn import util
  File "/data/seafile/seafile-pro-server-10.0.11/seahub/thirdpart/gunicorn/util.py", line 25, in <module>
    import pkg_resources
  File "/data/seafile/seafile-pro-server-10.0.11/seahub/thirdpart/pkg_resources/__init__.py", line 85, in <module>
    from pkg_resources.extern import platformdirs
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 658, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 571, in module_from_spec
  File "/data/seafile/seafile-pro-server-10.0.11/seahub/thirdpart/pkg_resources/extern/__init__.py", line 52, in create_module
    return self.load_module(spec.name)
  File "/data/seafile/seafile-pro-server-10.0.11/seahub/thirdpart/pkg_resources/extern/__init__.py", line 37, in load_module
    __import__(extant)
  File "/data/seafile/seafile-pro-server-10.0.11/seahub/thirdpart/pkg_resources/_vendor/platformdirs/__init__.py", line 5
    from __future__ import annotations
    ^
SyntaxError: future feature annotations is not defined

Any ideas? Almost at end of tether of every upgrade not going cleanly :frowning:

I’ve gone through the upgrade steps granularly and. not surprisingly, it’s the upgrade of Python3 from 3.68-19 to 3.68.21. One would think this was a pretty minor upgrade.

More research reveals that from __future__ import annotations is only supported in Python3 3.7 onwards. Although perplexing why it didn’t throw an syntax error in 3.6.8-19.

I’ve fixed this. When I checked back at my configuration notes, I saw that I’d manually installed Python v3.9.16 but in sideways mode, i.e. using altinstall so Python v3.68 was still on the computer and in the package system.

So I removed the old package using yum -y remove python3.x86_64 and then fixed up the symbolic links again for Python v3.9.16.

Seahub now starts fine after the upgrade. Quite why having the legacy version there caused this problem is beyond me. My knowledge of Python on Linux doesn’t go that deep. And life is too short sometimes!

In Linux, especially when dealing with system-level components like Python, the version and configuration of the interpreter can sometimes lead to compatibility issues with specific applications or libraries. By upgrading to a newer Python version and ensuring that the symbolic links point to the correct version, you’ve likely aligned Seahub with the expected Python environment.