Unable to run Seafile on FreeBSD 14 installing from packages

I’m trying to get seafile server and hub running on FreeBSD. I will need your help as I am unable to figure out from the logs what could be the problem.

I’ve installed from packages the below,
seafile-server-11.0.2
seahub-11.0.2

After installing I noticed that file permissions were not applied, so I chowned -R seafile:seafile what was required (hopefully all).

From the required packages I cannot install python-imaging as it is no longer available on freebsd for several years now. The port maintainer recommends installing pillow instead. ok, done that.

Now when I try to open the page I get this message:

Page unavailable

Sorry, but the requested page is unavailable due to a server hiccup.

Our engineers have been notified, so check back later.

Ok, I set the startup script to output debug logs, and got this in the seahub.log file:

less seahub.log
2024-03-08 17:06:47,849 [INFO] xmlschema:1234 include_schema Resource ‘XMLSchema.xsd’ is already loaded
2024-03-08 17:06:48,560 [ERROR] django.request:224 log_response Internal Server Error: /
Traceback (most recent call last):
File “/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py”, line 47, in inner
response = get_response(request)
File “/usr/local/lib/python3.9/site-packages/django/utils/deprecation.py”, line 116, in call
response = self.process_request(request)
File “/usr/local/www/haiwen/seafile-server/seahub/seahub/base/middleware.py”, line 69, in process_request
cur_note = cache.get(‘CUR_TOPINFO’) if cache.get(‘CUR_TOPINFO’) else
File “/usr/local/lib/python3.9/site-packages/django/core/cache/backends/filebased.py”, line 34, in get
with open(fname, ‘rb’) as f:
PermissionError: [Errno 13] Permission denied: ‘/tmp/seahub_cache/ceec40422771f78d283f254429d1d993.djcache’
2024-03-08 17:06:49,634 [INFO] xmlschema:1234 include_schema Resource ‘XMLSchema.xsd’ is already loaded
2024-03-08 17:06:50,339 [ERROR] django.request:224 log_response Internal Server Error: /favicon.ico
Traceback (most recent call last):
File “/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py”, line 47, in inner
response = get_response(request)
File “/usr/local/lib/python3.9/site-packages/django/utils/deprecation.py”, line 116, in call
response = self.process_request(request)
File “/usr/local/www/haiwen/seafile-server/seahub/seahub/base/middleware.py”, line 69, in process_request
cur_note = cache.get(‘CUR_TOPINFO’) if cache.get(‘CUR_TOPINFO’) else
File “/usr/local/lib/python3.9/site-packages/django/core/cache/backends/filebased.py”, line 34, in get
with open(fname, ‘rb’) as f:
PermissionError: [Errno 13] Permission denied: ‘/tmp/seahub_cache/ceec40422771f78d283f254429d1d993.djcache’
seahub.log (END)

Any pointers to what I can do next?

This looks to me like a missing dependency, but I’m not an expert. You might need to create a python virtual environment (venv) within which to install dependencies with pip, if your pip refuses to mess with system files in a way that might break your package manager. You would also need to use that venv to run seafile.

The official manual doesn’t cover using venv, but does list the packages that would need to be installed. The Linux instructions can probably be adapted to work for FreeBSD. Installation with MySQL - Seafile Admin Manual

I have forked the official docs to include instructions for using venv on Debian 12, which might help if you need or want the venv. seafile-admin-docs/manual/deploy/using_mysql.md at python-venv-on-deb12 · crowtrobot/seafile-admin-docs · GitHub

And this modified page that shows how I activate the venv before starting seafile or seahub isn’t going to translate directly to FreeBSD since I think it doesn’t use systemd, but still might be useful to give you an idea how you can do it. seafile-admin-docs/manual/deploy/start_seafile_at_system_bootup.md at python-venv-on-deb12 · crowtrobot/seafile-admin-docs · GitHub

I don’t know if it helps,but…
I’m running seafile in a FreeBSD 14.x jail with ldap support. That’s the list of all the installed packages and seafile is running fine. I use apache as a proxy, running in it’s own jail, same goes for mysql as the database.

