Seafile server on Raspberry Pi with Docker

I have a 64 bit Raspberry Pi 4B. I made a fresh install of the OS and Docker using the recommended installation procedure. I ran docker compose up using the docker_compose.yml unmodified, and it fails to start. Here is the output:

seafile-mysql      | 2024-02-23 04:19:50+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.11.7+maria~ubu2204 started.
seafile-mysql      | 2024-02-23 04:19:50+00:00 [Warn] [Entrypoint]: /sys/fs/cgroup///memory.pressure not writable, functionality unavailable to MariaDB
seafile-mysql      | 2024-02-23 04:19:50+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
seafile-mysql      | 2024-02-23 04:19:50+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.11.7+maria~ubu2204 started.
seafile-mysql      | 2024-02-23 04:19:51+00:00 [Note] [Entrypoint]: MariaDB upgrade not required
seafile            | *** Running /etc/my_init.d/01_create_data_links.sh...
seafile-mysql      | 2024-02-23  4:19:51 0 [Note] Starting MariaDB 10.11.7-MariaDB-1:10.11.7+maria~ubu2204 source revision 87e13722a95af5d9378d990caf48cb6874439347 as process 1
seafile-mysql      | 2024-02-23  4:19:51 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
seafile-mysql      | 2024-02-23  4:19:51 0 [Note] InnoDB: Number of transaction pools: 1
seafile-mysql      | 2024-02-23  4:19:51 0 [Note] InnoDB: Using ARMv8 crc32 instructions
seafile-mysql      | 2024-02-23  4:19:51 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
seafile-mysql      | 2024-02-23  4:19:51 0 [Warning] mariadbd: io_uring_queue_init() failed with errno 1
seafile-mysql      | 2024-02-23  4:19:51 0 [Warning] InnoDB: liburing disabled: falling back to innodb_use_native_aio=OFF
seafile-mysql      | 2024-02-23  4:19:51 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
seafile-mysql      | 2024-02-23  4:19:51 0 [Note] InnoDB: Completed initialization of buffer pool
seafile-mysql      | 2024-02-23  4:19:51 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)
seafile            | mv: failed to access '/shared/logs/var-log': Too many levels of symbolic links
seafile            | *** /etc/my_init.d/01_create_data_links.sh failed with status 1
seafile            | 
seafile            | *** Killing all processes...
seafile-mysql      | 2024-02-23  4:19:51 0 [Note] InnoDB: End of log at LSN=46996
seafile-mysql      | 2024-02-23  4:19:51 0 [Note] InnoDB: 128 rollback segments are active.
seafile-mysql      | 2024-02-23  4:19:51 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
seafile-mysql      | 2024-02-23  4:19:51 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
seafile-mysql      | 2024-02-23  4:19:51 0 [Note] InnoDB: log sequence number 46996; transaction id 14
seafile-mysql      | 2024-02-23  4:19:51 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
seafile-mysql      | 2024-02-23  4:19:51 0 [Note] Plugin 'FEEDBACK' is disabled.
seafile-mysql      | 2024-02-23  4:19:51 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
seafile-mysql      | 2024-02-23  4:19:51 0 [Note] InnoDB: Buffer pool(s) load completed at 240223  4:19:51
seafile-mysql      | 2024-02-23  4:19:51 0 [Note] Server socket created on IP: '0.0.0.0'.
seafile-mysql      | 2024-02-23  4:19:51 0 [Note] Server socket created on IP: '::'.
seafile-mysql      | 2024-02-23  4:19:51 0 [Note] mariadbd: ready for connections.
seafile-mysql      | Version: '10.11.7-MariaDB-1:10.11.7+maria~ubu2204'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
seafile exited with code 1

Anything else I can try?

OP here. Today I tried installing the Seafile server on a laptop using Docker after a fresh installation of Ubuntu 22.04, and it started up flawlessly. So I’m wondering if there’s a reason the Raspberry Pi won’t work with a Docker + Seafile Server?

Hi, I’ve been having issue after issue trying to get this going on my raspberry pi, as well, using the latest docker compose yml file. I tried customizing the file a bit initially as I normally would (changing locations of persistent storage and such), passwords and DB name. No joy with that.

