Seafile community edition 9.0.2 is ready!

This is a stable release with following changes:

  • Fix OnlyOffice/Collabora integration when golang http server
  • Enable showing password for encrypted sharing links

Note, a new Python dependency is needed for generating password for encrypted sharing links

sudo pip3 install pycryptodome==3.12.0
4 Likes

Thank you! I can confirm that the OnlyOffice integration now works flawlessly.

hy @daniel.pan

thanks for the 9.0.2 version, updated without any problems.

But I have a seen a small problem when downloading whole folders as ZIP archive:
If you just download 1 folder at once, the save as dialog does not add the .ZIP file extension per default to the file name.
When selecting multiple folders, the file name (eg: documents-export-2021-12-10.zip) contains the correct .ZIP file extension.

Please add the .ZIP extension also if downloading only one folder, thanks!

BR

There is another problem, only when go_fileserver is enabled:
When going over an download-link (shared folder) and try to download files/folders as zip there will prompt an error message. If go-fileserver is disabled everything works fine.

2021-12-10 20:48:28,904 [ERROR] django.request:230 log_response Internal Server Error: /api/v2.1/query-zip-progress/
Traceback (most recent call last):
File “/seafile/seafile-server-9.0.2/seahub/thirdpart/django/core/handlers/exception.py”, line 47, in inner
response = get_response(request)
File “/seafile/seafile-server-9.0.2/seahub/thirdpart/django/core/handlers/base.py”, line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File “/seafile/seafile-server-9.0.2/seahub/thirdpart/django/views/decorators/csrf.py”, line 54, in wrapped_view
return view_func(*args, **kwargs)
File “/seafile/seafile-server-9.0.2/seahub/thirdpart/django/views/generic/base.py”, line 70, in view
return self.dispatch(request, *args, **kwargs)
File “/seafile/seafile-server-9.0.2/seahub/thirdpart/rest_framework/views.py”, line 505, in dispatch
response = self.handle_exception(exc)
File “/seafile/seafile-server-9.0.2/seahub/thirdpart/rest_framework/views.py”, line 465, in handle_exception
self.raise_uncaught_exception(exc)
File “/seafile/seafile-server-9.0.2/seahub/thirdpart/rest_framework/views.py”, line 476, in raise_uncaught_exception
raise exc
File “/seafile/seafile-server-9.0.2/seahub/thirdpart/rest_framework/views.py”, line 502, in dispatch
response = handler(request, *args, **kwargs)
File “/seafile/seafile-server-9.0.2/seahub/seahub/api2/endpoints/query_zip_progress.py”, line 38, in get
return Response(json.loads(progress))
File “/usr/lib/python3.6/json/init.py”, line 348, in loads
‘not {!r}’.format(s.class.name))
TypeError: the JSON object must be str, bytes or bytearray, not ‘NoneType’

Hi dev team,

thanks for your regular updates!!
Do you also plan to support sqlite with the new golang file-server? Currently its disabled.

You deleted also all the scripts in the seafile-server. Now we aren’t able to build it. Where did they go?

Best regards :slight_smile:

Hello! I am trying to upgrade seafile from 8.0.8 to 9.0.2 on Fedora 35.
After the update, seahub does not start with the error:
– The job identifier is 790968.
Dec 11 22:58:19 san.localdomain seahub.sh[1430522]: LC_ALL is not set in ENV, set to en_US.UTF-8
Dec 11 22:58:19 san.localdomain seahub.sh[1430522]: Starting seahub at port 8000 …
Dec 11 22:58:20 san.localdomain python3[1430535]: detected unhandled Python exception in ‘/opt/seafile/seafile-server-9.0.2/seahub/thirdpart/bin/gunicorn’
Dec 11 22:58:24 san.localdomain seahub.sh[1430522]: Error:Seahub failed to start.
Dec 11 22:58:24 san.localdomain seahub.sh[1430522]: Please try to run “./seahub.sh start” again
Dec 11 22:58:24 san.localdomain systemd[1]: seahub.service: Control process exited, code=exited, status=1/FAILURE
– Subject: Unit process exited
– Defined-By: systemd

I can reproduce this. Looks like golang fileserver responds with a malformed JSON object.

Try to execute seahub through

./manage.py runserver

This will usually give you a more detailed error message. I would guess that additionally needed packages are missing or do not have the required version.

I found the following changed requirements for Seahub with Seafile version 9:

pip modules:

  • django==3.2.9 (instead of django==2.2.*)
  • pycryptodome==3.12.0 (new)

packages:

  • gcompat (was required on Alpine Linux, not required for OSs using glibc, like Fedora)

