Connecting to Mariadb in an adjacent container on Synology Container Manager

186 Views Asked by At

I am using Synology Container Manager. I have two containers only. One with ProjectSend and one with Mariadb. Both containers are up and running (according to Container Manager).

When first accessing ProjectSend from Firefox, you have to connect ProjectSend to its database. There is a CHECK button and once things pass muster you can move on and start using ProjectSend.

Trouble is I can not get it to connect.

The ProjectSend's "Database Configuration" GUI checks the Host, Database name, Username, and Password. None of these are confirming. I am trying to get all green checks.

enter image description here

Using SSH, I have accessed the Synology, and then the Container, and then MariaDB itself from another PC. I can interact with Mariadb using SSH. With my limited knowledge and lots of web research I have queried some things. It seems my user accounts (two of them: root and another one) are there and they are both marked as % which I interpret to mean these users, if password is correct, can come into Mariadb from anywhere.

I have also included in my compose file the following command: --default-authentication-plugin=mysql_native_password

in order to tell MariaDB to accept a SHA1 password which is apparently what's required by ProjectSend. I also executed this command directly by SSH while logged in as root to the database.

From the red check marks it would seem that ProjectSend can't even find the host, much less authenticate. I have tried various things for the host field, including localhost, the Mariadb container's IP, MariaDB, plus all of these with the :3306 port attached, just for grins.

Synology Container Manager has created a network called "projectsend_default" and both containers are included in this "network" which is using 172.17.X.X.

Both images used for container creation were the "latest" from the image registry and both appeared to install without issue (Error code=0).

I have stopped and started the containers. I started MariaDB first and waited a few minutes then started ProjectSend.

Does anyone have some ideas why ProjectSend inside its container can't see MariaDB in the adjacent container?

Many thanks in advance.

COMPOSE...(passwords changed to x)

version: "2.1"
services:
  projectsend:
    image: linuxserver/projectsend
    container_name: projectsend
    environment:
      - PUID=998
      - PGID=100
      - TZ=America/Denver
      - MAX_UPLOAD=5000
    volumes:
      - /volume1/docker/projectsend/config:/config #Config Volume Goes Here
      - /volume1/docker/projectsend:/data #File Storage Volume Goes Here
    ports:
      - 8010:80
    restart: unless-stopped
  db:
    image: mariadb
    container_name: mariadb-projectsend
    environment:
      MYSQL_ROOT_PASSWORD: xxxxxxx
      MYSQL_DATABASE: projectsend
      MYSQL_USER: user
      MYSQL_PASSWORD: xxxxxxx
      TZ: America/Denver
    volumes:
      - /volume1/docker/projectsend/mariadb:/var/lib/mysql #Database Volume Goes Here
    ports:
      - "3306:3306"  
    command: --default-authentication-plugin=mysql_native_password   
    restart: unless-stopped
1

There are 1 best solutions below

0
danblack On

By using your compose.yml example, replacing path configuration with named volumes, I just needed to enter mariadb-projectsend as the hostname. The container hostname is accessible by other nodes in the compose file.

screenshot of project send installation screen check with all green on database access credentials.

compose.yml changes:

    volumes:
      - psconfig:/config #Config Volume Goes Here
      - psdata:/data #File Storage Volume Goes Here
....
    volumes:
      - dbdata:/var/lib/mysql #Database Volume Goes Here
...
volumes:
  psdata:
    driver: local
  psconfig:
    driver: local
  dbdata:
    driver: local