So, ultimately, I blew away all of the saved containers and images and started again with a fresh new copy of the docker-compose.yml file from this site, having re–pull the image, and changing nothing but the host listening port. Still no joy.

Below is the tail end of the install log:

seafile            |
seafile-mysql      | 2024-03-26  0:34:50 4 [Warning] Aborted connection 4 to db: 'unconnected' user: 'root' host: '192.168.160.4' (Got an error reading communication packets)
seafile            | Traceback (most recent call last):
seafile            |   File "/scripts/start.py", line 95, in <module>
seafile            | waiting for mysql server to be ready: %s (2003, "Can't connect to MySQL server on 'db' ([Errno 111] Connection refused)")
seafile            |     main()
seafile            |   File "/scripts/start.py", line 59, in main
seafile            |     init_seafile_server()
seafile            |   File "/scripts/bootstrap.py", line 166, in init_seafile_server
seafile            |     call('{} auto -n seafile'.format(setup_script), env=env)
seafile            |   File "/scripts/utils.py", line 70, in call
seafile            |     return subprocess.check_call(*a, **kw)
seafile            |   File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
seafile            |     raise CalledProcessError(retcode, cmd)
seafile            | subprocess.CalledProcessError: Command '/opt/seafile/seafile-server-11.0.6/setup-seafile-mysql.sh auto -n seafile' returned non-zero exit status 255.
^CGracefully stopping... (press Ctrl+C again to force)
[+] Stopping 3/3

Somewhere it was mentioned that the binding_address variable in the my.cnf file inside of the running Seafil instance may need to be manually changed to ‘0.0.0.0’ to allow the database to accept connections from anywhere. Attempted setting this variable within the docker-compose.yml file itself and re-installing, but still no luck.
I’m guessing there is something wrong with image itself with arm64 image or with python versions or something like that, but I am by far an expert and don’t really know where to go from here. Perhaps it’s simply the case that the arm64 image just isn’t ready to go, but evne that I’m not sure how to confirm.

Please, any help/insight/advice would be very much appreciated.

Thank you!

  • AB

What operation system and version do you use on Raspberry Pi. The docker image we used for Seafile on ARM64 is based on Ubuntu 22.04. It is likely a compatibility issue at the operation system level for MySQL related packages.

Can you try to change MariaDB to MySQL?

Hi Daniel,

THank you for getting back to me.

I am actually running the latest version of dietpi, which is essentially Debian 12 with a bunch of customized scripts to take care of common tasks. As far as I’m aware, though, it does not package it’s own version of mysql or mariadb, and I did not set it to install when I installed the OS.

As for the version of mysql (mariadb) being potentially the problem, I’m a bit on confused on that one. Perhaps you can educate me a bit.

Why would the version of the OS matter that much when it comes to talking to the database? Does the docker image/container not come packaged with the version of mysql that you specify in the YML file? Or would it have to do with something lower-level, like networking?

That I could maybe understand, however, as you can see in those lines from the log file, it looks as though it connects to the database and verifies the root user password, which would tell me that the networking is fine.

Any other thoughts?

Thank you again for your time.

-AB

From the log file you provided

We can see that the Python script that initializing Seafile configuration files when you run the Docker image for the first time cannot connect to the MariaDB.

Some other users also report such a problem. But if you enter into the docker container, and manually connect the MariaDB using MySQL command line tool, it can connect. So the conclusion is that, the Python script cannot connect to MariaDB inside the docker.

The docker image is built based on Ubuntu 22.04 with a certain version of libmysqlclient and pymysql. I suspect that this specific version of libmysqlclient and pymysql cannot work with the MariaDB docker image on your Raspberry Pi.

By the way, we have tested the ARM64 docker image on a Server with ARM64 CPU running Ubuntu 22.04. It can work.

I tried installing Ubuntu 22.04 on my raspberry pi. When I run docker compose up for the first time, the server doesn’t start. here is the log:

