Setup-seafile-mysql.sh failed

setup-seafile-mysql.sh failed with the following error:

./setup-seafile-mysql.sh
Checking python on this machine …


This script will guide you to setup your seafile server using MySQL.
Make sure you have read seafile server manual at

    https://download.seafile.com/published/seafile-manual/home.md

Press ENTER to continue

Error: “/opt/seafile/seafile-server/src/seafile-server-7.1.4-server/scripts/seafile” not found

Does someone have an idea how to fix this problem?

The following scripts are available:

/opt/seafile/seafile-server/src/seafile-server-7.1.4-server/scripts # ls -l
total 168
drwxrwxr-x 2 root root 4096 6. Mai 05:44 build
-rw-rw-r-- 1 root root 11381 6. Mai 05:44 check_init_admin.py
-rw-rw-r-- 1 root root 103 6. Mai 05:44 gc.bat
-rwxrwxr-x 1 root root 1753 6. Mai 05:44 reset-admin.sh
-rwxrwxr-x 1 root root 1746 6. Mai 05:44 seaf-fsck.sh
-rwxrwxr-x 1 root root 3134 6. Mai 05:44 seaf-fuse.sh
-rwxrwxr-x 1 root root 2641 6. Mai 05:44 seaf-gc.sh
-rwxrwxr-x 1 root root 5000 6. Mai 05:44 seafile.sh
-rwxrwxr-x 1 root root 4078 6. Mai 05:44 seafobj_migrate.py
-rw-rw-r-- 1 root root 362 6. Mai 05:44 seahub.conf
-rwxrwxr-x 1 root root 7906 6. Mai 05:44 seahub.sh
-rw-rw-r-- 1 root root 614 6. Mai 05:44 server-release.md
-rw-rw-r-- 1 root root 57232 6. Mai 05:44 setup-seafile-mysql.py
-rwxrwxr-x 1 root root 1548 6. Mai 05:44 setup-seafile-mysql.sh
-rwxrwxr-x 1 root root 22073 6. Mai 05:44 setup-seafile.sh
drwxrwxr-x 4 root root 4096 6. Mai 05:44 sql
-rw-rw-r-- 1 root root 2707 6. Mai 05:44 sqlite2mysql.py
-rwxrwxr-x 1 root root 5063 6. Mai 05:44 sqlite2mysql.sh
drwxrwxr-x 4 root root 4096 6. Mai 05:44 upgrade

Where did you pick up your copy of Seafile? It doesn’t appear to be from the official website. What distro are you trying to install on?

The reason for the error is the script is looking for a file or folder called “seafile” under the scripts path and it’s not there… It’s the reason for the error. However, this “scripts” folder is unfamiliar to me. Most of the scripts, I am familiar with, but there are a couple that aren’t in an installation from the official website.

@wthess you are right, it looks like that he downloaded the source code for seafile server, therefore the /src/. This is not intended. He needs to download, like you say, from seafile downlad.

1 Like

I use Gentoo Linux and try to build the seafile server according this manual.

I downloaded the source tarballs of the latest tag from

I recommend you to use the build3.sh script to compile the seafile package. Maybe you have to adapt the dependencies a bit, but you got an idea.

1 Like

I’m in agreement with this, @jobenvil … Unfortunately, many of the Seafile source builds aren’t always reliable. Additionally, the manuals for those builds often have outdated or missing information. The developers spend most of their time and resources on the Pro and CE versions for generic Linux since that’s where most of the demand is.

I called build3.sh as follows:

build3.sh --mysql_config=/usr/bin/mariadb_config

It stopped with the following output:


-> [12/12] Build Seafile server

  • python3 /opt/seafile/haiwen-build/seafile-server/scripts/build/build-server.py --libsearpc_version=3.1.0 --ccnet_version=6.0.1 --seafile_version=6.0.1 --version=–mysql_config=/usr/bin/mariadb_config --thirdpartdir=/opt/seafile/haiwen-build/seahub_thirdparty --srcdir=/opt/seafile/built-seafile-sources/R–mysql_config=/usr/bin/mariadb_config --mysql_config=/usr/bin/mysql_config --outputdir=/opt/seafile/built-seafile-server-pkgs --yes
    [ERROR] --mysql_config=/usr/bin/mariadb_config is not a valid version
    Usage: build-server.py [options]

Options:
-h, --help show this help message and exit
–yes
–jobs=JOBS
–thirdpartdir=THIRDPARTDIR
where to find the thirdpart libs for seahub
–version=VERSION the version to build. Must be digits delimited by
dots, like 1.3.0
–seafile_version=SEAFILE_VERSION
the version of seafile as specified in its
“configure.ac”. Must be digits delimited by dots, like
1.3.0
–libsearpc_version=LIBSEARPC_VERSION
the version of libsearpc as specified in its
“configure.ac”. Must be digits delimited by dots, like
1.3.0
–ccnet_version=CCNET_VERSION
the version of ccnet as specified in its
“configure.ac”. Must be digits delimited by dots, like
1.3.0
–builddir=BUILDDIR the directory to build the source. Defaults to /tmp
–outputdir=OUTPUTDIR
the output directory to put the generated server
tarball. Defaults to the current directory.
–srcdir=SRCDIR Source tarballs must be placed in this directory.
–keep keep the build directory after the script exits. By
default, the script would delete the build directory
at exit.
–nostrip do not strip debug symbols
–s3 enable amazon s3 support
–mysql_config=MYSQL_CONFIG
Absolute path to mysql_config or mariadb_config
program.

