Seafile community edition 9.0.5 is ready!

cffi 1.14.6 works fine, try to install it in the thirdpart folder:

python3 -m pip install --force-reinstall --upgrade --target <SOMEWHERE>/seafile-server-9.0.5/seahub/thirdpart cffi==1.14.6

Edit: package libffi-dev is needed. If absent, install it before using pip with apt install libffi-dev

1 Like

Edit: disregard comment below, suggestion from Barolo worked (needed a fresh install first)

Thanks a lot Barolo! cffi 1.14.6 can indeed be installed on Ubuntu 22.04 following your advice.

However,

  • when I run the command you suggested to install cffi 1.14.6 in the thirdpart folder, I get Error happened during creating seafile admin when trying to execute seahub.sh, more specifically a missing module error when check_init_admin.py is invoqued:

    ModuleNotFoundError: No module named 'seaserv'
    

    The fix for this issue has been discussed on this forum (thread on CE 9.0.2), but requires to install cffi 1.14.0, which we want to avoid

  • when I install cffi 1.14.6 in the user’s .local directory with pip3 install --user cffi==1.14.6, I get a version error mismatch when trying to execute seahub.sh:

    Exception: Version mismatch: this is the 'cffi' package version 1.14.0, located in '/<PATH>/seafile-server-9.0.5/seahub/thirdpart/cffi/api.py'.  When we import the top-level '_cffi_backend' extension module, we get version 1.14.6, located in '/<PATH>/.local/lib/python3.10/site-packages/_cffi_backend.cpython-310-x86_64-linux-gnu.so'.  The two versions should be equal; check your installation.
    

So I’m still kinda stuck :confused:

I don’t see the link between the two issues, the ModuleNotFoundError looks more like a PYTHONPATH issue. Can you share the thread you’re referring to?

Thx for your response Barolo, I’m surely missing something. User DJN reported a similar error message about the missing module in this thread (sorry, can’t post full link): seafile-community-edition-9-0-2-is-ready/15569/9

User prokyon suggested checking the Python path, as well as installing the package cffi==1.14.0. Apparently, the latter did the trick. That’s why I draw parallels between both issues, but it might be something different altogether.

I’ll spin up a new install of the Ubuntu Server 22.04, try your suggestion again and report back if I have more luck.

Hello, I forgot to check on seafile forum if it is save to upgrade to ubuntu 22.04 and now my seahub service refuses to start. after installing cffi1.15 it starts, but I get Internal server Error. Your described installation method of 1.14.6 fails. What can I do to fix my seafile server? Any help would be very appreciated!

Thx for the link, it appears this is indeed another issue (“Then I ran into another issue with a mismatched python package”), which is good news.

I quickly tried to install seafile on a fresh 22.04 vm and faced no other issue than the cffi one, thus it should work.

What fails exactly ?

I get the following error during installation:

