DOMjudge / domjudge-packaging

DOMjudge packaging for (Linux) distributions and live image
31 stars 37 forks source link

domjudge/domserver:7.2.0 failed to restart #52

Closed TIS-OMiddle closed 4 years ago

TIS-OMiddle commented 4 years ago

Description of the problem

I try to restart the domserver docker, and it fails to run the /script/start.sh and logs:

[..] Updating database credentials file
sed: can't read webapp/.env.local.php: No such file or directory

Your environment

Steps to reproduce

similar with #50 , docker-compose.yml:

version: "3"
services:
    database:
        image: mariadb:10.4
        hostname: database
        networks:
            - domjudge_net
        env_file:
            - domserver.env
        volumes:
            - ../data/database:/var/lib/mysql
        command: --max-connections=1000
    domserver:
        image: domjudge/domserver:7.2.0
        hostname: domserver
        networks:
            - domjudge_net
        env_file:
            - domserver.env
        volumes:
            - /sys/fs/cgroup:/sys/fs/cgroup:ro
        ports:
            - 127.0.0.1:5283:80
        depends_on:
            - database
networks:
    domjudge_net:
        driver: bridge

domjudge.env::

CONTAINER_TIMEZONE=Asia/Shanghai
TZ=Asia/Shanghai
MYSQL_HOST=database
MYSQL_DATABASE=domjudge
MYSQL_USER=domjudge
MYSQL_PASSWORD=b9NIhdxuJAhqcVW8bg4RgUni
MYSQL_ROOT_PASSWORD=UmHDaoOMl1Nzoke1lyV5FZbSfYXmJvkO
DJ_DB_INSTALL_BARE=1

Expected behaviour

Success. Or it may fail due to some database or network problems.

Actual behaviour

It fails during the early run of /script/start.sh.

Here is the full log:

[..] Setting timezone

Current default time zone: 'Asia/Shanghai'
Local time is now:      Wed Feb 19 14:51:52 CST 2020.
Universal Time is now:  Wed Feb 19 06:51:52 UTC 2020.

[ok] Container timezone set to: Asia/Shanghai

[..] Changing nginx and PHP configuration settings
[ok] Done changing nginx and PHP configuration settings

[..] Updating database credentials file
grep: webapp/.env.local: No such file or directory
[ok] Updated database credentials file

[..] Checking database connection
MySQL database domjudge not found on host db; exiting
[..] Setting timezone

Current default time zone: 'Asia/Shanghai'
Local time is now:      Wed Feb 19 14:52:01 CST 2020.
Universal Time is now:  Wed Feb 19 06:52:01 UTC 2020.

[ok] Container timezone set to: Asia/Shanghai

[..] Changing nginx and PHP configuration settings
[ok] Done changing nginx and PHP configuration settings

[..] Updating database credentials file
sed: can't read webapp/.env.local.php: No such file or directory

Any other information that you want to share?

Image domjudge/domserver:7.1.1 works fine.

nickygerritsen commented 4 years ago

I seem to have missed two places to check for the existence of .env.local.php (which doesn't exist anymore in 7.2.0).

I have now built new 7.2.0 images that should work. Could you verify?