-> BUILD SUCCESSFULLY COMPLETED.

Is there a log file to get more information?

Can you verify that his file exists on your install? It does not exist on mine. You are probably getting that error because that file does not exist. That particular program is part of the C connector for mariadb and part of the developer’s library for mariadb. It’s normally not needed. The build3.sh script depends upon it… Try installing the libmariadb-dev package and rerun the script.

The file exists:

ls -l /usr/bin/mariadb*
lrwxrwxrwx 1 root root 5 29. Mai 20:18 /usr/bin/mariadb -> mysql
lrwxrwxrwx 1 root root 11 29. Mai 20:18 /usr/bin/mariadb-access -> mysqlaccess
lrwxrwxrwx 1 root root 10 29. Mai 20:18 /usr/bin/mariadb-admin -> mysqladmin
lrwxrwxrwx 1 root root 11 29. Mai 20:18 /usr/bin/mariadb-backup -> mariabackup
lrwxrwxrwx 1 root root 11 29. Mai 20:18 /usr/bin/mariadb-binlog -> mysqlbinlog
lrwxrwxrwx 1 root root 10 29. Mai 20:18 /usr/bin/mariadb-check -> mysqlcheck
lrwxrwxrwx 1 root root 17 29. Mai 20:18 /usr/bin/mariadb-client-test -> mysql_client_test
lrwxrwxrwx 1 root root 26 29. Mai 20:18 /usr/bin/mariadb-convert-table-format -> mysql_convert_table_format
lrwxrwxrwx 1 root root 9 29. Mai 20:18 /usr/bin/mariadb-dump -> mysqldump
lrwxrwxrwx 1 root root 13 29. Mai 20:18 /usr/bin/mariadb-dumpslow -> mysqldumpslow
lrwxrwxrwx 1 root root 15 29. Mai 20:18 /usr/bin/mariadb-find-rows -> mysql_find_rows
lrwxrwxrwx 1 root root 20 29. Mai 20:18 /usr/bin/mariadb-fix-extensions -> mysql_fix_extensions
lrwxrwxrwx 1 root root 12 29. Mai 20:18 /usr/bin/mariadb-hotcopy -> mysqlhotcopy
lrwxrwxrwx 1 root root 11 29. Mai 20:18 /usr/bin/mariadb-import -> mysqlimport
lrwxrwxrwx 1 root root 12 29. Mai 20:18 /usr/bin/mariadb-plugin -> mysql_plugin
lrwxrwxrwx 1 root root 25 29. Mai 20:18 /usr/bin/mariadb-secure-installation -> mysql_secure_installation
lrwxrwxrwx 1 root root 19 29. Mai 20:18 /usr/bin/mariadb-setpermission -> mysql_setpermission
lrwxrwxrwx 1 root root 9 29. Mai 20:18 /usr/bin/mariadb-show -> mysqlshow
lrwxrwxrwx 1 root root 9 29. Mai 20:18 /usr/bin/mariadb-slap -> mysqlslap
lrwxrwxrwx 1 root root 9 29. Mai 20:18 /usr/bin/mariadb-test -> mysqltest
lrwxrwxrwx 1 root root 19 29. Mai 20:18 /usr/bin/mariadb-tzinfo-to-sql -> mysql_tzinfo_to_sql
lrwxrwxrwx 1 root root 13 29. Mai 20:18 /usr/bin/mariadb-upgrade -> mysql_upgrade
lrwxrwxrwx 1 root root 13 29. Mai 20:18 /usr/bin/mariadb-waitpid -> mysql_waitpid
lrwxrwxrwx 1 root root 40 29. Mai 18:17 /usr/bin/mariadb_config -> aarch64-unknown-linux-gnu-mariadb_config
lrwxrwxrwx 1 root root 12 29. Mai 20:18 /usr/bin/mariadbd-multi -> mysqld_multi
lrwxrwxrwx 1 root root 11 29. Mai 20:18 /usr/bin/mariadbd-safe -> mysqld_safe
lrwxrwxrwx 1 root root 18 29. Mai 20:18 /usr/bin/mariadbd-safe-helper -> mysqld_safe_helper

ls -l /usr/bin/aarch64-unknown-linux-gnu-mariadb*
-rwxr-xr-x 1 root root 10584 29. Mai 18:17 /usr/bin/aarch64-unknown-linux-gnu-mariadb_config

Can you verify that his file exists on your install?

Please see my previous comment.

why you don’t take a already built release? are you using ARMv7 or ARMx64?

Do you have mariadb/mysql at all?

I mean, you are using the build3.sh script, you should know what you are doing. If not, I recommend you to give up. The official compiling guide is here.

Ok, your /usr/bin/mariadb_config file is a symlink to an aarch64 architecture program. I don’t know much about Gentoo and the platforms upon which it will run, but that script does not like the version of it. There may be missing dependencies, outdated dependencies, or it is trying to execute a 64 bit program on a 32 bit platform, etc…

I’m in agreement with @jobenvil. If you can install an already built release, you’ll be saving yourself a whole heck of a lot of trouble.

I use Gentoo Linux (64 bit) on a Raspberry Pi 4. There is no built available for this distribution. Therefore I try to build the seafile server by myself according this manual. But I have problems to run setup-seafile-mysql.sh (see my initial comment).
The compiling guide recommended by @jobenvil looks more up-to-date. I will try it.

The recommended compiling guide seems to be for the client.