Collecting cffi==1.14.6
Using cached cffi-1.14.6.tar.gz (475 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status ‘done’
Collecting pycparser
Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Building wheels for collected packages: cffi
Building wheel for cffi (setup.py): started
Building wheel for cffi (setup.py): finished with status ‘error’
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [36 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.10
creating build/lib.linux-x86_64-3.10/cffi
copying cffi/commontypes.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/backend_ctypes.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/api.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/cparser.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/lock.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/recompiler.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/setuptools_ext.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/verifier.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/pkgconfig.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/vengine_gen.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/ffiplatform.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/cffi_opcode.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/vengine_cpy.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/error.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/init.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/model.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/_cffi_include.h → build/lib.linux-x86_64-3.10/cffi
copying cffi/parse_c_type.h → build/lib.linux-x86_64-3.10/cffi
copying cffi/_embedding.h → build/lib.linux-x86_64-3.10/cffi
copying cffi/_cffi_errors.h → build/lib.linux-x86_64-3.10/cffi
running build_ext
building ‘_cffi_backend’ extension
creating build/temp.linux-x86_64-3.10
creating build/temp.linux-x86_64-3.10/c
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.10 -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.10/c/_cffi_backend.o
c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
15 | #include <ffi.h>
| ^~~~~~~
compilation terminated.
error: command ‘/usr/bin/x86_64-linux-gnu-gcc’ failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cffi
Running setup.py clean for cffi
Failed to build cffi
Installing collected packages: pycparser, cffi
Running setup.py install for cffi: started
Running setup.py install for cffi: finished with status ‘error’
error: subprocess-exited-with-error

× Running setup.py install for cffi did not run successfully.
│ exit code: 1
╰─> [38 lines of output]
running install
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.10
creating build/lib.linux-x86_64-3.10/cffi
copying cffi/commontypes.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/backend_ctypes.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/api.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/cparser.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/lock.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/recompiler.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/setuptools_ext.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/verifier.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/pkgconfig.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/vengine_gen.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/ffiplatform.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/cffi_opcode.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/vengine_cpy.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/error.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/init.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/model.py → build/lib.linux-x86_64-3.10/cffi
copying cffi/_cffi_include.h → build/lib.linux-x86_64-3.10/cffi
copying cffi/parse_c_type.h → build/lib.linux-x86_64-3.10/cffi
copying cffi/_embedding.h → build/lib.linux-x86_64-3.10/cffi
copying cffi/_cffi_errors.h → build/lib.linux-x86_64-3.10/cffi
running build_ext
building ‘_cffi_backend’ extension
creating build/temp.linux-x86_64-3.10
creating build/temp.linux-x86_64-3.10/c
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.10 -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.10/c/_cffi_backend.o
c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
15 | #include <ffi.h>
| ^~~~~~~
compilation terminated.
error: command ‘/usr/bin/x86_64-linux-gnu-gcc’ failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> cffi

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

And Seahub URL shows internal server error :frowning:
Any idea how to fix this?
Thanks a lot for helping me!

Oh, I should have though about it. I’ll edit my previous post.

Just install libffi-dev:

sudo apt install -y libffi-dev

Hi Barolo, wanted to thank you again for your support, all works well now!

Just needed a fresh Ubuntu 22.04 install before applying your workaround (permissions were somehow messed up on previous install).

If anyone is interested, here the steps:

  1. Install Ubuntu Server 22.04 LTS (incl. LAMP stack)

  2. Install the database (e.g. MySQL) and create the ccnet, seafile & seahub databases

  3. Install dependencies for Seafile 9.0.5 & Ubuntu Server 22.04:

    sudo apt install python3 python3-{setuptools,pip} libmysqlclient-dev memcached libmemcached-dev libffi-dev
    
  4. Install Python modules for Seafile 9.0.5 & Ubuntu Server 22.04:

    sudo pip3 install django==3.2.* Pillow pylibmc captcha jinja2 sqlalchemy==1.4.3 django-pylibmc django-simple-captcha python3-ldap mysqlclient pycryptodome==3.12.0
    
  5. Download & install Seafile Server 9.0.5

  6. Install the package cffi 1.14.6 in the thirdpart folder, as suggested by Barolo:

    sudo pip3 install --force-reinstall --upgrade --target <SOMEPATH>/seafile-server-9.0.5/seahub/thirdpart cffi==1.14.6
    
  7. Run the installation script:

    ./<SOMEPATH>/seafile-server-9.0.5/setup-seafile-mysql.sh
    
  8. Start Seafile Server & Seahub with ./seafile.sh and ./seahub.sh scripts

Remark: if you install Seafile Server/Python modules as user and not as root, make sure to set the right directory permissions

5 Likes

OMG, Barolo and georgj, both of you made my day!!
I am so grateful for your help! Had to adjust the python modules because my server is still running on sqlite, and had to run the pip install (step 6) without sudo to make it work, but i finally figured it out thanks to your help!! Server back up and running. Guess it is time for another backup and the figure out how to move my seafile server to mariadb and perhaps docker, to make it more independent of the OS. Thanks again!

1 Like

Thanks a lot for the summary, was able to fix it on my Debian 12 box as well with it. Broken Python packages are way to common with the CE server due using outdated packages or pinning very specific releases in the install scripts.

2 Likes

OK, I found another issue with Seafdav, that stopped working after the upgrade to 22.04 and 9.0.5 :frowning:
It shows nothing in the log files, seems that server 9.05 simply ignores the seafdav.conf file and doesn’t attempt to start seafdav with seafile.sh
Does seafdav require additional python libraries since 9.05 or do I have to move the config file somewhere else?
With Ubuntu 20.04 and Seafile Server 9.0.4, seafdav was working without any issues and I haven’t changed that config at all.

Thanks again for your help,
Ruediger

Huuum, there is an issue with markupsafe but this is something you should see in controller.log. See this thread.

Otherwise it’s not something I’ve experimented.

Thanks for the fast reply.
I was looking in the wrong log file.
Turns out I didn’t install sqlalchemy because I thought this is just for mysql/mariadb, I’m still running with sqlite (upgrade issues).
After installing sqlalchemy it’s working now. thanks a lot.

I’ll spin up a new install of the Ubuntu Server 22.04, try your suggestion again and report back if I have more luck.

thank you again for your support, all works well now!

cffi 1.14.6 Raises another new issue here
TL;DR

Exception: Version mismatch: this is the 'cffi' package version 1.14.0, located in '/opt/seafile/seafile-pro-server-9.0.13/seahub/thirdpart/cffi/api.py'.  When we import the top-level '_cffi_backend' extension module, we get version 1.14.6, located in '/usr/local/lib/python3.10/dist-packages/_cffi_backend.cpython-310-x86_64-linux-gnu.so'.  The two versions should be equal; check your installation.
Error:Seahub failed to start.

Whole

[11/13/2022 12:21:39]root@ip-172-26-0-127:/opt/seafile/seafile-server-latest$ ./seahub.sh start

LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub at port 8000 ...

Error:Seahub failed to start.
Please try to run "./seahub.sh start" again
[11/13/2022 12:21:50]root@ip-172-26-0-127:/opt/seafile/seafile-server-latest$ 
[11/13/2022 12:21:50]root@ip-172-26-0-127:/opt/seafile/seafile-server-latest$ ./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 "/opt/seafile/seafile-pro-server-9.0.13/seahub/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/seafile/seafile-pro-server-9.0.13/seahub/thirdpart/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/opt/seafile/seafile-pro-server-9.0.13/seahub/thirdpart/django/core/management/__init__.py", line 395, in execute
    django.setup()
  File "/opt/seafile/seafile-pro-server-9.0.13/seahub/thirdpart/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/opt/seafile/seafile-pro-server-9.0.13/seahub/thirdpart/django/apps/registry.py", line 114, in populate
    app_config.import_models()
  File "/opt/seafile/seafile-pro-server-9.0.13/seahub/thirdpart/django/apps/config.py", line 301, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/opt/seafile/seafile-pro-server-9.0.13/seahub/thirdpart/registration/models.py", line 13, in <module>
    from seahub.base.accounts import User
  File "/opt/seafile/seafile-pro-server-9.0.13/seahub/seahub/base/accounts.py", line 28, in <module>
    from seahub.share.models import ExtraSharePermission
  File "/opt/seafile/seafile-pro-server-9.0.13/seahub/seahub/share/models.py", line 19, in <module>
    from seahub.utils.hasher import AESPasswordHasher
  File "/opt/seafile/seafile-pro-server-9.0.13/seahub/seahub/utils/hasher.py", line 4, in <module>
    from Crypto.Cipher import AES
  File "/usr/local/lib/python3.10/dist-packages/Crypto/Cipher/__init__.py", line 27, in <module>
    from Crypto.Cipher._mode_ecb import _create_ecb_cipher
  File "/usr/local/lib/python3.10/dist-packages/Crypto/Cipher/_mode_ecb.py", line 29, in <module>
    from Crypto.Util._raw_api import (load_pycryptodome_raw_lib,
  File "/usr/local/lib/python3.10/dist-packages/Crypto/Util/_raw_api.py", line 81, in <module>
    ffi = FFI()
  File "/opt/seafile/seafile-pro-server-9.0.13/seahub/thirdpart/cffi/api.py", line 54, in __init__
    raise Exception("Version mismatch: this is the 'cffi' package version %s, located in %r.  When we import the top-level '_cffi_backend' extension module, we get version %s, located in %r.  The two versions should be equal; check your installation." % (
Exception: Version mismatch: this is the 'cffi' package version 1.14.0, located in '/opt/seafile/seafile-pro-server-9.0.13/seahub/thirdpart/cffi/api.py'.  When we import the top-level '_cffi_backend' extension module, we get version 1.14.6, located in '/usr/local/lib/python3.10/dist-packages/_cffi_backend.cpython-310-x86_64-linux-gnu.so'.  The two versions should be equal; check your installation.
Error:Seahub failed to start.

FIXED by this

python3 -m pip install --force-reinstall --upgrade --target /opt/seafile/seafile-pro-server-9.0.13/seahub/thirdpart cffi==1.14.6

Hi I’m trying to get the seafile up and running after server migration from 18.x to 22.04 (on linux mint 21.1). So I have the same problem with the lib with server version 9.0.10.

I’m not sure about the rest of the configuration (like apache2) but as for now after applying the 14.6.0 library forced install my seahub is still not starting? At least it is not working as expected (Internal Server Error on webpage request). Seahub.sh start-fastcgi gives in response:

LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub (fastcgi) at 127.0.0.1:8000 ...

Warning: File comment has changed since version 6.3, while table `base_filecomment` is not migrated yet, please consider migrate it according to v6.3.0 release note, otherwise the file comment feature will not work correctly.

Unknown command: 'runfcgi'
Type 'manage.py help' for usage.Error:
Seahub failed to start.

Normal start runs but I got Internal Server Error on webpage launch. The seagub.log produces nothing.
Any advice? Thanks!

1 Like

seeing similar to the above error - bumping topic