@Gustl22 Unfortunately you cannot use SQLite with go fileserver. If go fileserver also opens the SQLite db, there will be two processes accessing the same db (go fileserver and seaf-server). SQLite doesn’t work well in such case.

With SQLite you’ll use seaf-server to handle file upload/download as before. It’s still supported.

1 Like

Еhanks for your reply.
I tried to run ./manage.py runserver and got the following error:
./manage.py runserver
Traceback (most recent call last):
File “/usr/lib/python3.10/site-packages/django/core/management/base.py”, line 354, in run_from_argv
self.execute(*args, **cmd_options)
File “/usr/lib/python3.10/site-packages/django/core/management/commands/runserver.py”, line 61, in execute
super().execute(*args, **options)
File “/usr/lib/python3.10/site-packages/django/core/management/base.py”, line 398, in execute
output = self.handle(*args, **options)
File “/usr/lib/python3.10/site-packages/django/core/management/commands/runserver.py”, line 68, in handle
if not settings.DEBUG and not settings.ALLOWED_HOSTS:
File “/usr/lib/python3.10/site-packages/django/conf/init.py”, line 82, in getattr
self._setup(name)
File “/usr/lib/python3.10/site-packages/django/conf/init.py”, line 69, in _setup
self._wrapped = Settings(settings_module)
File “/usr/lib/python3.10/site-packages/django/conf/init.py”, line 170, in init
mod = importlib.import_module(self.SETTINGS_MODULE)
File “/usr/lib64/python3.10/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1050, in _gcd_import
File “”, line 1027, in _find_and_load
File “”, line 992, in _find_and_load_unlocked
File “”, line 241, in _call_with_frames_removed
File “”, line 1050, in _gcd_import
File “”, line 1027, in _find_and_load
File “”, line 1006, in _find_and_load_unlocked
File “”, line 688, in _load_unlocked
File “”, line 883, in exec_module
File “”, line 241, in _call_with_frames_removed
File “/opt/seafile/seafile-server-9.0.2/seahub/seahub/init.py”, line 4, in
from .handlers import repo_created_cb, repo_deleted_cb, clean_up_repo_trash_cb,
File “/opt/seafile/seafile-server-9.0.2/seahub/seahub/handlers.py”, line 4, in
from . import settings
File “/opt/seafile/seafile-server-9.0.2/seahub/seahub/settings.py”, line 9, in
from seaserv import FILE_SERVER_PORT
ModuleNotFoundError: No module named ‘seaserv’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/opt/seafile/seafile-server-9.0.2/seahub/./manage.py”, line 10, in
execute_from_command_line(sys.argv)
File “/usr/lib/python3.10/site-packages/django/core/management/init.py”, line 419, in execute_from_command_line
utility.execute()
File “/usr/lib/python3.10/site-packages/django/core/management/init.py”, line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/usr/lib/python3.10/site-packages/django/core/management/base.py”, line 367, in run_from_argv
connections.close_all()
File “/usr/lib/python3.10/site-packages/django/db/utils.py”, line 208, in close_all
for alias in self:
File “/usr/lib/python3.10/site-packages/django/utils/connection.py”, line 73, in iter
return iter(self.settings)
File “/usr/lib/python3.10/site-packages/django/utils/functional.py”, line 48, in get
res = instance.dict[self.name] = self.func(instance)
File “/usr/lib/python3.10/site-packages/django/utils/connection.py”, line 45, in settings
self._settings = self.configure_settings(self._settings)
File “/usr/lib/python3.10/site-packages/django/db/utils.py”, line 144, in configure_settings
databases = super().configure_settings(databases)
File “/usr/lib/python3.10/site-packages/django/utils/connection.py”, line 50, in configure_settings
settings = getattr(django_settings, self.settings_name)
File “/usr/lib/python3.10/site-packages/django/conf/init.py”, line 82, in getattr
self._setup(name)
File “/usr/lib/python3.10/site-packages/django/conf/init.py”, line 69, in _setup
self._wrapped = Settings(settings_module)
File “/usr/lib/python3.10/site-packages/django/conf/init.py”, line 170, in init
mod = importlib.import_module(self.SETTINGS_MODULE)
File “/usr/lib64/python3.10/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1050, in _gcd_import
File “”, line 1027, in _find_and_load
File “”, line 992, in _find_and_load_unlocked
File “”, line 241, in _call_with_frames_removed
File “”, line 1050, in _gcd_import
File “”, line 1027, in _find_and_load
File “”, line 1006, in _find_and_load_unlocked
File “”, line 688, in _load_unlocked
File “”, line 883, in exec_module
File “”, line 241, in _call_with_frames_removed
File “/opt/seafile/seafile-server-9.0.2/seahub/seahub/init.py”, line 4, in
from .handlers import repo_created_cb, repo_deleted_cb, clean_up_repo_trash_cb,
File “/opt/seafile/seafile-server-9.0.2/seahub/seahub/handlers.py”, line 4, in
from . import settings
File “/opt/seafile/seafile-server-9.0.2/seahub/seahub/settings.py”, line 9, in
from seaserv import FILE_SERVER_PORT
ModuleNotFoundError: No module named ‘seaserv’