bash-5.2.26_1 =
brotli-1.1.0,1 =
ca_root_nss-3.93_2 =
curl-8.6.0 =
cyrus-sasl-2.1.28_4 =
e2fsprogs-libuuid-1.47.0 =
expat-2.6.0 =
fontconfig-2.15.0_2,1 =
freetype2-2.13.2 =
fribidi-1.0.13_1 =
fusefs-libs-2.9.9_2 =
gettext-runtime-0.22.3_1 =
giflib-5.2.1_1 =
glib-2.78.4,2 =
graphite2-1.3.14 =
groff-1.23.0_3 =
harfbuzz-8.3.0 =
hidapi-0.14.0 =
icu-74.2,1 =
indexinfo-0.3.1 =
jansson-2.14 =
jbigkit-2.1_2 =
jpeg-turbo-3.0.2 =
lcms2-2.16_1 =
libX11-1.8.7_1,1 =
libXScrnSaver-1.2.4_1 =
libXau-1.0.9_1 =
libXdmcp-1.1.5 =
libXext-1.3.6,1 =
libXft-2.3.7_1 =
libXrender-0.9.10_2 =
libarchive-3.7.2_1,1 =
libcbor-0.11.0 =
libcjson-1.7.17 =
libdeflate-1.19 =
libedit-3.1.20230828_1,1 =
libevent-2.1.12 =
libevhtp-1.2.16_4 =
libffi-3.4.4_1 =
libfido2-1.14.0 =
libgcrypt-1.10.3_1 =
libgpg-error-1.48 =
libiconv-1.17_1 =
libidn2-2.3.7 =
libimagequant-4.3.0_1 =
libinotify-20211018_1 =
libjwt-1.17.0 =
libltdl-2.4.7 =
liblz4-1.9.4_1,1 =
libnghttp2-1.59.0 =
libpaper-1.1.28_1 =
libpsl-0.21.5 =
libraqm-0.10.1 =
libsearpc-3.2.0_2,1 =
libssh2-1.11.0_1,3 =
libunistring-1.2 =
libunwind-20240112 =
libxcb-1.16.1 =
libxml2-2.11.7 =
libxslt-1.1.37_1 =
libyaml-0.2.5 =
libzdb-3.2.3 =
mpdecimal-2.5.1 =
multitail-6.5.0_1 =
mysql80-client-8.0.35 =
nspr-4.35 =
nss-3.97 =
oniguruma-6.9.9 =
openjpeg-2.5.0_1 =
openldap26-client-2.6.7 =
pcre2-10.43 =
perl5-5.36.3_1 =
pkg-1.20.9_1 =
png-1.6.43 =
postgresql13-client-13.14 =
psutils-1.17_6 =
py39-Babel-2.14.0 =
py39-Jinja2-3.1.3 =
py39-asgiref-3.7.2_1 =
py39-bleach-6.1.0 =
py39-blinker-1.7.0 =
py39-certifi-2024.2.2 =
py39-cffi-1.16.0 =
py39-chardet-5.2.0,1 =
py39-charset-normalizer-3.3.2 =
py39-cryptography-41.0.7_3,1 =
py39-dateutil-2.8.2 =
py39-defusedxml-0.7.1 =
py39-django-appconf-1.0.6 =
py39-django-formtools-2.3 =
py39-django-picklefield-3.1 =
py39-django-ranged-response-0.2.0_2 =
py39-django-simple-captcha-0.5.20 =
py39-django-statici18n-2.4.0 =
py39-django-webpack-loader-3.0.1,1 =
py39-django32-3.2.25 =
py39-djangorestframework-3.14.0,1 =
py39-djangosaml2-1.9.2 =
py39-elementpath-4.3.0 =
py39-et_xmlfile-1.1.0 =
py39-future-0.18.3 =
py39-greenlet-3.0.3 =
py39-gunicorn-21.2.0_1 =
py39-idna-3.6 =
py39-importlib-metadata-7.0.2 =
py39-importlib-resources-6.1.3 =
py39-json5-0.9.11 =
py39-lxml-4.9.3 =
py39-markdown-3.4.4 =
py39-markupsafe-2.1.5 =
py39-mysqlclient-2.2.1 =
py39-oauthlib-3.2.2 =
py39-olefile-0.46 =
py39-openpyxl-3.1.1 =
py39-openssl-23.2.0,1 =
py39-packaging-23.2 =
py39-pillow-10.2.0 =
py39-png-0.0.17 =
py39-psycopg2-2.9.9 =
py39-pyasn1-0.5.0 =
py39-pyasn1-modules-0.3.0 =
py39-pycparser-2.21 =
py39-pycryptodome-3.20.0 =
py39-pyjwt-2.8.0 =
py39-pymysql-1.0.2 =
py39-pysaml2-7.5.0 =
py39-pysocks-1.7.1 =
py39-python-cas-1.6.0 =
py39-python-ldap-3.4.4 =
py39-python-pam-1.8.4 =
py39-pytz-2024.1,1 =
py39-qrcode-7.4_1 =
py39-requests-2.31.0 =
py39-requests-oauthlib-1.3.1 =
py39-seafdav-11.0.5 =
py39-seafobj-11.0.5 =
py39-setproctitle-1.3.2 =
py39-setuptools-63.1.0_1 =
py39-six-1.16.0 =
py39-sqlalchemy14-1.4.51 =
py39-sqlite3-3.9.18_7 =
py39-sqlparse-0.4.4 =
py39-tinycss2-1.2.1_2 =
py39-tkinter-3.9.18_7 =
py39-typing-extensions-4.9.0 =
py39-urllib3-1.26.18,1 =
py39-webencodings-0.5.1 =
py39-xmlschema-3.0.2 =
py39-yaml-6.0.1 =
py39-zipp-3.17.0 =
py39-zope.interface-5.3.0 =
python39-3.9.18_1 =
readline-8.2.7_1 =
seafile-server-11.0.5 =
seahub-11.0.5 =
sqlite3-3.45.0_1,1 =
tcl86-8.6.14_1 =
tiff-4.4.0_3 =
tk86-8.6.14_1 =
tmux-3.3a_2 =
uchardet-0.0.8_1 =
vim-9.1.0015_2 =
webp-1.3.2_1 =
xmlsec1-1.3.2_1 =
xorgproto-2023.2 =
xxd-9.1.0015_1 =
zstd-1.5.5_1 =

