LibreBooking / docker

Librebooking as a docker container
GNU General Public License v3.0
11 stars 12 forks source link

Unable to do the install #86

Closed JohnVillalovos closed 6 months ago

JohnVillalovos commented 6 months ago

I am following the instructions here: https://github.com/LibreBooking/docker/blob/develop/SETUP.md

When I try to do the "Database initialization" I always receive error messages like:

Error connecting to mysql database. Check your configured host and entered username and password.

I am using the username "root" and have tried both the values of MYSQL_ROOT_PASSWORD and MYSQL_PASSWORD. LB_DB_USER_PWD is set to the same value as MYSQL_PASSWORD.

I have tried: image: librebooking/librebooking:2.8.6.1 and image: librebooking/librebooking:develop

I'm hoping I'm doing some simple error but have been trying for over an hour without any success.

JohnVillalovos commented 6 months ago

Update: I have resolved this issue by switching to netavark in podman

In the Docker log I see:

[app] | [Thu May 09 19:29:55.854093 2024] [php:warn] [pid 97] [client 10.89.1.3:37906] PHP Warning:  mysqli_connect(): php_network_getaddresses: getaddrinfo for db failed: Name or service not known in /var/www/html/Presenters/Install/Installer.php on line 203, referer: http://dev.example.com:8080/Web/install/index.php
colisee commented 6 months ago

Hi @JohnVillalovos

Could you please share your docker-compose.yml file?

Do not forget to XXX any mentioned password.

JohnVillalovos commented 6 months ago

Hi @colisee Thanks.

I should mention that I am using podman and not docker. So doing it with podman-compose.

I did figure out the network issue not being resolved. I switched to using netavark and aardvark for podman

docker-compose.yml:

version: "3.7"

services:
  db:
    image: linuxserver/mariadb:10.6.13
    container_name: librebooking-db
    restart: always
    networks:
      - mynet
    volumes:
      - vol-db:/config:z
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Americas/Los_Angeles
      - MYSQL_DATABASE=librebooking
      - MYSQL_ROOT_PASSWORD=rootpwd
      - MYSQL_USER=lb_user
      - MYSQL_PASSWORD=userpwd
  app:
    image: librebooking/librebooking:develop
    # image: librebooking/librebooking:2.8.6.1
    container_name: librebooking
    restart: always
    depends_on:
      - db
    networks:
      - mynet
    ports:
      - "8080:80"
    volumes:
      - vol-app:/config:z
    environment:
      - LB_DB_NAME=librebooking
      - LB_DB_USER=lb_user
      - LB_DB_USER_PWD=userpwd
      - LB_DB_HOST=db
      - LB_INSTALL_PWD=installpwd
      - LB_ENV=dev
      - LB_LOG_FOLDER=/var/log/librebooking
      - LB_LOG_LEVEL=debug
      - LB_LOG_SQL=false
      - TZ=Americas/Los_Angeles

volumes:
  vol-db:
    name: librebooking_data
  vol-app:
    name: librebooking_conf

networks:
  mynet: {}
JohnVillalovos commented 6 months ago

What I see in the podman-compose log, at the point I attempt to run the install via the web interface

[app] | [Thu May 09 20:23:25.707393 2024] [php:warn] [pid 101] [client 10.89.0.5:45526] PHP Warning:  Undefined array key "HTTPS" in /var/www/html/lib/Server/Server.php on line 254
[app] | 10.89.0.5 - - [09/May/2024:20:23:25 +0000] "GET /Web/install/ HTTP/1.1" 200 2776 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0"
[app] | [Thu May 09 20:23:40.771948 2024] [php:warn] [pid 96] [client 10.89.0.5:49182] PHP Warning:  Undefined array key "HTTPS" in /var/www/html/lib/Server/Server.php on line 254, referer: http://dev.example.com:8080/Web/install/
[app] | 10.89.0.5 - - [09/May/2024:20:23:40 +0000] "POST /Web/install/index.php HTTP/1.1" 200 2505 "http://dev.example.com:8080/Web/install/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0"
colisee commented 6 months ago

Are you running the containers in root or rootless mode with podman?

The issue is that, somehow, your mynet network does not feature the DNS resolution, the way it was created...

JohnVillalovos commented 6 months ago

I am running in rootless mode. I believe that I have resolved the DNS issue as I no longer see the error about gettaddrinfo failed.

JohnVillalovos commented 6 months ago

I am seeing these errors in the mariadb log:

2024-05-09 21:02:43 49 [Warning] Access denied for user 'root'@'1b69bd7f114e' (using password: YES)
2024-05-09 21:02:43 50 [Warning] Access denied for user 'root'@'1b69bd7f114e' (using password: YES)
JohnVillalovos commented 6 months ago

Woo hoo! I got it working.

So I had remove the previous vol-db directory as I had changed the passwords.

So this time I was able to run the install. Thanks!

JohnVillalovos commented 6 months ago

Thanks @colisee for your assistance!!