Community v11, seafevents.main: No section: 'DATABASE'

Since upgrade to v11 (community edition, docker), the seafile-monitor.log file is flooded with following:

[2024-01-07 09:35:33] Start Monitor 
[2024-01-07 09:35:33] Start seafevents.main                                              
No section: 'DATABASE'
ERROR:root:Failed create tables, error: create db engine error: No section: 'DATABASE'   
Traceback (most recent call last):
  File "/opt/seafile/seafile-server-11.0.3/pro/python/seafevents/db.py", line 113, in create_db_tables
    engine = create_engine_from_conf(config)                                             
  File "/opt/seafile/seafile-server-11.0.3/pro/python/seafevents/db.py", line 40, in create_engine_from_conf
    backend = config.get(db_sec, 'type')
  File "/usr/lib/python3.10/configparser.py", line 783, in get                           
    d = self._unify_values(section, vars)
  File "/usr/lib/python3.10/configparser.py", line 1154, in _unify_values                
    raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'DATABASE'                                      

During handling of the above exception, another exception occurred:                      

Traceback (most recent call last):
  File "/opt/seafile/seafile-server-11.0.3/pro/python/seafevents/main.py", line 43, in main
    create_db_tables(config)
  File "/opt/seafile/seafile-server-11.0.3/pro/python/seafevents/db.py", line 116, in create_db_tables
    raise RuntimeError("create db engine error: %s" % e)                                 
RuntimeError: create db engine error: No section: 'DATABASE'                             

During handling of the above exception, another exception occurred:                      

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main                  
    return _run_code(code, main_globals, None,                                           
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code                             
    exec(code, run_globals)
  File "/opt/seafile/seafile-server-11.0.3/pro/python/seafevents/main.py", line 75, in <module>
    main()                                  
  File "/opt/seafile/seafile-server-11.0.3/pro/python/seafevents/main.py", line 47, in main
    raise RuntimeError('Failed create tables, error: %s' % e)                            
RuntimeError: Failed create tables, error: create db engine error: No section: 'DATABASE'

Seafile seems to work normally. What am I missing? Do we need to update the docs?

I solved it by creating the file “seafevents.conf” in the conf folder and creating the seafevents database:

  • Copy the template from here: events.conf.template
  • Remove the “DATABASE” section that doesn’t apply (I’m using mysql so I removed the sqlite section)
  • update the fields as needed (I updated usernames, password and host to match the seafile.conf file)
  • In mysql create the database “seafevents” and grant permissions to the user like:

GRANT ALL PRIVILEGES ON seafevents.* to seafile@localhost;