adamzammit / limesurvey-docker

Production ready dockerised Limesurvey
GNU General Public License v3.0
86 stars 51 forks source link

docker-compose fails #15

Closed duboism closed 3 years ago

duboism commented 3 years ago

Hello,

I'm not a docker expert but I can't install.

I have created a docker-compose.yml file identical to the one on the git repository and run docker-compose up but it seems to fail. Here are the logs:

limesurvey_1  | No config file in /var/www/html Copying default config file...
mysql_1       | 2021-01-15 10:03:51+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.5.8+maria~focal started.
mysql_1       | 2021-01-15 10:03:52+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
limesurvey_1  | Downloading BaltimoreCyberTrustroot.crt.pem
mysql_1       | 2021-01-15 10:03:52+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.5.8+maria~focal started.
mysql_1       | 2021-01-15 10:03:52+00:00 [Note] [Entrypoint]: Initializing database files
mail_1        | MailDev webapp running at http://0.0.0.0:80
mail_1        | MailDev SMTP Server running at 0.0.0.0:25
mysql_1       | 
mysql_1       | 
mysql_1       | PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
mysql_1       | To do so, start the server, then issue the following commands:
mysql_1       | 
mysql_1       | '/usr/bin/mysqladmin' -u root password 'new-password'
mysql_1       | '/usr/bin/mysqladmin' -u root -h  password 'new-password'
mysql_1       | 
mysql_1       | Alternatively you can run:
mysql_1       | '/usr/bin/mysql_secure_installation'
mysql_1       | 
mysql_1       | which will also give you the option of removing the test
mysql_1       | databases and anonymous user created by default.  This is
mysql_1       | strongly recommended for production servers.
mysql_1       | 
mysql_1       | See the MariaDB Knowledgebase at https://mariadb.com/kb or the
mysql_1       | MySQL manual for more instructions.
mysql_1       | 
mysql_1       | Please report any problems at https://mariadb.org/jira
mysql_1       | 
mysql_1       | The latest information about MariaDB is available at https://mariadb.org/.
mysql_1       | You can find additional information about the MySQL part at:
mysql_1       | https://dev.mysql.com
mysql_1       | Consider joining MariaDB's strong and vibrant community:
mysql_1       | https://mariadb.org/get-involved/
mysql_1       | 
mysql_1       | 2021-01-15 10:03:54+00:00 [Note] [Entrypoint]: Database files initialized
mysql_1       | 2021-01-15 10:03:54+00:00 [Note] [Entrypoint]: Starting temporary server
mysql_1       | 2021-01-15 10:03:54+00:00 [Note] [Entrypoint]: Waiting for server startup
mysql_1       | 2021-01-15 10:03:54 0 [Note] mysqld (mysqld 10.5.8-MariaDB-1:10.5.8+maria~focal) starting as process 104 ...
mysql_1       | 2021-01-15 10:03:54 0 [Warning] Could not increase number of max_open_files to more than 1024 (request: 32186)
mysql_1       | 2021-01-15 10:03:54 0 [Warning] Changed limits: max_open_files: 1024  max_connections: 151 (was 151)  table_cache: 421 (was 2000)
mysql_1       | 2021-01-15 10:03:54 0 [Note] InnoDB: Using Linux native AIO
mysql_1       | 2021-01-15 10:03:54 0 [Note] InnoDB: Uses event mutexes
mysql_1       | 2021-01-15 10:03:54 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
mysql_1       | 2021-01-15 10:03:54 0 [Note] InnoDB: Number of pools: 1
mysql_1       | 2021-01-15 10:03:54 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
mysql_1       | 2021-01-15 10:03:54 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
mysql_1       | 2021-01-15 10:03:54 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
mysql_1       | 2021-01-15 10:03:54 0 [Note] InnoDB: Completed initialization of buffer pool
mysql_1       | 2021-01-15 10:03:54 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
mysql_1       | 2021-01-15 10:03:54 0 [Note] InnoDB: 128 rollback segments are active.
mysql_1       | 2021-01-15 10:03:54 0 [Note] InnoDB: Creating shared tablespace for temporary tables
mysql_1       | 2021-01-15 10:03:54 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
mysql_1       | 2021-01-15 10:03:54 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
mysql_1       | 2021-01-15 10:03:54 0 [Note] InnoDB: 10.5.8 started; log sequence number 45118; transaction id 20
mysql_1       | 2021-01-15 10:03:54 0 [Note] Plugin 'FEEDBACK' is disabled.
mysql_1       | 2021-01-15 10:03:54 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
mysql_1       | 2021-01-15 10:03:54 0 [Note] InnoDB: Buffer pool(s) load completed at 210115 10:03:54
mysql_1       | 2021-01-15 10:03:54 0 [Warning] 'user' entry 'root@d65a4da63683' ignored in --skip-name-resolve mode.
mysql_1       | 2021-01-15 10:03:54 0 [Warning] 'proxies_priv' entry '@% root@d65a4da63683' ignored in --skip-name-resolve mode.
mysql_1       | 2021-01-15 10:03:54 0 [Note] Reading of all Master_info entries succeeded
mysql_1       | 2021-01-15 10:03:54 0 [Note] Added new Master_info '' to hash table
mysql_1       | 2021-01-15 10:03:54 0 [Note] mysqld: ready for connections.
mysql_1       | Version: '10.5.8-MariaDB-1:10.5.8+maria~focal'  socket: '/run/mysqld/mysqld.sock'  port: 0  mariadb.org binary distribution
mysql_1       | 2021-01-15 10:03:55+00:00 [Note] [Entrypoint]: Temporary server started.
mysql_1       | Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
mysql_1       | Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
mysql_1       | Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
mysql_1       | 2021-01-15 10:03:59 5 [Warning] 'proxies_priv' entry '@% root@d65a4da63683' ignored in --skip-name-resolve mode.
mysql_1       | 
mysql_1       | 2021-01-15 10:03:59+00:00 [Note] [Entrypoint]: Stopping temporary server
mysql_1       | 2021-01-15 10:03:59 0 [Note] mysqld (initiated by: root[root] @ localhost []): Normal shutdown
mysql_1       | 2021-01-15 10:03:59 0 [Note] Event Scheduler: Purging the queue. 0 events
mysql_1       | 2021-01-15 10:03:59 0 [Note] InnoDB: FTS optimize thread exiting.
mysql_1       | 2021-01-15 10:03:59 0 [Note] InnoDB: Starting shutdown...
mysql_1       | 2021-01-15 10:03:59 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
mysql_1       | 2021-01-15 10:03:59 0 [Note] InnoDB: Buffer pool(s) dump completed at 210115 10:03:59
mysql_1       | 2021-01-15 10:03:59 0 [Note] InnoDB: Shutdown completed; log sequence number 45130; transaction id 21
mysql_1       | 2021-01-15 10:03:59 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
mysql_1       | 2021-01-15 10:03:59 0 [Note] mysqld: Shutdown complete
mysql_1       | 
mysql_1       | 2021-01-15 10:04:00+00:00 [Note] [Entrypoint]: Temporary server stopped
mysql_1       | 
mysql_1       | 2021-01-15 10:04:00+00:00 [Note] [Entrypoint]: MySQL init process done. Ready for start up.
mysql_1       | 
mysql_1       | 2021-01-15 10:04:00 0 [Note] mysqld (mysqld 10.5.8-MariaDB-1:10.5.8+maria~focal) starting as process 1 ...
mysql_1       | 2021-01-15 10:04:00 0 [Warning] Could not increase number of max_open_files to more than 1024 (request: 32186)
mysql_1       | 2021-01-15 10:04:00 0 [Warning] Changed limits: max_open_files: 1024  max_connections: 151 (was 151)  table_cache: 421 (was 2000)
mysql_1       | 2021-01-15 10:04:00 0 [Note] InnoDB: Using Linux native AIO
mysql_1       | 2021-01-15 10:04:00 0 [Note] InnoDB: Uses event mutexes
mysql_1       | 2021-01-15 10:04:00 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
mysql_1       | 2021-01-15 10:04:00 0 [Note] InnoDB: Number of pools: 1
mysql_1       | 2021-01-15 10:04:00 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
mysql_1       | 2021-01-15 10:04:00 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
mysql_1       | 2021-01-15 10:04:00 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
mysql_1       | 2021-01-15 10:04:00 0 [Note] InnoDB: Completed initialization of buffer pool
mysql_1       | 2021-01-15 10:04:00 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
mysql_1       | 2021-01-15 10:04:00 0 [Note] InnoDB: 128 rollback segments are active.
mysql_1       | 2021-01-15 10:04:00 0 [Note] InnoDB: Creating shared tablespace for temporary tables
mysql_1       | 2021-01-15 10:04:00 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
mysql_1       | 2021-01-15 10:04:00 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
mysql_1       | 2021-01-15 10:04:00 0 [Note] InnoDB: 10.5.8 started; log sequence number 45130; transaction id 20
mysql_1       | 2021-01-15 10:04:00 0 [Note] Plugin 'FEEDBACK' is disabled.
mysql_1       | 2021-01-15 10:04:00 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
mysql_1       | 2021-01-15 10:04:00 0 [Note] InnoDB: Buffer pool(s) load completed at 210115 10:04:00
mysql_1       | 2021-01-15 10:04:00 0 [Note] Server socket created on IP: '::'.
mysql_1       | 2021-01-15 10:04:00 0 [Warning] 'proxies_priv' entry '@% root@d65a4da63683' ignored in --skip-name-resolve mode.
mysql_1       | 2021-01-15 10:04:00 0 [Note] Reading of all Master_info entries succeeded
mysql_1       | 2021-01-15 10:04:00 0 [Note] Added new Master_info '' to hash table
mysql_1       | 2021-01-15 10:04:00 0 [Note] mysqld: ready for connections.
mysql_1       | Version: '10.5.8-MariaDB-1:10.5.8+maria~focal'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
limesurvey_1  | Failed to download certificate - continuing anyway
limesurvey_1  | 
limesurvey_1  | MySQL Connection Error: () 
limesurvey_1  | 
limesurvey_1  | MySQL Connection Error: () 
limesurvey_1  | 
limesurvey_1  | MySQL Connection Error: () 
limesurvey_1  | 
limesurvey_1  | MySQL Connection Error: () 
limesurvey_1  | 
limesurvey_1  | MySQL Connection Error: () 
limesurvey_1  | 
limesurvey_1  | MySQL Connection Error: () 
limesurvey_1  | 
limesurvey_1  | MySQL Connection Error: () 
limesurvey_1  | 
limesurvey_1  | MySQL Connection Error: () 
limesurvey_1  | 
limesurvey_1  | MySQL Connection Error: () 
limesurvey_1  | 
limesurvey_1  | MySQL Connection Error: () 
limesurvey_limesurvey_1 exited with code 1