I think you do have some missing dependencies. If I read this right (no guarantee since my experience with FreeBSD is limited), “py39-django32-3.2.25” is django 3.2. That was the right django for seafile version 10, but with version 11 you need django 4.2. And a few of the others I looked at were probably close enough, but not exact. For example, the manual calls for “pycryptodome==3.16.*” but it looks like you have 3.20. That’s probably ok, but I don’t actually know for sure that it is.

And the mention of running with jails brings up another bit I had not considered for my previous reply. I thought “PermissionError: [Errno 13] Permission denied: ‘/tmp/seahub_cache/” might be a symptom resulting from a dependency problem, but the limitations imposed by the jail might actually be causing that. I think it would be worth trying to getting inside the jail, and see if you can (as the user who will run seafile) create that directory and files inside of it. There might be another place you need to change ownership or permissions or jails config file to allow seafile to write into the jail’s /tmp.

Hi Tom,
you mixed me up with the threadowner.
My installation runs fine even if the dependencies are not exactly as required.
My guess, Ultima, the maintainer of the seafile packages is in contact with the seafile developers and got an OK for this, else he wouldn’t have made the upgrade.

I did indeed. Suddenly it makes a lot more sense. I guess I shouldn’t try to post when tired. :slight_smile:

Probably a leftover from a previous run as a different user.

I think you need to adjust the owner of /tmp/seahub_cache (recursively) to the user under which seahub is being run.

Alternatively you could stop seahub, delete the folder /tmp/seahub_cache and start seahub again.