-
Notifications
You must be signed in to change notification settings - Fork 0
For Developers ElabFTW
This section "For Developers elabFTW" is not maintained anymore, as it is an installation protocol from the past. However, maybe it is helping someone in the future.
This section is directed towards developers or admins to maintain an installation of elabFTW.
Table of content
- Installation
- Important elabFTW commands
- Troubleshooting
-
Download, burn image and follow installation instructions: https://ubuntu.com/download/server
-
Install a GUI without additional packages:
sudo apt install xorg
sudo apt install --no-install-recommends lubuntu-core
For further information:
https://askubuntu.com/questions/53822/how-do-you-run-ubuntu-server-with-a-gui
- (Optional) Install the uncomplicated firewall:
https://www.youtube.com/watch?v=XtRXm4FFK7Q
sudo apt-get install ufw
- (Optional) Install antivirus software to run manually:
https://www.heise.de/tipps-tricks/Virenschutz-unter-Linux-3885535.html
sudo apt-get install clamtk
From https://doc.elabftw.net/install.html
-
Local domain name
sudo nano /etc/hosts
Edit the hosts file to redirect the IP to "elab.local" -
Check if all dependencies are installed
sudo apt-get install curl
sudo apt-get install docker
sudo apt-get install docker-compose
sudo apt-get install dialog
sudo apt-get install git
sudo apt-get install zip
-
Install elabFTW
# get the program (a bash script) and make it executable
curl -sL https://get.elabftw.net -o elabctl &&chmod +x elabctl
# add it to a directory in your $PATH
sudo mv elabctl /usr/local/bin/
sudo elabctl install
-
Don't change anything with the pre-configuration file
-
Select to install a server
-
Enter the local domain elab.local
-
Select self-certified.
-
Avoid suspending PC
Sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
From https://www.seobility.net/en/wiki/CronJob:
Structure and syntax of a CronTab file Cron uses special configuration files, so-called CronTab files, which contain a list of cron jobs to be executed. CronTab stands for Cron Table. Each line in the CronTab file represents a CronJob. It looks similar to a row of columns separated by a space. Each line specifies when and how often a particular command or script should be executed. In a CronTab file, empty lines or lines beginning with #, spaces, or tabs are ignored. Lines beginning with # are considered user comments. Active lines in a CronTab either declare an environment variable or define a CronJob. Comments are not allowed in active lines. The CronTab file can be accessed in a command-line interpreter by typing "crontab-e". The commands in the CronTab file and their runtime are checked by the Cron daemon, which executes them in the system background. Each CronTab has the following basic structure with six columns arranged like a table: command to execute The first five columns contain time values which define when a command should be executed. These are, from left to right: • Minute, specified as 0 - 59
• Hour, specified as 0 - 23
• Day, specified as 1 - 31
• Month, specified as 1 - 12
• Weekday, specified as 0 - 7, 0 or 7 are Sundays
For each of these values, the wildcard "" can be used for execution at any time (i.e. at any minute, hour, day, month or weekday), "/n" for execution every n (minutes, hours, etc.) and "n,x,y" for execution on / at n, x or y. The last column specifies the relative or absolute path of the script to be executed. The CronJob is performed when the minute, hour, month, and day of the month or weekday match the current time. Some Cron implementations also support special strings. These strings are used instead of the first five fields in the CronTab file. Each string specifies a specific frequency:
• @yearly / @annually: Execution once a year at midnight of January 1st (0 0 1 1 *)
• @monthly: Execution once a month at midnight of the first day of the month (0 0 1 * *)
• @weekly: execution once a week at midnight on Sunday (0 0 * * 0)
• @daily: Execution once a day at midnight (0 0 * * *)
• @hourly: execution at the beginning of each hour (0 * * * * *)
• @reboot: one-time execution at system start
An example of a CronJob would be the backup of a database at 2 am each day of the week. In this case, the CronTab file would contain the following:
0 2 * * */bin/sh backup.sh
From https://gist.github.com/NicolasCARPi/5d9e2599857a148a54b0
#!/bin/sh #backup.sh - Backup eLabFTW installation #------ #CONFIG #------ BACKUP_DIR='~/.backups/elabftw' ELAB_ROOT='/var/www/html/elabftw' DB_HOST='localhost' DB_NAME='elabftw' DB_USER='elabftw' DB_PASSWORD='secr3t' #---------- #END CONFIG #---------- #create the dir if it's not here already mkdir -p ${BACKUP_DIR} #get clean date date=$(date --iso-8601)#2016-02-10 #elab sql backup ################# #make a dump of the database in elabftw.sql file mysqldump -h${DB_HOST}-u${DB_USER}-p${DB_PASSWORD}-r dump.sql ${DB_NAME} #compress the file gzip dump.sql #copy this file somewhere else using ssh (scp) #this requires to have ssh correctly configured with public key authentication #scp -q ${DB_NAME}.sql.gz user@computer:.backups/elabftw-${date}.sql.gz #move the file to a local backup dir mv dump.sql.gz ${BACKUP_DIR}/elabftw-${date}.sql.gz #uploaded files backup ####################### #make a zip of the uploads folder zip -rq archive.zip ${ELAB_ROOT}/uploads #add the config file zip -rq archive.zip ${ELAB_ROOT}/config.php #copy the tarball to somewhere else using ssh (scp) #scp -q archive.zip user@computer:.backups/elabftw-${date}.zip #move the file to a local backup dir mv archive.zip ${BACKUP_DIR}/elabftw-${date}.zip
Sudo crontab –e
0 4 * * * /usr/local/bin/elabctl backup
- (Should be done by borg, but cannot harm to have a 2nd) Copy the
/var/backups/elabftw/mysql_dump_xy.sql.gz
files to the hard drive - (Should be done by borg, but cannot harm to have a 2nd) Save the etc/elabftw.yml to the hard drive
- Copy the borg-extract to the hard drive:
- Open a terminal in the external hard drive in the folder you want to extract to.
sudo borg list /var/backups/borg-init
- ENTER PASSPHRASE
sudo borg extract --list /var/backups/borg-init::elab-2023-12-01_04-00
- ENTER PASSPHRASE
Basically follow: https://doc.elabftw.net/backup.html
- The mysql dump, and the uploaded files are needed. The configuration file is optional.
- The uploaded files should be extracted.
mv /path/to/uploaded-files-backup/* /var/elabftw/web
chown -R 101:101 /var/elabftw/web
- Now the elabftw server should be running
gunzip mysql_dump-YYYY-MM-DD.sql.gz # uncompress the file
docker cp mysql_dump-YYYY-MM-DD.sql mysql:/ # copy it inside the mysql container
docker exec -it mysql bash # spawn a shell in the mysql container
mysql -uroot -p$MYSQL_ROOT_PASSWORD # login to mysql prompt ROOT PASSWORD not the other one!!
Mysql> drop database elabftw; # delete the brand new database
Mysql> create database elabftw character set utf8mb4 collate utf8mb4_0900_ai_ci; # create a new one
Mysql> use elabftw; # select it
Mysql> set names utf8mb4; # make sure you import in utf8 (don't do this if you are in latin1)
Mysql> source mysql_dump-YYYY-MM-DD.sql; # import the backup
Mysql> exit;
Click to expand
Ubuntu LTS Server installation.
MAC Address added to network. IP:
130.149.94.67 / 255.255.25.128/
130.149.94.1 DNS = 130.149.7.7
Computername = Computer-67
File system:
• SSD swap 16GB
• SSD / 221.972GB
• SSD /boot/efi 512 MB
• HDD /home 300 GB
• HDD /var 631.510GB
Your name: elab server
Your server's name: elab
Pick a username: elablocal
Passwort: *** --> in bitwarden
First install GUI:
Sudo apt install xorg
sudo apt install --no-install-recommends ubuntu-desktop
Sudo apt install chromium-browser
Change hosts:
Sudo nano /etc/hosts
130.149.94.67 elab.local
Install all dependencies of elabftw
Installation procedure (followed the routine):
• "Looks good to me"
• "Server"
• "Yes" to domain
• "elab.local"
• "Use HTTPS"
• "Use self-signed"
Sudo nano /etc/elabftw.yml
Sudo elabctl start
Sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
Login: --> Bitwarden sysadmin
Configuration in elabftw:
• Users can delete experiments: No
• Users can delete items: No
• Enforce read permissions: Yes, User
• Enforce write permissions: Yes, User
• Create "SampleID" Database element.
• Create Status "Success-And-TemplateMetadata"
Installing clamtk
- Used a USB drive with virtual/local elabftw installation.
- Confirmed that with the newest version the backup can be restored.
- Testing if the CeramScan program still works...
- Backup of the mysqldump, uploaded files and elabftw.yml
- Change the version number in the
/etc/elabftw.yml
of image:elabftw/elabimg:4.5.3 elabctl update
docker exec -it elabftw bin/console db:update
- Somehow the version was not updated...
- Fresh install...
- sudo elabctl uninstall
- curl...
- sudo mv...
- sudo elabctl install
- Looks good to me
- server
- yes to domain
- elab.local
- use https
- use self-signed
- sudo elabctl start
- Got Error: services.web.depends_on contains an invalid type, it should be an array. --> Docker compose is too old.
- sudo curl -SL https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
- sudo chmod +x /usr/local/bin/docker-compose
- sudo elabctl start now working
- sudo elabctl initialize
- Copy the latest backup files to Documents
- Unzip uploaded_files
- sudo mv /home/elablocal/Documents/uploaded_files-2023-02-17/* /var/elabftw/web
- sudo chown -R 101:101 /var/elabftw/web
- gunzip /home/elablocal/Documents/mysql_dump-2023-02-17.sql.gz
- sudo docker cp /home/elablocal/Documents/mysql_dump-2023-02-17.sql mysql:/
- sudo docker exec -it mysql bash
- mysql -uroot -p
- PASSWORD input
- drop database elabftw;
- create database elabftw.....
- use elabftw;
- set names utf8mb4;
- source mysql_dump-2023-02-17.sql;
- exit;
- exit
- sudo elabctl stop
- Restart PC
- sudo elabctl start
- The database strucure is not loaded! Did you run the installer? is howing.
- somehow the sql 17 was empty... using the 16. repeating the sql steps.
- afterwards: sudo docker exec -it elabftw bin/console db:update
- Then the error with SQL state happened (see below)
borg init -e repokey-blake2 /var/backups/borg-init
- edit
/root/.config/elabctl.conf
GNU nano 4.8 /root/.config/elabctl.conf
# elabctl configuration file
# see https://github.com/elabftw/elabctl
# does nothing by default
# uncomment and edit to customize your environment
# ONLY ABSOLUTE PATHS HERE (start with a /)
# where do you want your backups to end up?
declare BACKUP_DIR='/var/backups/elabftw'
# where do we store the config file?
declare CONF_FILE='/etc/elabftw.yml'
# where do we store the MySQL database and the uploaded files?
declare DATA_DIR='/var/elabftw'
# name of the web container (default: elabftw)
declare ELAB_WEB_CONTAINER_NAME='elabftw'
# name of the mysql container (default: mysql)
declare ELAB_MYSQL_CONTAINER_NAME='mysql'
#############################
# BORG BACKUP CONFIGURATION #
#############################
# full path to the borg executable
declare BORG_PATH=/usr/bin/borg
# borg passphrase
declare BORG_PASSPHRASE=XY
# borg repository
# remote example (with ssh): backupserver:/elabftw
# local example: /mnt/data/big_drive/elabftw
declare BORG_REPO=/var/backups/borg-init
# granularity of backups to keep
declare BORG_KEEP_DAILY=14
declare BORG_KEEP_MONTHLY=12
sudo borg list /var/backups/borg-init
sudo extract...
- Update to Version 4.8.6 since the next version will break the CeramScan v1.6 program and its API v1.
- Software update manager
- restart
- upgrading to Ubuntu 22.04
- elabftw.yml image: elabftw/elabimg:4.8.6
sudo elabctl update
- dependency failed to start: container mysql is unhealthy
- Probably because the update took quite long (according to similar issue on Github)
sudo elabctl update
sudo docker exec -it elabftw bin/console db:update
- sudo elabctl restart
- All good, finished
- Backup the current installation
- Copied the mysql dumps to the external hdd
- sudo borg list /var/backups/borg-init
- ENTER PASSPHRASE
- sudo borg extract --list /var/backups/borg-init::elab-2024-02-05_16-19
- ENTER PASSPHRASE
- Update of the linux base system
- Restart
- Changed the yml to version 4.9.0
- sudo elabctl update
- Same issue as last time.
sudo elabctl start
- sudo docker exec -it elabftw bin/console db:update
- Now it works
-
Stop the server
elabctl stop
-
Start the server
elabctl start
- Edit the base configuration file
sudo nano /etc/elabftw.yml
This failure happened due to an installation of docker via snap. This has apparently some problems with their restrictions on the folders. Thus, docker needed to be reinstalled via apt-get.
Solution:
- Backed up the var and .yml.
- snap remove docker
- sudo apt-get remove docker docker-engine docker.io
- Lets try with installing it over apt-get
- renamed the elabftw folder in var to old and copied the backup into the folder.
- Restarted Server, everything seems to work now.
Click to expand
Dear Nicolas, dear community,
I needed to hard reset our local server and since then I am facing huge issues. Though, elabftw is still accessible from other computers, I cannot backup the installation, as the containers are not running and mysql seems to be read-only. When starting the server it was updating the elabftw installation. When asking for the status it only shows:
---------------------------------------------
Name Command State Ports
-----------------------------------------------------------
elabftw /run.sh Exit 128
mysql docker-entrypoint.sh --def ... Exit 128
When trying to restart, or stop and start via "elabctl restart", I get the following:
Removing elabftw ... done
Removing mysql ... done
Removing network etc_elabftw-net
Creating network "etc_elabftw-net" with the default driver
Creating elabftw ...
Creating elabftw ... error
WARNING: Host is already in use by another container
ERROR: for elabftw Cannot start service web: driver failed programming external connectivity on Endpoint elabftw (649857d344683ee08088ff60375e1f73177b0c2d7f6e096fe1c6e9bae55519b5): Error starting userland proxCreating mysql ... error
ERROR: for mysql Cannot start service mysql: error while creating mount source path '/var/elabftw/mysql': mkdir /var/elabftw: read-only file system
ERROR: for web Cannot start service web: driver failed programming external connectivity on endpoint elabftw (649857d344683ee08088ff60375e1f73177b0c2d7f6e096fe1c6e9bae55519b5): Error starting userland proxy: listen tcp4 0.0.0.0:443: bind: address already in use
ERROR: for mysql Cannot start service mysql: error while creating mount source path '/var/elabftw/mysql': mkdir /var/elabftw: read-only file system
ERROR: Encountered errors while bringing up the project."
Finally elabctl bugreport:
Using elabctl configuration file: using default values (no config file found)
Using elabftw configuration file: /etc/elabftw.yml
---------------------------------------------
Collecting information for a bug report…
=======================================================
Elabctl version: 2.3.2
Elabftw version: see on sysconfig page=======================================================
Docker version: 20.10.7
=======================================================
Operating system:
Linux elab 5.4.0-107-generic #121-Ubuntu SMP Thu Mar 24 16:04:27 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
=======================================================
Memory:
total used free shared buff/cache available
Mem: 15Gi 1.6Gi 11Gi 24Mi 2.0Gi 13Gi
Swap: 19Gi 0B 19Gi
=======================================================
I would be extremely grateful for any suggestions or hints on how to fix it.
All the best
Fabian
Hello Fabian.
First, don't panic, I'm sure it's fixable ;)
I would start by cleaning up things. So elabctl stop and docker ps -a to see if some containers are still there. Then docker stop <container name> and docker rm <container name> if there are some stuff still running. Then once everything is stopped docker system prune -a. Then elabctl start. If you're not running the latest version, make sure that the elabftw/elabimg version is pinned in the yml file (image: elabftw/elabimg:4.2.4).
To me, it is simply an issue with containers that were not properly stopped, and so they prevent a new container from starting (and listening on the same port).
Apparently nothing running.
sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
KeramHub
12 days ago
Dear Nicolas, dear community,
I needed to hard reset our local server and since then I am facing huge issues. Though, elabftw is still accessible from other computers, I cannot backup the installation, as the containers are not running and mysql seems to be read-only. When starting the server it was updating the elabftw installation. When asking for the status it only shows:
---------------------------------------------
Name Command State Ports
-----------------------------------------------------------
elabftw /run.sh Exit 128
mysql docker-entrypoint.sh --def ... Exit 128
When trying to restart, or stop and start via "elabctl restart", I get the following:
Removing elabftw ... done
Removing mysql ... done
Removing network etc_elabftw-net
Creating network "etc_elabftw-net" with the default driver
Creating elabftw ...
Creating elabftw ... error
WARNING: Host is already in use by another container
ERROR: for elabftw Cannot start service web: driver failed programming external connectivity on Endpoint elabftw (649857d344683ee08088ff60375e1f73177b0c2d7f6e096fe1c6e9bae55519b5): Error starting userland proxCreating mysql ... error
ERROR: for mysql Cannot start service mysql: error while creating mount source path '/var/elabftw/mysql': mkdir /var/elabftw: read-only file system
ERROR: for web Cannot start service web: driver failed programming external connectivity on endpoint elabftw (649857d344683ee08088ff60375e1f73177b0c2d7f6e096fe1c6e9bae55519b5): Error starting userland proxy: listen tcp4 0.0.0.0:443: bind: address already in use
ERROR: for mysql Cannot start service mysql: error while creating mount source path '/var/elabftw/mysql': mkdir /var/elabftw: read-only file system
ERROR: Encountered errors while bringing up the project."
Finally elabctl bugreport:
Using elabctl configuration file: using default values (no config file found)
Using elabftw configuration file: /etc/elabftw.yml
---------------------------------------------
Collecting information for a bug report…
=======================================================
Elabctl version: 2.3.2
Elabftw version: see on sysconfig page=======================================================
Docker version: 20.10.7
=======================================================
Operating system:
Linux elab 5.4.0-107-generic #121-Ubuntu SMP Thu Mar 24 16:04:27 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
=======================================================
Memory:
total used free shared buff/cache available
Mem: 15Gi 1.6Gi 11Gi 24Mi 2.0Gi 13Gi
Swap: 19Gi 0B 19Gi
=======================================================
I would be extremely grateful for any suggestions or hints on how to fix it.
All the best
Fabian
01
Replies
1 suggested answer
·
14 replies
OldestNewestTop
NicolasCARPi
12 days ago
Maintainer
Hello Fabian.
First, don't panic, I'm sure it's fixable ;)
I would start by cleaning up things. So elabctl stop and docker ps -a to see if some containers are still there. Then docker stop <container name> and docker rm <container name> if there are some stuff still running. Then once everything is stopped docker system prune -a. Then elabctl start. If you're not running the latest version, make sure that the elabftw/elabimg version is pinned in the yml file (image: elabftw/elabimg:4.2.4).
To me, it is simply an issue with containers that were not properly stopped, and so they prevent a new container from starting (and listening on the same port).
Mark as answer
12
14 replies 1 new
KeramHub11 days ago
Author
Hello Nicolas,
Thanks a lot for your fast response, I'll try my best not to panic ;).
docker ps-a showed no containers running. I still did the docker system prune -a and then restarted elabctl, but I get the same result as before. We are running version 4.2.4, which should be the latest. Just in case, I also did try the change in the yml file, unfortunately without any change.
NicolasCARPi11 days ago
Maintainer
please show the full commands + output when you try things. Do you have something else (non docker service) listening on port 443 on that machine ? I believe it is not possible that you get these errors you posted if no other containers are running when you start web + mysql. When you say "I get the same result", does that mean the same exact error messages or just that it doesn't work? As I said, be very thorough and precise in your reporting!
KeramHub11 days ago
Author
Sorry, I just wanted to avoid spam. I'll post everything from now on.
The server is only running the elabftw installation and shouldn't run anything else. When looking at the port 443, I only see a few google tabs which are open for troubleshooting:
elablocal@elab:~$ lsof -i tcp:443
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
chrome XXXXXXX
chrome XXXXXXX
chrome XXXXXXX
chrome XXXXXXX
chrome XXXXXXX
The docker ps -a is only showing a blank line.
elablocal@elab:~$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
elablocal@elab:~$ sudo docker system prune -a
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all images without at least one container associated to them
- all build cache
Are you sure you want to continue? [y/N] y
Deleted Images:
untagged: elabftw/elabimg:4.2.4
untagged: elabftw/elabimg@sha256:8b7726c6d0f762d3b1c5943ca008b78bdc3b425e316c6ef8d90fda33e1c7630b
deleted: sha256:3b9025ffd2ddae5fa4965c7c8d7adc839654754c149dade8145323f230a56492
deleted: sha256:2afa11e65153af27c1c1ce9d5bfdb04001fd0ec9a645c49412029fb6b9308737
deleted: sha256:3f801c175df175e4b2aac86fb3e979278b98a7c0540fa4c1f95aba4e3b62b62f
deleted: sha256:ec0616fa5f886afb0b81362ec61e9ab350bb379612d26c8a913d2211ec9fe3a7
deleted: sha256:692e4faa8b2ec0e9b1a5d3abd795bf268325ea742d391bc60abeb19d1da4f500
deleted: sha256:f1768fa58917e408a2c2524bb19a29cac8e9c2b45344a890bd0caee8adce69d8
deleted: sha256:6f53980d83ff2e060fc6d32d0f114acc921a8b72b2fbd359eafd996aa87fb117
deleted: sha256:e802de8450cfc9168c0f4c216da507bc8756bba17d98a0809e88f31207d66f6e
deleted: sha256:d649b8435ef220960cf201bf4f23780576f569467080619562972d1dd6a50275
deleted: sha256:c455c1ad3c1b922f7b9b3a65d91e374651aaefae3ec6245579b95c57ce30156a
deleted: sha256:2cedf81679af9b95a46e2847af98ce437ae273a9d9df098ffd330c409d654c78
deleted: sha256:74c37d65d5f5c4b6c22f43a00527ebeb95bb25d27a19b5eacca4280f085ad9d1
deleted: sha256:7dc80cd2c1f5c9b461a872dcf61a879248668df9f42347f92e9f900c3bb8ef9c
deleted: sha256:696d3bdceb52c662bcae466628f0d05990d317d0758b9999b84e1f07db30d3e7
deleted: sha256:806e7c5b566402e3e38719485c58287c5421a761649fd0429d3bc005231281e8
deleted: sha256:231f9f57d950fb31ceb38b96ba73b1cbd5598cecc7ae0661d83dc96f84a53151
deleted: sha256:954de111bc4dcbc4b1e9af084a570a5dfc0f8304a61e1a9307572d1f642458ee
deleted: sha256:2f302f5cccce2ca5c9d8eb65203819fe83ce04301170e1152915de1ec2277f9b
deleted: sha256:2001e596af1c921227ab33f5c7033c12c2c2d6b6b7f3a35bd4f367e99f6f4882
deleted: sha256:1a058d5342cc722ad5439cacae4b2b4eedde51d8fe8800fcf28444302355c16d
untagged: mysql:8.0
untagged: mysql@sha256:1c75ba7716c6f73fc106dacedfdcf13f934ea8c161c8b3b3e4618bcd5fbcf195
deleted: sha256:667ee8fb158e365450fc3f09712208fe44e9f1364a9b130fed95f3f4862f8a63
deleted: sha256:daba3b5cd1b725f259d5d59049c7011f6a20f2e7e4782b873cadeedbc1a4f122
deleted: sha256:407a68a397de3c8e4da2ccd388f27c795519414cc9319f674e7b9a492cd8514b
deleted: sha256:6967db79cb8031d7e505dd82c91c6426e84c6ad2098d06c1c090485886bc1c63
deleted: sha256:3dcc0f922d11309b2e4870d5f42c5005f086c9b9c1e128ed2b712b65fa79a5c9
deleted: sha256:ae5d4ab2734d5c27069212b2690dc2c7ac4cd85ee5e122607cb175f7fe908914
deleted: sha256:610784bcaae50e999566928bdec7a4e146fe075d9e487bde0a228c99013ff1d9
deleted: sha256:ccebaff04ea21a9e2df07f9d5af5c47ccd141cd3590f4d45784b6075e7c17ded
deleted: sha256:716203221cd982fc07b80efda0c53a759ecfd69b2d93d4e8adf5fa094351372e
deleted: sha256:fbd4939b3eb58642a07003e076acc3d0d8140797f61139ce4d3645790d9c8b51
deleted: sha256:88f8458b4b2030b229b9757bd4061bce58b65e831a0bba8fa71aa8b3f87db630
deleted: sha256:f2f431ab3ddc1460d300cd86016cc03b7611b56f04bd88370da3d378b3d10aea
deleted: sha256:c1065d45b8722a4385f2ee26116e1859e8083400ee00d2beff3fdd5225bfeee9
Total reclaimed space: 951.4MB
elablocal@elab:~$ sudo elabctl start
_ _ _____ _______ __
___| | __ _| |__ | ___|_ _\ \ / /
/ _ \ | / _| | '_ \| |_ | | \ \ /\ / /
| __/ |__| (_| | |_) | _| | | \ V V /
\___|_____\__,_|_.__/|_| |_| \_/\_/
Using elabctl configuration file: using default values (no config file found)
Using elabftw configuration file: /etc/elabftw.yml
---------------------------------------------
Creating network "etc_elabftw-net" with the default driver
Pulling web (elabftw/elabimg:4.2.4)...
4.2.4: Pulling from elabftw/elabimg
97518928ae5f: Pull complete
dd8b9f7c3f5a: Pull complete
1ed21f2d76a8: Pull complete
aaa7026a165a: Pull complete
b8f53f8d25a4: Pull complete
6f1cb60a8959: Pull complete
7098489975f7: Pull complete
204f95b4c64f: Pull complete
96ca2976f9dc: Pull complete
cce477d070e3: Pull complete
36cde73f06c4: Pull complete
05345ae1b9d3: Pull complete
22843f409f90: Pull complete
6a4313d10a82: Pull complete
11f7e3232bae: Pull complete
e69c527f7aa4: Pull complete
fd40faf6b187: Pull complete
f9df95250625: Pull complete
ac0843588bc5: Pull complete
Digest: sha256:8b7726c6d0f762d3b1c5943ca008b78bdc3b425e316c6ef8d90fda33e1c7630b
Status: Downloaded newer image for elabftw/elabimg:4.2.4
Pulling mysql (mysql:8.0)...
8.0: Pulling from library/mysql
f003217c5aae: Pull complete
65d94f01a09f: Pull complete
43d78aaa6078: Pull complete
a0f91ffbdf69: Pull complete
59ee9e07e12f: Pull complete
04d82978082c: Pull complete
70f46ebb971a: Pull complete
db6ea71d471d: Pull complete
c2920c795b25: Pull complete
26c3bdf75ff5: Pull complete
9ec1f1f78b0e: Pull complete
4607fa685ac6: Pull complete
Digest: sha256:1c75ba7716c6f73fc106dacedfdcf13f934ea8c161c8b3b3e4618bcd5fbcf195
Status: Downloaded newer image for mysql:8.0
Creating mysql ...
Creating elabftw ...
Creating elabftw ... error
ERROR: for elabftw Cannot start service web: driver failed programming external connectivity on endpoint elabftw (371cc50763694180791a4eb16Creating mysql ... error
y: listen tcp4 0.0.0.0:443: bind: address already in use
ERROR: for mysql Cannot start service mysql: error while creating mount source path '/var/elabftw/mysql': mkdir /var/elabftw: read-only file system
ERROR: for web Cannot start service web: driver failed programming external connectivity on endpoint elabftw (371cc50763694180791a4eb164de783e564c8c40702be02548594ca3ab9cdb89): Error starting userland proxy: listen tcp4 0.0.0.0:443: bind: address already in use
ERROR: for mysql Cannot start service mysql: error while creating mount source path '/var/elabftw/mysql': mkdir /var/elabftw: read-only file system
ERROR: Encountered errors while bringing up the project.
The error seems to be the same as before. How would I be able to find out which services might still be running in the background?
Thanks
Fabian
NicolasCARPi11 days ago
Maintainer
Oh something to try too is to restart the docker daemon, and maybe reboot the system!
KeramHub8 days ago
Author
Hey Nicolas,
Sorry, I've missed your reply.
I've tried the following command for restarting.
sudo systemctl restart docker
In between, I've also rebooted the system and also used the commands you suggested earlier afterwards...
I'll try again as soon as I am on site again and can provide you with the outputs. Today, and probably tomorrow I'll not be at the server.
Thanks again for all your help, I really appreciate it.
KeramHub6 days ago
Author
Hey Nicolas,
Sorry for keeping you waiting. Unfortunately, the restarting also didn't help.
elablocal@elab:~$ sudo elabctl stop
_ _ _____ _______ __
___| | __ _| |__ | ___|_ _\ \ / /
/ _ \ | / _| | '_ \| |_ | | \ \ /\ / /
| __/ |__| (_| | |_) | _| | | \ V V /
\___|_____\__,_|_.__/|_| |_| \_/\_/
Using elabctl configuration file: using default values (no config fil>
Using elabftw configuration file: /etc/elabftw.yml
---------------------------------------------
Removing mysql ... done
Removing elabftw ... done
Removing network etc_elabftw-net
elablocal@elab:~$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
elablocal@elab:~$ sudo docker system prune -a
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all images without at least one container associated to them
- all build cache
Are you sure you want to continue? [y/N] y
Deleted Images:
untagged: mysql:8.0
untagged: mysql@sha256:1c75ba7716c6f73fc106dacedfdcf13f934ea8c161c8b3>
deleted: sha256:667ee8fb158e365450fc3f09712208fe44e9f1364a9b130fed95f>
deleted: sha256:daba3b5cd1b725f259d5d59049c7011f6a20f2e7e4782b873cade>
deleted: sha256:407a68a397de3c8e4da2ccd388f27c795519414cc9319f674e7b9>
deleted: sha256:6967db79cb8031d7e505dd82c91c6426e84c6ad2098d06c1c0904>
deleted: sha256:3dcc0f922d11309b2e4870d5f42c5005f086c9b9c1e128ed2b712>
deleted: sha256:ae5d4ab2734d5c27069212b2690dc2c7ac4cd85ee5e122607cb17>
deleted: sha256:610784bcaae50e999566928bdec7a4e146fe075d9e487bde0a228>
deleted: sha256:ccebaff04ea21a9e2df07f9d5af5c47ccd141cd3590f4d45784b6>
deleted: sha256:716203221cd982fc07b80efda0c53a759ecfd69b2d93d4e8adf5f>
deleted: sha256:fbd4939b3eb58642a07003e076acc3d0d8140797f61139ce4d364>
deleted: sha256:88f8458b4b2030b229b9757bd4061bce58b65e831a0bba8fa71aa>
deleted: sha256:f2f431ab3ddc1460d300cd86016cc03b7611b56f04bd88370da3d>
deleted: sha256:c1065d45b8722a4385f2ee26116e1859e8083400ee00d2beff3fd>
untagged: elabftw/elabimg:4.2.4
untagged: elabftw/elabimg@sha256:8b7726c6d0f762d3b1c5943ca008b78bdc3b>
deleted: sha256:3b9025ffd2ddae5fa4965c7c8d7adc839654754c149dade814532>
deleted: sha256:2afa11e65153af27c1c1ce9d5bfdb04001fd0ec9a645c49412029>
deleted: sha256:3f801c175df175e4b2aac86fb3e979278b98a7c0540fa4c1f95ab>
deleted: sha256:ec0616fa5f886afb0b81362ec61e9ab350bb379612d26c8a913d2>
deleted: sha256:692e4faa8b2ec0e9b1a5d3abd795bf268325ea742d391bc60abeb>
deleted: sha256:f1768fa58917e408a2c2524bb19a29cac8e9c2b45344a890bd0ca>
deleted: sha256:6f53980d83ff2e060fc6d32d0f114acc921a8b72b2fbd359eafd9>
deleted: sha256:e802de8450cfc9168c0f4c216da507bc8756bba17d98a0809e88f>
deleted: sha256:d649b8435ef220960cf201bf4f23780576f569467080619562972>
deleted: sha256:c455c1ad3c1b922f7b9b3a65d91e374651aaefae3ec6245579b95>
deleted: sha256:2cedf81679af9b95a46e2847af98ce437ae273a9d9df098ffd330>
deleted: sha256:74c37d65d5f5c4b6c22f43a00527ebeb95bb25d27a19b5eacca42>
deleted: sha256:7dc80cd2c1f5c9b461a872dcf61a879248668df9f42347f92e9f9>
deleted: sha256:696d3bdceb52c662bcae466628f0d05990d317d0758b9999b84e1>
deleted: sha256:806e7c5b566402e3e38719485c58287c5421a761649fd0429d3bc>
deleted: sha256:231f9f57d950fb31ceb38b96ba73b1cbd5598cecc7ae0661d83dc>
deleted: sha256:954de111bc4dcbc4b1e9af084a570a5dfc0f8304a61e1a9307572>
deleted: sha256:2f302f5cccce2ca5c9d8eb65203819fe83ce04301170e1152915d>
deleted: sha256:2001e596af1c921227ab33f5c7033c12c2c2d6b6b7f3a35bd4f36>
deleted: sha256:1a058d5342cc722ad5439cacae4b2b4eedde51d8fe8800fcf2844>
Total reclaimed space: 951.4MB
elablocal@elab:~$ sudo systemctl restart docker
Then I restarted the system. Afterwards:
elablocal@elab:~$ sudo elabctl status
[sudo] password for elablocal:
_ _ _____ _______ __
___| | __ _| |__ | ___|_ _\ \ / /
/ _ \ | / _| | '_ \| |_ | | \ \ /\ / /
| __/ |__| (_| | |_) | _| | | \ V V /
\___|_____\__,_|_.__/|_| |_| \_/\_/
Using elabctl configuration file: using default values (no config file found)
Using elabftw configuration file: /etc/elabftw.yml
---------------------------------------------
Name Command State Ports
------------------------------
elablocal@elab:~$ sudo elabctl start
_ _ _____ _______ __
___| | __ _| |__ | ___|_ _\ \ / /
/ _ \ | / _| | '_ \| |_ | | \ \ /\ / /
| __/ |__| (_| | |_) | _| | | \ V V /
\___|_____\__,_|_.__/|_| |_| \_/\_/
Using elabctl configuration file: using default values (no config file found)
Using elabftw configuration file: /etc/elabftw.yml
---------------------------------------------
Creating network "etc_elabftw-net" with the default driver
Pulling web (elabftw/elabimg:4.2.4)...
4.2.4: Pulling from elabftw/elabimg
97518928ae5f: Pull complete
dd8b9f7c3f5a: Pull complete
1ed21f2d76a8: Pull complete
aaa7026a165a: Pull complete
b8f53f8d25a4: Pull complete
6f1cb60a8959: Pull complete
7098489975f7: Pull complete
204f95b4c64f: Pull complete
96ca2976f9dc: Pull complete
cce477d070e3: Pull complete
36cde73f06c4: Pull complete
05345ae1b9d3: Pull complete
22843f409f90: Pull complete
6a4313d10a82: Pull complete
11f7e3232bae: Pull complete
e69c527f7aa4: Pull complete
fd40faf6b187: Pull complete
f9df95250625: Pull complete
ac0843588bc5: Pull complete
Digest: sha256:8b7726c6d0f762d3b1c5943ca008b78bdc3b425e316c6ef8d90fda33e1c7630b
Status: Downloaded newer image for elabftw/elabimg:4.2.4
Pulling mysql (mysql:8.0)...
8.0: Pulling from library/mysql
f003217c5aae: Pull complete
65d94f01a09f: Pull complete
43d78aaa6078: Pull complete
a0f91ffbdf69: Pull complete
59ee9e07e12f: Pull complete
04d82978082c: Pull complete
70f46ebb971a: Pull complete
db6ea71d471d: Pull complete
c2920c795b25: Pull complete
26c3bdf75ff5: Pull complete
9ec1f1f78b0e: Pull complete
4607fa685ac6: Pull complete
Digest: sha256:1c75ba7716c6f73fc106dacedfdcf13f934ea8c161c8b3b3e4618bcd5fbcf195
Status: Downloaded newer image for mysql:8.0
Creating elabftw ...
WARNING: Host is already in use by another container
Creating mysql ... error
ERROR: for mysql Cannot start service mysql: error while creating mouCreating elabftw ... error
e system
ERROR: for elabftw Cannot start service web: driver failed programming external connectivity on endpoint elabftw (f5c6c42b6b2a3d7f610b3e53603eed4bd8480e38bcc0e7a7278dc9b6f07812c5): Error starting userland proxy: listen tcp4 0.0.0.0:443: bind: address already in use
ERROR: for mysql Cannot start service mysql: error while creating mount source path '/var/elabftw/mysql': mkdir /var/elabftw: read-only file system
ERROR: for web Cannot start service web: driver failed programming external connectivity on endpoint elabftw (f5c6c42b6b2a3d7f610b3e53603eed4bd8480e38bcc0e7a7278dc9b6f07812c5): Error starting userland proxy: listen tcp4 0.0.0.0:443: bind: address already in use
ERROR: Encountered errors while bringing up the project.
elablocal@elab:~$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ff2444a43899 mysql:8.0 "docker-entrypoint.s…" About a minute ago Created 3306/tcp, 33060/tcp mysql
7baa1454e938 elabftw/elabimg:4.2.4 "/run.sh" About a minute ago Created elabftw
elablocal@elab:~$ sudo elabctl status
_ _ _____ _______ __
___| | __ _| |__ | ___|_ _\ \ / /
/ _ \ | / _| | '_ \| |_ | | \ \ /\ / /
| __/ |__| (_| | |_) | _| | | \ V V /
\___|_____\__,_|_.__/|_| |_| \_/\_/
Using elabctl configuration file: using default values (no config file found)
Using elabftw configuration file: /etc/elabftw.yml
---------------------------------------------
Name Command State Ports
-----------------------------------------------------------
elabftw /run.sh Exit 128
mysql docker-entrypoint.sh --def ... Exit 128
Do you have any other ideas that could cause this? Apparently, when stopping the system, all docker containers are removed, but there is something remaining? Or could something block something?
Thanks in advance.
All the best
Fabian
NicolasCARPi6 days ago
Maintainer
To me this looks exactly like the kind of error you would get if something is already listening on ports 443 and 3306. Could it be that you have non-docker processes doing that?
One thing you can try is to bind to another port, so in elabftw.yml use 444:443 for elabimg and 3307:3306 for mysql. At least now it should start.
You should investigate running services (maybe a LAMP stack?) on this machine.
KeramHub6 days ago
Author
Well, this computer was a fresh install of Ubuntu Server and installation of elabftw, so in theory there should not be anything else running.
I've edited the ports in the elabftw.yml. Should the '3307' be added at DB_PORT and mysql-expose?
After editing, I also did the docker system prune, restarted docker and the computer. Finally, some of the errors disappeared. Though, a few remain.
elablocal@elab:~$ sudo elabctl start
_ _ _____ _______ __
___| | __ _| |__ | ___|_ _\ \ / /
/ _ \ | / _| | '_ \| |_ | | \ \ /\ / /
| __/ |__| (_| | |_) | _| | | \ V V /
\___|_____\__,_|_.__/|_| |_| \_/\_/
Using elabctl configuration file: using default values (no config file found)
Using elabftw configuration file: /etc/elabftw.yml
---------------------------------------------
Creating network "etc_elabftw-net" with the default driver
Pulling web (elabftw/elabimg:latest)...
latest: Pulling from elabftw/elabimg
97518928ae5f: Pull complete
dd8b9f7c3f5a: Pull complete
1ed21f2d76a8: Pull complete
aaa7026a165a: Pull complete
b8f53f8d25a4: Pull complete
6f1cb60a8959: Pull complete
7098489975f7: Pull complete
204f95b4c64f: Pull complete
96ca2976f9dc: Pull complete
cce477d070e3: Pull complete
36cde73f06c4: Pull complete
05345ae1b9d3: Pull complete
22843f409f90: Pull complete
6a4313d10a82: Pull complete
11f7e3232bae: Pull complete
e69c527f7aa4: Pull complete
fd40faf6b187: Pull complete
f9df95250625: Pull complete
ac0843588bc5: Pull complete
Digest: sha256:8b7726c6d0f762d3b1c5943ca008b78bdc3b425e316c6ef8d90fda33e1c7630b
Status: Downloaded newer image for elabftw/elabimg:latest
Pulling mysql (mysql:8.0)...
8.0: Pulling from library/mysql
f003217c5aae: Pull complete
65d94f01a09f: Pull complete
43d78aaa6078: Pull complete
a0f91ffbdf69: Pull complete
59ee9e07e12f: Pull complete
04d82978082c: Pull complete
70f46ebb971a: Pull complete
db6ea71d471d: Pull complete
c2920c795b25: Pull complete
26c3bdf75ff5: Pull complete
9ec1f1f78b0e: Pull complete
4607fa685ac6: Pull complete
Digest: sha256:1c75ba7716c6f73fc106dacedfdcf13f934ea8c161c8b3b3e4618bcd5fbcf195
Status: Downloaded newer image for mysql:8.0
Creating mysql ...
Creating elabftw ... error
ERROR: for elabftw Cannot start service web: error while creating mouCreating mysql ... error
system
ERROR: for mysql Cannot start service mysql: error while creating mount source path '/var/elabftw/mysql': mkdir /var/elabftw: read-only file system
ERROR: for web Cannot start service web: error while creating mount source path '/var/elabftw/web': mkdir /var/elabftw: read-only file system
ERROR: for mysql Cannot start service mysql: error while creating mount source path '/var/elabftw/mysql': mkdir /var/elabftw: read-only file system
ERROR: Encountered errors while bringing up the project.
elablocal@elab:~$ sudo elabctl status
_ _ _____ _______ __
___| | __ _| |__ | ___|_ _\ \ / /
/ _ \ | / _| | '_ \| |_ | | \ \ /\ / /
| __/ |__| (_| | |_) | _| | | \ V V /
\___|_____\__,_|_.__/|_| |_| \_/\_/
Using elabctl configuration file: using default values (no config file found)
Using elabftw configuration file: /etc/elabftw.yml
---------------------------------------------
Name Command State Ports
-----------------------------------------------------------
elabftw /run.sh Exit 128
mysql docker-entrypoint.sh --def ... Exit 128
NicolasCARPi6 days ago
Maintainer
Why would the filesystem be readonly? Is /var mounted on a read-only filesystem? Can you try another mountpoint?
KeramHub6 days ago
Author
I have no idea, especially since it was working before. I can read/write in /var (at least I've created a sudo nano test.txt without problems). I can also access every folder inside /var... with the exception of "elabftw", which produces: "Location could not be displayed. The location is not supported".
After some googling... quite a few persons have this issue with docker installed by snap.
https://stackoverflow.com/questions/52526219/docker-mkdir-read-only-file-system
I would try this out. Just to be sure, do I have to consider something to not just delete my elabftw installation? Or could I just remove it and install via official sources and then do elabctl start?
NicolasCARPi6 days ago
Maintainer
Oh so here is your issue! Snap is crap. You need to install Docker without snap. If you put the content of the folders that were managed by snap in new folders and correctly bindmount them, you should be able to just elabctl start again and find your data in there. Keeping snap and moving config file and data folders in $HOME is also a solution, see: #1917 (comment)
edited
NicolasCARPi6 days ago
Maintainer
see also: https://github.com/elabftw/elabdoc/blob/master/doc/install.rst?plain=1#L38
KeramHub5 days ago
Author
Following your instructions for backing up the installation, it was not possible to backup the MYSQL DB (obviously neither via the elabctl backup). So I copied the yml and the whole content of the /var folder. Anything else to consider?
I just want to make sure, that I don't have data loss.
NicolasCARPi5 days ago
Maintainer
yes you can't mysqldump if the server is not running. But copying the files works fine in that case. If you've copied the yml and the uploaded files that's it, nothing else to consider.
This error happened while upgrading the server.
SQLSTATE[42000]: Syntax error or access violation: 1227 Access denied; you need (at least one of) the SUPER, SYSTEM_VARIABLES_ADMIN or SESSION_VARIABLES_ADMIN
Solution
From: https://github.com/elabftw/elabftw/discussions/3592#discussioncomment-3268365
docker exec -it mysql bash
mysql -uroot -p$MYSQL_ROOT_PASSWORD
MySQL> grant session_variables_admin on *.* to elabftw;
- The images needed to be loaded and the access needed to be permitted for these files.
Home
Data handling & ID's
CeramScan
Printer
For Developers/Admins