Error starting seafile after 11.0.12 > 12.0.14 upgrade

I followed the doc and upgrade_11.0_12.0.sh ran without error. I created the conf/.env file with a random password and other variables for my environment. While trying to start the seafile service I get errors:

service seafile start

Job for seafile.service failed because the control process exited with error code.
See “systemctl status seafile.service” and “journalctl -xeu seafile.service” for details.

and this:

Jun 16 11:30:01 ldc01-stor-fs-01 systemd[1]: Starting seafile.service - Seafile…
Subject: A start job for unit seafile.service has begun execution
Defined-By: systemd
Support: Debian -- User Support

A start job for unit seafile.service has begun execution.

The job identifier is 542.
Jun 16 11:30:01 ldc01-stor-fs-01 bash[2172]: /opt/seafile/seafile-server-latest/seafile.sh start
Jun 16 11:30:01 ldc01-stor-fs-01 bash[2174]: Cannot find JWT_PRIVATE_KEY value from environment, try to read .env file.
Jun 16 11:30:01 ldc01-stor-fs-01 bash[2174]: Starting seafile server, please wait …
Jun 16 11:30:04 ldc01-stor-fs-01 bash[2174]: Failed to start seafile server
Jun 16 11:30:04 ldc01-stor-fs-01 systemd[1]: seafile.service: Control process exited, code=exited, status=1/FAILURE
Subject: Unit process exited
Defined-By: systemd
Support: Debian -- User Support

An ExecStart= process belonging to unit seafile.service has exited.

The process’ exit code is ‘exited’ and its exit status is 1.
Jun 16 11:30:04 ldc01-stor-fs-01 systemd[1]: seafile.service: Failed with result ‘exit-code’.
Subject: Unit failed
Defined-By: systemd
Support: Debian -- User Support

The unit seafile.service has entered the ‘failed’ state with result ‘exit-code’.
Jun 16 11:30:04 ldc01-stor-fs-01 systemd[1]: Failed to start seafile.service - Seafile.
Subject: A start job for unit seafile.service has failed
Defined-By: systemd
Support: Debian -- User Support

A start job for unit seafile.service has finished with a failure.

The job identifier is 542 and the job result is failed.

I’ve searched the error and didn’t find anything to get me going. What are my next steps for troubleshooting?

Did you set the JWT_PRIVATE_KEY as described in Setup community edition - Seafile Admin Manual ?

JWT_PRIVATE_KEY, A random string with a length of no less than 32 characters is required for Seafile, which can be generated by using pwgen -s 40 1

I’m not familiar with that document as I’m not using docker. When I created the conf/.env file per the upgrade instructions I generated a random string of more than 32 characters and pasted it into that file for JWT_PRIVATE_KEY=

The error suggests that Seafile isn’t happy with it, but I’m not sure why.

The message Cannot find JWT_PRIVATE_KEY value from environment, try to read .env file. is actually a normal informational message. It simply means the script didn’t find the key in your system’s global environment variables and is proceeding to look for it inside your conf/.env file.

The “Failed to start seafile server” message usually means seaf-server encountered an error shortly after starting. For version 12.0 binary installations, please check the following:

  1. Mandatory Variables: Starting with version 12.0, the conf/.env file must contain more than just the JWT key. It also needs your database connection details and server configuration. Ensure your conf/.env includes:

    • JWT_PRIVATE_KEY (which you’ve already done)
    • SEAFILE_MYSQL_DB_HOST and related configurations
    • SEAFILE_SERVER_HOSTNAME
    • SEAFILE_SERVER_PROTOCOL (http or https)
  2. Special Characters: If your random string contains special characters like # or spaces, make sure the value is enclosed in quotes, or try a simpler alphanumeric string for testing.

  3. Check Logs: The specific reason for the failure will be recorded in your logs. Please check logs/seafile.log (and logs/controller.log) for any error messages that appear at the exact time you attempt to start the service.

You can find more information for env file at: Installation - Seafile Admin Manual