I would guess that either there is something wrong with your PYTHONPATH environment variable or the modules are in a wrong path, because Seahub doesn’t seem to find the module seaserv, which comes with Seafile.

The path of the modules that come with Seafile have changed from /opt/seafile/seafile-server-latest/seafile/lib64/python3/site-packages to /opt/seafile/seafile-server-latest/seafile/lib64/python3.6/site-packages. So there might be the issue.

Also please keep in mind that you are trying to running this on an unsupported OS. The support for CentOS (very similar to Fedora) was dropped.

Further I would highly recommend you to migrate to a containerized deployment anyways.

I’ve been running Seafile version 8.0.7 on Debian (now Bullseye) for a while. Upgrades have been mostly easy. That stopped today. I downloaded version 9.0.2 to try to upgrade, and ran upgrade_8.0_9.0.sh, then updated ownership of the files to my Seafile user. When I tried to start it, the seafile server starts but the seahub does not.

If I try the “./manage.py runserver” from above I get a very similar error and it reports “No module named ‘seaserv’”.

Then taking a lead from ggogel and I went to check on the python3 vs python3.6 directory issue. That’s where it get weird. The seafile directory in 9.0.2 does not have a lib64 directory.

9.0.2 has:

seafile:

  • bin
  • docs
  • include
  • lib

But no lib64. Now if I go back to 8.0.7, it has:

seafile:

  • bin
  • docs
  • include
  • lib
  • lib64

Now I ran the upgrade_8.0_9.0.sh when I first downloaded the update. Is there anyway to safely go back to 8.0.7 or is it best to wait for a update?

Or do I pull out my backups and restore from them?

Thanks,
Dave

OK, downloaded a couple more versions to check.

8.0.7 and 8.0.8 both have a lib64 directory within the seafile directory.

9.0.1 and 9.0.2 both do not have a lib64 directory within the seafile directory.

Did something get moved? Is the PYTHONPATH not being set correctly?

Dave

I think I might have found where seaserv is and it has moved but not sure why this is causing an issue.

seafile-server-8.0.8/seafile/lib64/python3.6/site-packages/seaserv
VERSUS:
seafile-server-9.0.2/seafile/lib/python3/site-packages/seaserv

NOTE: Apparently I’ve reached the limit of allowed replies per topic for a new user and cannot directly reply to prokyon’s reply below. The system suggested editting a old reply so here we are.

Summary: It works now and the fix was in prokyon’s comment below but it was not what I expected.

It turns out the PYTHONPATH in the prepare_env function of seahub.sh already had both the lib and lib64 directories. It was:

export PYTHONPATH=${INSTALLPATH}/seafile/lib/python3/site-packages:${INSTALLPATH}/seafile/lib64/python3/site-packages:${INSTALLPATH}/seahub:${INSTALLPATH}/seahub/thirdpart:$PYTHONPATH

In this case, the fix was something I misdiagnosed but was included in prokyon’s message. I needed to install the cffi python module. Once I installed that, I was able to start seafile and seahub normally.

Thank you!
Dave

Found a fix for the same issue:

Edit seahub.sh and find line with export PYTHONPATH=
It will look something like this:

export PYTHONPATH=${INSTALLPATH}/seafile/lib/python3/site-packages:${INSTALLPATH}/seafile/lib64/python3/site-packages:${INSTALLPATH}/seahub:${INSTALLPATH}/seahub/thirdpart:$PYTHONPATH

Change to include new lib64 directory:

export PYTHONPATH=${INSTALLPATH}/seafile/lib/python3/site-packages:${INSTALLPATH}/seafile/lib/python3/site-packages:${INSTALLPATH}/seafile/lib64/python3/site-packages:${INSTALLPATH}/seahub:${INSTALLPATH}/seahub/thirdpart:$PYTHONPATH

Then I ran into another issue with a mismatched python package so I ran:
pip3 install cffi==1.14.0

And now seahub should start.

In order to debug further if your problem is not resolved you can append this directly below the line with export PYTHONPATH=... and use the output from it to manually run seahub and see any error messages.

