Seafile-pro-server 7.1.6 默认的一个BUG


#1

新版本的pro 无法使用sqlite3进行部署, 主要原因是代码中对conf处理逻辑错误。 configparser.NoSectionError: No section: ‘database’

/seafile-pro-server-7.1.6/pro/python/seafevents/db.py", line 52, in create_engine_from_conf
backend = config.get(db_sec, ‘type’)

默认部署是pro是可以用sqlite3的,但是conf文件中不会写入[database]配置

在seahub运行时,却要读取这个配置。 所以导致默认状态部署无法成功。

请官网帮忙修改bug啊,谢谢!

Error:Seahub failed to start.
Please try to run “./seahub.sh start” again
root@base:~/testt/seafile-pro-server-7.1.6# ./seahub.sh start-fastcgi

LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub (fastcgi) at 127.0.0.1:8000 …
Traceback (most recent call last):
File “/usr/lib/python3.6/configparser.py”, line 1138, in _unify_values
sectiondict = self._sections[section]
KeyError: ‘database’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/root/testt/seafile-pro-server-7.1.6/pro/python/seafevents/db.py”, line 112, in init_db_session_class
engine = create_engine_from_conf(config_file, db)
File “/root/testt/seafile-pro-server-7.1.6/pro/python/seafevents/db.py”, line 52, in create_engine_from_conf
backend = config.get(db_sec, ‘type’)
File “/usr/lib/python3.6/configparser.py”, line 781, in get
d = self._unify_values(section, vars)
File “/usr/lib/python3.6/configparser.py”, line 1141, in _unify_values
raise NoSectionError(section)
configparser.NoSectionError: No section: ‘database’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/root/testt/seafile-pro-server-7.1.6/seahub/manage.py”, line 10, in
execute_from_command_line(sys.argv)
File “/root/testt/seafile-pro-server-7.1.6/seahub/thirdpart/django/core/management/init.py”, line 364, in execute_from_command_line
utility.execute()
File “/root/testt/seafile-pro-server-7.1.6/seahub/thirdpart/django/core/management/init.py”, line 338, in execute
django.setup()
File “/root/testt/seafile-pro-server-7.1.6/seahub/thirdpart/django/init.py”, line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File “/root/testt/seafile-pro-server-7.1.6/seahub/thirdpart/django/apps/registry.py”, line 108, in populate
app_config.import_models()
File “/root/testt/seafile-pro-server-7.1.6/seahub/thirdpart/django/apps/config.py”, line 202, in import_models
self.models_module = import_module(models_module_name)
File “/usr/lib/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 “/root/testt/seafile-pro-server-7.1.6/seahub/seahub/base/models.py”, line 13, in
from seahub.utils import calc_file_path_hash, within_time_range,
File “/root/testt/seafile-pro-server-7.1.6/seahub/seahub/utils/init.py”, line 68, in
seafevents_api.init(EVENTS_CONFIG_FILE)
File “/root/testt/seafile-pro-server-7.1.6/pro/python/seafevents/seafevents_api.py”, line 13, in init
load_config(config_file)
File “/root/testt/seafile-pro-server-7.1.6/pro/python/seafevents/app/config.py”, line 44, in load_config
appconfig.seaf_session_cls = init_db_session_class(appconfig.seaf_conf_path, db = ‘seafile’)
File “/root/testt/seafile-pro-server-7.1.6/pro/python/seafevents/db.py”, line 115, in init_db_session_class
raise RuntimeError(“invalid config file %s”, config_file)
RuntimeError: (‘invalid config file %s’, ‘/root/testt/conf/seafile.conf’)
Error:Seahub failed to start.