Connecting to Mariadb in an adjacent container on Synology Container Manager

Currently reading
Connecting to Mariadb in an adjacent container on Synology Container Manager

I see you changed the PUID and TZ values.
Those are examples. Always use the ones that apply to your specific installation, regardless of the source of the compose files.
I will proceed to delete the project and the associated folders and start from scratch again using your changes and post the results here.
According to @one-eyed-king there may be little success in that... I think you might need to consider the projectsend:r1053-ls27 release. As I mentioned, I've not tried this image. I'm tapped out.
Another source would be the guide from Marius.
:ROFLMAO: Thanks! I needed a good laugh today.
 
Last edited:
:ROFLMAO: Thanks! I needed a good laugh today.

OK, I understand the reasons, but as far as this project is concerned his guide just works if the OP insists on running db also in an adjacent container!
That's why I referenced him here, the OP maybe wanted to have a look...
 
Thank you for this, @one-eyed-king. Very helpful. I have already started from scratch once before and am certainly willing to do it again. I will try it. Are you using Container Manager on Synology? (I just want to know in case CM is introducing some unique issue on my end.)
Welcome!

I don't use CM, I use docker-compose from cli. I am too lazy to use a UI :)

It should work like this in CM as well. Though, I am not sure if the host folders need to be created manually before or are created by CM automatically.

Might it be that those DB_ variables are created by ProjectSend's start-up GUI? Maybe someone who knew that to be true set them in their compose file in advance?
The installer take the settings and renders the configuration file.

In many images a clever entrypoint scripts takes environment variables and renders them into configuration files instead. Many images that support mysql backends indeed support those exact variables... this one high likely doesn't.

They are not processed when the container starts, so the application itself would be responsible to make sense of the variables, and since they are not mentioned in the application documentation, I doubt they are actually used.
 
Hello @one-eyed-king. I started from scratch and the containers are up and running but I can still not get past the initial ProjectSend GUI. I can't get the "green check marks."

I am starting to be convinced that I don't have something set correctly on Synology Container Manager. Here is why...

I verified that under Container Manager (CM) I have a network called "projectsend_default" which was created by CM. inside this are the two containers. There is a gateway of 172.20.0.1 and my two containers are listed also.

projectsend_default.jpg


Selecting the details for the individual containers reveals their IPs. For the projectsend container I have 172.20.0.2.

projectsend_container.jpg
I used SSH to go

Similarly, the container mariadb-projectsend container has 172.20.0.2.

Another source would be the guide from Marius.
Just tested myself and works OK.

The guide has reference to Portainer but can be used as is in a Container Manager project.

Thank you! I like Marius guides. I personally am not currently using portainer but will use this as a reference.
-- post merged: --

Welcome!

I don't use CM, I use docker-compose from cli. I am too lazy to use a UI :)

It should work like this in CM as well. Though, I am not sure if the host folders need to be created manually before or are created by CM automatically.


The installer take the settings and renders the configuration file.

In many images a clever entrypoint scripts takes environment variables and renders them into configuration files instead. Many images that support mysql backends indeed support those exact variables... this one high likely doesn't.

They are not processed when the container starts, so the application itself would be responsible to make sense of the variables, and since they are not mentioned in the application documentation, I doubt they are actually used.
I created the appropriate new folders in advance of running the project. As I understand it CM will not make the folders for you.
 
I have done some testing. Starting from scratch and using the compose from @one-eyed-king (changing passwords though) I got the containers built and running. However I still can't get through ProjectSend's configuration GUI. So, I haven't gotten anywhere technically.

But, I started using the suggestions here:
4 Reasons Why Your Docker Containers Can't Talk to Each Other

I used SSH to get into my Synology as root. Then I started using the suggestions to assess the situation. What I found is that a network was created called projectsend_default and that both containers are in this network. Each container has an IP address as expected.

Ping results (container pinging container) as follows, using docker exec [containerA] ping [containerB] -c2
(1) projectsend pings mariadb-projectsends:
no reply
(2) mariadb-projectsends pings projectsend: OCI runtime exec failed: exec failed: unable to start container process: exec: "ping": executable file not found in $PATH: unknown

So clearly my mariadb container is not cooperating.
 
It should work. The network 172.20.0.0/24 is a user defined network, it should have dns-based service discovery.