Attaching to seafile, seafile-memcached, seafile-mysql
seafile-mysql      | 2024-03-31 03:03:55+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.11.7+maria~ubu2204 started.
seafile            | *** Running /etc/my_init.d/01_create_data_links.sh...
seafile            | *** Booting runit daemon...
seafile            | *** Runit started as PID 16
seafile            | *** Running /scripts/enterpoint.sh...
seafile            | 2024-03-31 03:03:56 Waiting Nginx 
seafile-mysql      | 2024-03-31 03:03:56+00:00 [Warn] [Entrypoint]: /sys/fs/cgroup///memory.pressure not writable, functionality unavailable to MariaDB
seafile-mysql      | 2024-03-31 03:03:56+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
seafile-mysql      | 2024-03-31 03:03:56+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.11.7+maria~ubu2204 started.
seafile            | 2024-03-31 03:03:56 Nginx ready 
seafile            | 2024-03-31 03:03:56 This is an idle script (infinite loop) to keep container running. 
seafile-mysql      | 2024-03-31 03:03:56+00:00 [Note] [Entrypoint]: MariaDB upgrade not required
seafile-mysql      | 2024-03-31  3:03:56 0 [Note] Starting MariaDB 10.11.7-MariaDB-1:10.11.7+maria~ubu2204 source revision 87e13722a95af5d9378d990caf48cb6874439347 as process 1
seafile-mysql      | 2024-03-31  3:03:57 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
seafile-mysql      | 2024-03-31  3:03:57 0 [Note] InnoDB: Number of transaction pools: 1
seafile-mysql      | 2024-03-31  3:03:57 0 [Note] InnoDB: Using ARMv8 crc32 instructions
seafile-mysql      | 2024-03-31  3:03:57 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
seafile-mysql      | 2024-03-31  3:03:57 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
seafile-mysql      | 2024-03-31  3:03:57 0 [Note] InnoDB: Completed initialization of buffer pool
seafile-mysql      | 2024-03-31  3:03:57 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)
seafile-mysql      | 2024-03-31  3:03:57 0 [Note] InnoDB: End of log at LSN=1050398
seafile-mysql      | 2024-03-31  3:03:57 0 [Note] InnoDB: 128 rollback segments are active.
seafile-mysql      | 2024-03-31  3:03:57 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
seafile-mysql      | 2024-03-31  3:03:57 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
seafile-mysql      | 2024-03-31  3:03:57 0 [Note] InnoDB: log sequence number 1050398; transaction id 746
seafile-mysql      | 2024-03-31  3:03:57 0 [Note] Plugin 'FEEDBACK' is disabled.
seafile-mysql      | 2024-03-31  3:03:57 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
seafile-mysql      | 2024-03-31  3:03:57 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
seafile-mysql      | 2024-03-31  3:03:57 0 [Note] Server socket created on IP: '0.0.0.0'.
seafile-mysql      | 2024-03-31  3:03:57 0 [Note] Server socket created on IP: '::'.
seafile-mysql      | 2024-03-31  3:03:57 0 [Note] mariadbd: ready for connections.
seafile-mysql      | Version: '10.11.7-MariaDB-1:10.11.7+maria~ubu2204'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
seafile-mysql      | 2024-03-31  3:03:58 0 [Note] InnoDB: Buffer pool(s) load completed at 240331  3:03:58
seafile-mysql      | 2024-03-31  3:03:58 3 [Warning] Access denied for user 'root'@'172.20.0.4' (using password: YES)

So out of the box, it doesn’t seem to work on Raspberry Pi even with Ubuntu 22.04 installed. Are there subsequent steps that need to be taken?

I also could not get latest seafile running on arm64 / ubuntu 22.04.
For now I am using version seafileltd/seafile-mc:11.0.5-arm which works for me in stead of version latest.

edit: I see that the ‘latest’ version has been pushed a day ago; haven’t tested that one yet.

The problem has been solved in this GitHub issue: "Connection refused" to mysql in docker on Raspberry Pi · Issue #2747 · haiwen/seafile · GitHub

It may related to two things:

  1. The image for 11.0.6-arm is not correctly pushed.
  2. The script in Seafile docker image for checking MySQL ready may have a bug, which we will remove soon.