It is a bug, and will be fixed in the next release.
Hi,
I noticed webdav is not working and seafile monitor exits unexpectedly. This is the output from seafile-monitor.log:
[2024-12-17 11:20:10] Start Monitor
[2024-12-17 11:20:10] Start seafevents.main
/opt/seafile/seafile-server-12.0.6/seahub/seahub/settings.py:959: SyntaxWarning: invalid escape sequence '\w'
match = re.search('^EXTRA_(\w+)', attr)
/opt/seafile/seafile-server-12.0.6/seahub/thirdpart/seafobj/mc.py:13: SyntaxWarning: invalid escape sequence '\S'
match = re.match('--SERVER\\s*=\\s*(\S+)', mc_options)
[2024-12-17 11:20:11] Start wsgidav.server.server_cli
/opt/seafile/seafile-server-12.0.6/seafile-monitor.sh: line 169: 8080
: syntax error: invalid arithmetic operator (error token is "
")
/opt/seafile/seafile-server-12.0.6/pro/python/seafevents/main.py:63: MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors, including RecursionError on Python 3.6. It may also silently lead to incorrect behaviour on Python 3.7. Please monkey-patch earlier. See https://github.com/gevent/gevent/issues/1016. Modules that had direct imports (NOT patched): ['jwt.jwks_client (/opt/seafile/seafile-server-12.0.6/seahub/thirdpart/jwt/jwks_client.py)', 'urllib3.util (/opt/seafile/seafile-server-12.0.6/seahub/thirdpart/urllib3/util/__init__.py)', 'urllib3.util.ssl_ (/opt/seafile/seafile-server-12.0.6/seahub/thirdpart/urllib3/util/ssl_.py)'].
from gevent import monkey; monkey.patch_all()
I am guessing this is a bug?
I think this is a bug, but really that’s up to the developers’ definition of bug. Either way, it should be kinda easy to work around. I’ve seen exactly this sort of error many times at a former job. If you don’t care about WHY it is happening (which is fine), skip to the tl;dr at the end.
Here’s what I think is happening. The part of that script around line 169 is this, which overrides the default port with the one you set in the seafdav.conf file if you did define one there. The “$(())” is a way to tell bash to do math, and in this case I think that’s just there to trim extra spaces off, and maybe fail if your port number isn’t a number (like if you set the port = a1234 ).
if [ $seafdav_port ]; then
SEAFDAV_PORT=$((seafdav_port))
fi
In your case, it is complaining that in a math context, it got some thing that wasn’t a number, but also not a recognized math symbol, and that something was a new line character. That’s what this error means:
invalid arithmetic operator (error token is "
")
How did it get a newline in that variable? I suspect that comes from your seafdav.conf file using DOS/Windows style new lines (a CR (carriage return) then an LF (line feed)) instead of unix style new lines (just the LF). So when reading in that number, it read from the = up to the LF, including the CR.
This can happen if you created that file with almost any windows tool. You can delete and recreate the file with a text editor on your server, or try to convert the file’s newlines with the dos2unix tool (which you might need to install).
tl;dr - These steps will probably fix it for you:
apt update
apt install dos2unix
dos2unix seafdav.conf
EDIT: I forgot to also say that since if the developers do consider this a bug, they can fix it by stripping off the CR character. Replace these lines:
seafdav_host=`awk -F '=' '/\[WEBDAV\]/{a=1}a==1&&$1~/^host/{print $2;exit}' ${SEAFILE_CENTRAL_CONF_DIR}/seafdav.conf`
seafdav_port=`awk -F '=' '/\[WEBDAV\]/{a=1}a==1&&$1~/^port/{print $2;exit}' ${SEAFILE_CENTRAL_CONF_DIR}/seafdav.conf`
with:
seafdav_host=`awk -F '=' '/\[WEBDAV\]/{a=1}a==1&&$1~/^host/{print $2;exit}' ${SEAFILE_CENTRAL_CONF_DIR}/seafdav.conf | tr -d '\r'`
seafdav_port=`awk -F '=' '/\[WEBDAV\]/{a=1}a==1&&$1~/^port/{print $2;exit}' ${SEAFILE_CENTRAL_CONF_DIR}/seafdav.conf | tr -d '\r'`
Thanks a lot for that detailed awnser. You were completely right, this fixed my issues with WebDAV.
The SyntaxWarning and MonkeyPatchWarning are still there, but I have not noticed any problems.
I’ve been testing seafile 12 in docker for a few days, using a clone of my real seafile server. I’ve found docker to be very frustrating, especially when trying to set up to use the existing data.
The most recent test was with “NON_ROOT=true”. While it kinda works, it takes over 20 minutes from “docker compse up -d” before it is usable. I did a bit of looking around since this is all new to me and found an old post that seems to say that there’s an option in the .env to disable this chown. Seafile Pro as non root user very slow startup (lots of chowns being run) - #2 by daniel.pan
That doesn’t work, and looking at the scripts it doesn’t look like there is an option to disable chown in version 12. Have I missed something?
Still get the exact same error… This time not using Docker on Ubuntu but Kubernetes on Talos.
Error: .env file not found.
Please follow the upgrade manual to set the .env file.
Traceback (most recent call last):
File "/scripts/start.py", line 94, in <module>
main()
File "/scripts/start.py", line 79, in main
call('{} start'.format(get_script('seafile.sh')))
File "/scripts/utils.py", line 70, in call
return subprocess.check_call(*a, **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '/opt/seafile/seafile-pro-server-12.0.6/seafile.sh start' returned non-zero exit status 255.
Followed the official guide to set up Seafile Pro with Kubernetes, by the way. Still can’t get this to run. And no mention of an env file there either.
Seafile Community Edition 12 available for download?
My experience, went from version 4.0 to version 11.0.13
Maybe you can check our new document for k8s:
I’m currently in the middle of upgrading my (outdated) seafile 11 and obviously doing step upgrade (11->12) and after startup I’m getting same error:
seafile | 2026-01-07T12:49:00.190754219Z -----------------------------------------------------------------
seafile | 2026-01-07T12:49:00.190782163Z Upgraded your seafile server successfully.
seafile | 2026-01-07T12:49:00.190812626Z -----------------------------------------------------------------
seafile | 2026-01-07T12:49:00.190836089Z
seafile | 2026-01-07T12:49:00.210807146Z
seafile | 2026-01-07T12:49:00.252350957Z Cannot find JWT_PRIVATE_KEY value from environment, try to read .env file.
seafile | 2026-01-07T12:49:00.252454550Z Error: .env file not found.
seafile | 2026-01-07T12:49:00.252480864Z Please follow the upgrade manual to set the .env file.
seafile | 2026-01-07T12:49:00.252502531Z
seafile | 2026-01-07T12:49:00.255908407Z Traceback (most recent call last):
seafile | 2026-01-07T12:49:00.256010537Z File "/scripts/start.py", line 94, in <module>
seafile | 2026-01-07T12:49:00.256394480Z main()
seafile | 2026-01-07T12:49:00.258038844Z File "/scripts/start.py", line 79, in main
seafile | 2026-01-07T12:49:00.258133418Z call('{} start'.format(get_script('seafile.sh')))
seafile | 2026-01-07T12:49:00.258161510Z File "/scripts/utils.py", line 70, in call
seafile | 2026-01-07T12:49:00.258183288Z return subprocess.check_call(*a, **kw)
seafile | 2026-01-07T12:49:00.258472565Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
seafile | 2026-01-07T12:49:00.258530972Z File "/usr/lib/python3.12/subprocess.py", line 413, in check_call
seafile | 2026-01-07T12:49:00.259045044Z raise CalledProcessError(retcode, cmd)
seafile | 2026-01-07T12:49:00.260495057Z subprocess.CalledProcessError: Command '/opt/seafile/seafile-server-12.0.14/seafile.sh start' returned non-zero exit status 255.
Any idea? This thread: Error setting up docker install seems to suggest rights/permissions issues but it was working fine before…
I tried running as non-root (vide Run Seafile as non root user inside docker - Seafile Admin Manual) but no luck.
Any idea?
Please start a new thread to describe your issue. And as the error indicated, you probably missing .env file.
From what I read missing .env is just a warning.
Alas, I’ll probably do a clean setup as there were huge changes in locations/structure so that’ll probably be simpler.