AFAIU everything seems to be ok for mail_1 and mysql_1 but there are errors in limesurvey_1. Any thought ?

I'm using Docker version 19.03.13, build 4484c46 on Fedora 33.

duboism commented 3 years ago

I have found a similar closed issue (#7). Not sure what happens here.

duboism commented 3 years ago

Following #7,I tried to use 4.2.5. Downloading BaltimoreCyberTrustRoot.crt.pem works but docker-compose ends up with:

limesurvey_limesurvey_1 exited with code 6

Trying 4.3.33 raises the original issue.

duboism commented 3 years ago

One of the issues seems to be that my container can't access the network. It seems to be an issue with recent versions of docker. Adding network_mode: "host" to docker-compose.yml seems to help: download works.

But I still have limesurvey_limesurvey_1 exited with code 1.

adamzammit commented 3 years ago

It looks like LimeSurvey can't connect to your database. Can you please send the exact docker-compose file you have created and I'll have a look (ok to change passwords but please keep everything else).

duboism commented 3 years ago

The docker-compose.yml file I use is:

version: '2'

services:

  limesurvey:
    image: acspri/limesurvey:4.2.5
    network_mode: "host"
    ports:
      - 8082:80
    environment:
      LIMESURVEY_DB_PASSWORD: example
      LIMESURVEY_ADMIN_USER: admin
      LIMESURVEY_ADMIN_PASSWORD: password
      LIMESURVEY_ADMIN_NAME: Lime Administrator
      LIMESURVEY_ADMIN_EMAIL: lime@lime.lime
      LIMESURVEY_USE_INNODB: 1

  mysql:
    image: mariadb
    environment:
      MYSQL_ROOT_PASSWORD: example

  mail:
    image: djfarrelly/maildev
    ports:
      - "8081:80"

It's copied from the example in the repository with minor adaptations (network_mode: "host", using version 4.2.5, removing build: .). This one raises limesurvey_limesurvey_1 exited with code 1 after a few limesurvey_1 | MySQL Connection Error: ().

So your diagnostic is probably correct: the container can't connect to the DB container but I have no idea why. Thanks in advance for your help.

adamzammit commented 3 years ago

I don't think the network_mode command is right.

Please change back to:

`

version: '2'

services:

limesurvey: image: acspri/limesurvey:4.2.5 ports:

Then run a: docker-compose down

Then a: docker-compose up -d

If it doesn't start then try the docker-compose up -d command again as it may just be timing out waiting for the mysql container to start.

Adam

duboism commented 3 years ago

Without network_mode: "host", it can't download the certificates. But you're right it's not a solution since I think this prevents the connection to mysql to work.

I finally found a solution: the problem is that docker is more or less broken under Fedora 32 and more (I use Fedora 33). Following the accepted answer here, I was able to start the application (without network_mode: "host").