seafile7.0升级7.1依赖问题

升级后一直报错
2024-07-03 09:23:30,481 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /
Traceback (most recent call last):
File “/kfs/seafile/seafile-server-7.1.5/seahub/thirdpart/django/core/handlers/exception.py”, line 41, in inner
response = get_response(request)
File “/kfs/seafile/seafile-server-7.1.5/seahub/thirdpart/django/core/handlers/base.py”, line 244, in _legacy_get_response
response = middleware_method(request)
File “/kfs/seafile/seafile-server-7.1.5/seahub/thirdpart/django/middleware/locale.py”, line 24, in process_request
i18n_patterns_used, prefixed_default_language = is_language_prefix_patterns_used(urlconf)
File “/kfs/seafile/seafile-server-7.1.5/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 “/kfs/seafile/seafile-server-7.1.5/seahub/thirdpart/django/utils/functional.py”, line 35, in get
res = instance.dict[self.name] = self.func(instance)
File “/kfs/seafile/seafile-server-7.1.5/seahub/thirdpart/django/urls/resolvers.py”, line 407, in url_patterns
patterns = getattr(self.urlconf_module, “urlpatterns”, self.urlconf_module)
File “/kfs/seafile/seafile-server-7.1.5/seahub/thirdpart/django/utils/functional.py”, line 35, in get
res = instance.dict[self.name] = self.func(instance)
File “/kfs/seafile/seafile-server-7.1.5/seahub/thirdpart/django/urls/resolvers.py”, line 400, in urlconf_module
return import_module(self.urlconf_name)
File “/usr/lib64/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import
File “”, line 971, in _find_and_load
File “”, line 955, in _find_and_load_unlocked
File “”, line 665, in _load_unlocked
File “”, line 678, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/kfs/seafile/seafile-server-7.1.5/seahub/seahub/utils/rooturl.py”, line 41, in
url(r’^%s’ % settings.SITE_ROOT[1:], include(settings.SITE_ROOT_URLCONF)),
File “/kfs/seafile/seafile-server-7.1.5/seahub/thirdpart/django/conf/urls/init.py”, line 50, in include
urlconf_module = import_module(urlconf_module)
File “/usr/lib64/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import
File “”, line 971, in _find_and_load
File “”, line 955, in _find_and_load_unlocked
File “”, line 665, in _load_unlocked
File “”, line 678, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/kfs/seafile/seafile-server-7.1.5/seahub/seahub/urls.py”, line 600, in
url(r’^captcha/‘, include(‘captcha.urls’)),
File “/kfs/seafile/seafile-server-7.1.5/seahub/thirdpart/django/conf/urls/init.py”, line 50, in include
urlconf_module = import_module(urlconf_module)
File “/usr/lib64/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import
File “”, line 971, in _find_and_load
File “”, line 955, in _find_and_load_unlocked
File “”, line 665, in _load_unlocked
File “”, line 678, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/usr/local/lib/python3.6/site-packages/captcha/urls.py”, line 1, in
from django.urls import re_path
ImportError: cannot import name ‘re_path’
2024-07-03 09:23:32,102 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /favicon.ico
Traceback (most recent call last):
File “/kfs/seafile/seafile-server-7.1.5/seahub/thirdpart/django/core/handlers/exception.py”, line 41, in inner
response = get_response(request)
File “/kfs/seafile/seafile-server-7.1.5/seahub/thirdpart/django/core/handlers/base.py”, line 244, in _legacy_get_response
response = middleware_method(request)
File “/kfs/seafile/seafile-server-7.1.5/seahub/thirdpart/django/middleware/locale.py”, line 24, in process_request
i18n_patterns_used, prefixed_default_language = is_language_prefix_patterns_used(urlconf)
File “/kfs/seafile/seafile-server-7.1.5/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 “/kfs/seafile/seafile-server-7.1.5/seahub/thirdpart/django/utils/functional.py”, line 35, in get
res = instance.dict[self.name] = self.func(instance)
File “/kfs/seafile/seafile-server-7.1.5/seahub/thirdpart/django/urls/resolvers.py”, line 407, in url_patterns
patterns = getattr(self.urlconf_module, “urlpatterns”, self.urlconf_module)
File “/kfs/seafile/seafile-server-7.1.5/seahub/thirdpart/django/utils/functional.py”, line 35, in get
res = instance.dict[self.name] = self.func(instance)
File “/kfs/seafile/seafile-server-7.1.5/seahub/thirdpart/django/urls/resolvers.py”, line 400, in urlconf_module
return import_module(self.urlconf_name)
File “/usr/lib64/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import
File “”, line 971, in _find_and_load
File “”, line 955, in _find_and_load_unlocked
File “”, line 665, in _load_unlocked
File “”, line 678, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/kfs/seafile/seafile-server-7.1.5/seahub/seahub/utils/rooturl.py”, line 41, in
url(r’^%s’ % settings.SITE_ROOT[1:], include(settings.SITE_ROOT_URLCONF)),
File “/kfs/seafile/seafile-server-7.1.5/seahub/thirdpart/django/conf/urls/init.py”, line 50, in include
urlconf_module = import_module(urlconf_module)
File “/usr/lib64/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import
File “”, line 971, in _find_and_load
File “”, line 955, in _find_and_load_unlocked
File “”, line 665, in _load_unlocked
File “”, line 678, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/kfs/seafile/seafile-server-7.1.5/seahub/seahub/urls.py”, line 600, in
url(r’^captcha/', include(‘captcha.urls’)),
File “/kfs/seafile/seafile-server-7.1.5/seahub/thirdpart/django/conf/urls/init.py”, line 50, in include
urlconf_module = import_module(urlconf_module)
File “/usr/lib64/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import
File “”, line 971, in _find_and_load
File “”, line 955, in _find_and_load_unlocked
File “”, line 665, in _load_unlocked
File “”, line 678, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/usr/local/lib/python3.6/site-packages/captcha/urls.py”, line 1, in
from django.urls import re_path
ImportError: cannot import name ‘re_path’

缺失这个依赖,但是我在python命令行中运行from django.urls import re_path是没有问题的

./seahub.sh python-env 进入的python环境确实找不到这个依赖


但是实际环境是有的,感觉像是seahub没加载依赖一样

您好,直接将非常旧的 Seafile 实例升级到最新版本非常困难。因此,我们建议您按照备份和恢复流程,即运行最新版本的新 Seafile 实例并从旧实例迁移数据。 相关文档见: 备份和恢复 - seafile-manual-cn

我们的建议步骤如下:

  1. 确保新的 Seafile 实例可以在新机器上正确运行
  2. 停止新的 Seafile 实例并清理其数据库(MySQL/MariaDB数据)
  3. 将旧服务器上的数据库和 seafile 数据备份和恢复到新服务器
  4. 现在新实例中的数据库表是旧版本的。 您需要运行升级脚本来更新数据库表以与最新版本兼容。 (或者您可以手动运行SQL语句,文件位于seafile-server-latest/upgrade/sql下)
  5. 重新启动新的Seafile实例,并检查日志以查看是否有任何与数据库相关的错误。 如果是这样,请手动修复它们。