If you feel comfortable to get on the shell, you can test it yourself:
Code:
me@dsm:/volume1/docker/projectsend$ docker-compose up -d
[+] Running 2/2
 ⠿ Container mariadb-projectsend  Started                                                                                                     0.9s
 ⠿ Container projectsend          Started                 

me@dsm:/volume1/docker/projectsend$ docker-compose exec projectsend bash
root@3926b3e18e11:/# ping -c 4 db
PING db (172.20.0.3): 56 data bytes
64 bytes from 172.20.0.3: seq=0 ttl=64 time=0.176 ms
64 bytes from 172.20.0.3: seq=1 ttl=64 time=0.070 ms
64 bytes from 172.20.0.3: seq=2 ttl=64 time=0.097 ms
64 bytes from 172.20.0.3: seq=3 ttl=64 time=0.111 ms

--- db ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.070/0.113/0.176 ms
root@3926b3e18e11:/# ping -c 4 mariadb-projectsend
PING mariadb-projectsend (172.20.0.3): 56 data bytes
64 bytes from 172.20.0.3: seq=0 ttl=64 time=0.217 ms
64 bytes from 172.20.0.3: seq=1 ttl=64 time=0.074 ms
64 bytes from 172.20.0.3: seq=2 ttl=64 time=0.068 ms
64 bytes from 172.20.0.3: seq=3 ttl=64 time=0.061 ms

--- mariadb-projectsend ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.061/0.105/0.217 ms
root@3926b3e18e11:/# exit
exit
The first ping uses the service name, the second ping uses the container name.
It is a pure coincidence that my network also uses the same subnet cidr 172.20.0.0/24.

Alternatively you can access the terminal of a container from the container "Action" menu -> "Open terminal". Click "create", and then select "bash" from the navigation menu. Then run the ping commands.
 
Last edited:
It should work. The network 172.20.0.0/24 is a user defined network, it should have dns-based service discovery.

If you feel comfortable to get on the shell, you can test it yourself:
Code:
me@dsm:/volume1/docker/projectsend$ docker-compose up -d
[+] Running 2/2
 ⠿ Container mariadb-projectsend  Started                                                                                                     0.9s
 ⠿ Container projectsend          Started              

me@dsm:/volume1/docker/projectsend$ docker-compose exec projectsend bash
root@3926b3e18e11:/# ping -c 4 db
PING db (172.20.0.3): 56 data bytes
64 bytes from 172.20.0.3: seq=0 ttl=64 time=0.176 ms
64 bytes from 172.20.0.3: seq=1 ttl=64 time=0.070 ms
64 bytes from 172.20.0.3: seq=2 ttl=64 time=0.097 ms
64 bytes from 172.20.0.3: seq=3 ttl=64 time=0.111 ms

--- db ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.070/0.113/0.176 ms
root@3926b3e18e11:/# ping -c 4 mariadb-projectsend
PING mariadb-projectsend (172.20.0.3): 56 data bytes
64 bytes from 172.20.0.3: seq=0 ttl=64 time=0.217 ms
64 bytes from 172.20.0.3: seq=1 ttl=64 time=0.074 ms
64 bytes from 172.20.0.3: seq=2 ttl=64 time=0.068 ms
64 bytes from 172.20.0.3: seq=3 ttl=64 time=0.061 ms

--- mariadb-projectsend ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.061/0.105/0.217 ms
root@3926b3e18e11:/# exit
exit
The first ping uses the service name, the second ping uses the container name.
It is a pure coincidence that my network also uses the same subnet cidr 172.20.0.0/24.

Alternatively you can access the terminal of a container from the container "Action" menu -> "Open terminal". Click "create", and then select "bash" from the navigation menu. Then run the ping commands.
Thanks for that. I am comfortable with the shell. Going into projectsend container, starting terminal and bash. I pinged both db and 172.20.0.3 and got the same result: no reply.

So it appears that mariadb isn't listening. And, when I tried to ping projectsend from mariadb (above) the ping wouldn't execute at all.

I started investigating the issue of the my.cnf file in mariadb. I don't have one, which I read is not unusual until you add a customization. Mariadb looks for the my.cnf file in order of these locations:
  • /etc/my.cnf
  • /etc/mysql/my.cnf
  • $MYSQL_HOME/my.cnf
  • [datadir]/my.cnf
  • ~/.my.cnf