seahub.sh

    export PYTHONPATH=${INSTALLPATH}/seafile/lib/python3/site-packages:${INSTALLPATH}/seafile/lib/python3/site-packages:${INSTALLPATH}/seafile/lib64/python3/site-packages:${INSTALLPATH}/seahub:${INSTALLPATH}/seahub/thirdpart:$PYTHONPATH

    echo 'export PYTHONPATH="'$PYTHONPATH'"'
    echo 'export CCNET_CONF_DIR="'$CCNET_CONF_DIR'"'
    echo 'export SEAFILE_CONF_DIR="'$SEAFILE_CONF_DIR'"'
    echo 'export SEAFILE_CENTRAL_CONF_DIR="'$SEAFILE_CENTRAL_CONF_DIR'"'
    echo 'export SEAFILE_RPC_PIPE_PATH="'$SEAFILE_RPC_PIPE_PATH'"'
    echo 'export LANG="'$LANG'"'
    echo 'export LC_ALL="'$LC_ALL'"'

Then run seahub.sh as usual. Output should look something like this but will have your seafile directory:

export PYTHONPATH="/home/seafile/seafile-server/seafile-server-9.0.2/seafile/lib/python3/site-packages:/home/seafile/seafile-server/seafile-server-9.0.2/seafile/lib/python3/site-packages:/home/seafile/seafile-server/seafile-server-9.0.2/seafile/lib64/python3/site-packages:/home/seafile/seafile-server/seafile-server-9.0.2/seahub:/home/seafile/seafile-server/seafile-server-9.0.2/seahub/thirdpart:"
export CCNET_CONF_DIR="/home/seafile/seafile-server/ccnet"
export SEAFILE_CONF_DIR="/home/seafile/seafile-server/seafile-data"
export SEAFILE_CENTRAL_CONF_DIR="/home/seafile/seafile-server/conf"
export SEAFILE_RPC_PIPE_PATH="/home/seafile/seafile-server/seafile-server-9.0.2/runtime"
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
Starting seahub at port 8000 ...

Then you copy the lines that ./seahub.sh start gave you (all the lines with export) and paste them in your terminal. Change directory to seafile-server-latest/seahub and run:

python3 ./manage.py runserver

The output might give you a hint of what else is missing. If it starts and no errors are displayed, stop the server with CTRL+C because it won’t have loaded all components properly (gunicorn.conf.py). Running ./seahub.sh start in your seafile-server-latest directory should now start.

4 Likes

Your help is beyond appreciated, man.

It surely helped me out.

Thanks for the solution, but unfortunately it didn’t work for me.

Hi there,

I tried to build latest 9.0.2 inside podman running on my raspiOS 64 bit.

The build stopps at running the patch with following output:

-> Applying patch file from /opt/build-server.py.patch...

+ patch -N -b /opt/haiwen-build/seafile-server/scripts/build/build-server.py /opt/build-server.py.patch
patching file /opt/haiwen-build/seafile-server/scripts/build/build-server.py
Hunk #1 FAILED at 25.
Hunk #2 FAILED at 539.
Hunk #3 FAILED at 622.
Hunk #4 FAILED at 785.
Hunk #5 FAILED at 806.
5 out of 5 hunks FAILED -- saving rejects to file /opt/haiwen-build/seafile-server/scripts/build/build-server.py.rej
patch: **** Can't reopen file /opt/haiwen-build/seafile-server/scripts/build/build-server.py : No such file or directory

At Version 9.0.1 the buildscript runs smoothly.

Any suggestions? Are there any additional dependencies that should be resolved before the build?

The build-server.py script is moved to seahub project (same relative path).

Inside podman container the https://raw.githubusercontent.com/haiwen/seafile-rpi/master/build.sh script runs successfully on my raspi-os arm64.
But the resulting seafile-server-9.0.2.tar.gz archive has no sql folder with required sql files to set up the database tables.

So the setup-seafile-mysql.sh script throws an error at this step:

Generating seahub configuration ...

----------------------------------------
Now creating ccnet database tables ...

----------------------------------------
Traceback (most recent call last):
  File "/home/seafile/seafile-server-9.0.2/setup-seafile-mysql.py", line 1594, in <module>
    main()
  File "/home/seafile/seafile-server-9.0.2/setup-seafile-mysql.py", line 1550, in main
    ccnet_config.do_syncdb()
  File "/home/seafile/seafile-server-9.0.2/setup-seafile-mysql.py", line 898, in do_syncdb
    with open(sql_file, 'r') as fp:
FileNotFoundError: [Errno 2] No such file or directory: '/home/seafile/seafile-server-9.0.2/sql/mysql/ccnet.sql'

It seems that the tar process has something to do with that, because the build folders do contain these sql-files. The tar-archive does not…