The trouble is that I can find none of these folders at all in file station within /docker/projectsend. I don't know what to think. Maybe something wrong with my image or how it installed? That is what I will look at next. CORRECTION the folders are there but Synology does not expose them in it's File Browser (File Station). I can see the folders in a shell.
 
On Synology the host path of a volume must be on a share, so it must start with /{volumeN}/{share}/{your folder}, of course it can have as many subfolders as wanted.

Have you checked the logs of the mariadb container and the projectsend container?
The folders are indeed there, but not visible in File Station.

I pre-created the folders as required by the compose file. These folders were populated with folders and files by ProjectSend and MariaDB during my project installation, as one would expect. If I SSH in, I can see these new folders. I can cd into them and list their contents.

But these newly created folders are invisible in FileStation on Synology. I don't exactly understand why this is, or where to set them to display. I have asked Synology Support for advice.

I suspect this folder display issue is not relevant to the topic of this thread (ProjectSend connecting to MariaDB), but I'm not sure.
 
Last edited:
The folders are indeed there, but not visible in File Station.
This is the reason:
1702806972714.png

Update: Please ignore the above part of the response, as it is incorrect and not related to seeing the docker folder in FileStation. /eom

It should have worked based on the slightly modified compose file I shared, if you adjusted the PUID with an existing uid of your host machine (run id in the terminal to find out). In order for a container to be able to write into the mapped host folder, the containerized process must use the same uid, like the owner of the host folder.


Nevertheless, I am officially out of ideas.
 
On Synology the host path of a volume must be on a share, so it must start with /{volumeN}/{share}/{your folder}, of course it can have as many subfolders as wanted.

Have you checked the logs of the mariadb container and the projectsend container?
Regarding the container logs...

ProjectSend's container log doesn't have much of note. It's just informational messages plus "welcome, would you like to donate?" messages.

MariaDB's container log is different though. There are many errors, though I am not sure how to interpret them. I will attach them here.
This is the reason:
View attachment 14205

It should have worked based on the slightly modified compose file I shared, if you adjusted the PUID with an existing uid of your host machine (run id in the terminal to find out). In order for a container to be able to write into the mapped host folder, the containerized process must use the same uid, like the owner of the host folder.


Nevertheless, I am officially out of ideas.

Thank you for your ideas. I've been grateful for your assistance. I cleared that tic mark for "Hide this shared folder in 'My Network Places'" and it had no effect. A few comments about this. I always thought "My Network Places" was something in Windows Explorer. I am using FileStation, which is similar to Windows Explorer of course, but is part of Synology DiskStation Manager. Also, I accessed this tic box by editing the share called "Docker." But, within FileStation, I could always see Docker as well as the folders I created before running the project from scratch. Those folders were:

docker/projectsend
docker/projectsend/mariadb
docker/projectsend/data
docker/projectsend/config

When the project was run, these folders were populated with more subfolders and files that I can see in SSH but not in FileStation.

I will post here if I get any further.
 

Attachments

  • mariadb-projectsend.zip
    2.6 KB · Views: 4
I pre-created the folders as required by the compose file.
Presumably you did this as admin and not SSH'd as root.

FWIW, docker can auto-create these files when docker-compose is run, but will do so as root in most circumstances. As such an administration account would not “see these” in File Station. As mentioned, use File Station to create local bind-mounted folders.
 
Presumably you did this as admin and not SSH'd as root.

FWIW, docker can auto-create these files when docker-compose is run, but will do so as root in most circumstances. As such an administration account would not “see these” in File Station. As mentioned, use File Station to create local bind-mounted folders.
Thanks. That makes sense. Since there are also so many files created by this project as well, is there a SSH file browser application for windows that you know of?
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

  • Solved
I haven't thought about it as a file system level cache. If it is, it would make sense that both benefit...
Replies
8
Views
3,849
I'm not sure why I get that 172.17-address or if there's a way to change that...?
Replies
20
Views
6,231
Frustrating indeed. I will read further and try to discover what is all about. Thanks for your sincere...
Replies
20
Views
8,523
I registered and want to post this for the sake of anyone who might come along looking for answers like I...
Replies
10
Views
13,536

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending threads

Back
Top