-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker-compose up is not starting icinga2 #224
Comments
Hi @pnunn I think it might be because MySQL/MariaDB only permits root logins from localhost by default. You'll need to enable root login from the remote host or in this case, from the pod IP set: https://mariadb.com/kb/en/configuring-mariadb-for-remote-client-access/ |
hi @jjethwa, I'm a bit new to this I have to admit... how do I change that? I'm using the docker-compose file from the repo... should it be set in there somewhere? Sorry if this is obvious. OK, worked out from the link that it was a database operation.. sorry, my lack of reading properly. So, privileges for root were already in place for '%' but I added '172.18.0.%' as well just in case, sadly, some errors still. |
Hi @pnunn No problem at all and sorry that it did not work. Are you seeing the same error in the container startup?
|
Hi @jjethwa Don't be sorry, probably my lack of knowledge. The logs look like this
I tried to attache to the machine to see if I could get to the mysql server, but it dies before I can get connected unfortunately. Happy to help debug this but a bit at a loss as to how. :) |
Looking further at the logs.. it seems to be trying to log into itself as root and that's what is failing. The mysql server is on 0.2 not 0.4. |
Ah nice find! The variable DEFAULT_MYSQL_HOST should be set within the docker-compose file to mysql which is what the container running MariaDB is named. Somehow it's defaulting to localhost though and I'm not sure why. As a test, try hardcoding the IP of the MariaDB container as the value for DEFAULT_MYSQL_HOST in your docker-compose and see if it works. |
Hmm... maybe I'm wrong here... I made that change to the compose file, but I'm still getting
But.. it does seem to be mysql1 that is refusing access to icinga2. |
OK.. I installed a ubuntu container on the same network as icinga2 and installed mysql client into it. I then tried to connect to the mysql server with the following results.
Not sure if that helps or confuses things. |
But this does work
Interesting. |
Thanks for the additional troubleshooting. So the last comment does show that MySQL is up and running and allowing remote access as you were able to connect to it from the Ubuntu container. I really think it's something with the DEFAULT_MYSQL_HOST var not being set properly so it's defaulting to trying to connect to a local MySQL/MariaDB which doesn't exist in this case. For another test, can you try running the container in a standalone mode? Something like
and see if it's able to come up properly? This will run MariaDB inside the same container as Icinga2. |
OK, I think the stand alone one started OK, especially when I put it on the same network as the graphite machine.. I then blew away the other instances and simplified the root password thinking that it might be due to the # in the password. Unfortunately I still get mysql trying to open on the icinga2 host regardless of the host name in the env file, and now I can't even log into root mysl on the actual mysql server (access denied errors). Sigh.. no idea where to go now. |
Having said that... I just looked at the end of the logs in the icinga instance and there are a bunch of these
which would seem to suggest it now knows where the mysql server is, just can't log in. |
Right.. I removed all of the containers and volumes and tried again with a simpler password and it seems to have come up now (I can see things in the logs that indicate its all working).. however.. I had to redirect the ports 4443->443 and 4080->80 because of other machines running on the docker host and now I'm getting connection refused when I go to either http://192.168.44.144:4080 or https://192.168.44.144:4443. I get connection refused even from the host console itself with curl. Is this because its on its own network perhaps? Although if that were the case it wouldn't have complained about the clashing ports.. hmm.. Got to be close now :) |
OK, seems it a permissions issue. Fatal error: Uncaught Icinga\Exception\ConfigurationError: Can't save session, path '/var/lib/php/sessions' is not writable. in /usr/share/php/Icinga/Web/Session/PhpSession.php:98 Stack trace: #0 /usr/share/php/Icinga/Web/Session/PhpSession.php(48): Icinga\Web\Session\PhpSession->__construct(Array) #1 /usr/share/php/Icinga/Web/Session.php(32): Icinga\Web\Session\PhpSession::create() #2 /usr/share/php/Icinga/Application/Web.php(363): Icinga\Web\Session::create() #3 /usr/share/php/Icinga/Application/Web.php(89): Icinga\Application\Web->setupSession() #4 /usr/share/php/Icinga/Application/ApplicationBootstrap.php(369): Icinga\Application\Web->bootstrap() #5 /usr/share/php/Icinga/Application/webrouter.php(99): Icinga\Application\ApplicationBootstrap::start() #6 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...') #7 {main} thrown in /usr/share/php/Icinga/Web/Session/PhpSession.php on line 98 I'm going to blow it all away again and restart as root and see what happens. |
OK, no change.. apache2 fails to start and manually running apache2 results in the error above even when started as sudo. Sigh. |
So.. change data pemissions to a+rw for all directories and files and I've managed to manually start apache2 in the icinga2 container. I now get Should I now manually create a token and set it up or does this just mean something is still broken. ps -A gives me root@icinga2:/# ps -A |
It should have set up the token for you automatically and you shouldn't have needed to do anything with the permissions either. This is really strange. What version of docker are you running and what platform? Starting the container with just the docker run command like I suggested should have given you a fully up and running icinga2 instance with MariaDB and Apache... all self-contained 😟 |
pnunn@dockerhost:~$ docker -v on linux. Should clarify.. the above message is back to the multi machine setup using docker-compose, that's the one I'm trying to debug. I'll go ahead and create the token and see what happens. Just a bit concerned that other things may not have been set up along with the token. |
I'll download that version and give it a go tomorrow. I agree with you, let's hope nothing else missed the setup step. It should have errored out when the container started up, but since we're in uncharted territory, anything is possible 😛 |
OK... there don't appear to be any more errors in the logs.. but apache didn't start when the container did so something is grumpy still by the looks.. I'll go ahead and see if I can work out how to get this thing running from here later today. |
Oh no! Really sorry about this. Maybe try the docker run command on a clean VM too if you can:
|
OK, I've just worked out that the docker-compose up didn't create any database schema's either so I guess it didn't get through the setup process. |
Yeah, that makes sense, the step that failed with connecting to the database as root is so it can set up the schema 😢 |
OK, got it... So, I think it was because there was no container name for the mysql container. I added container_name:mysql to the docker-compose file. I also created the data directory after the git clone and set it to a+w. I the fixed the rest of the config items in docker-compose and started everything and its now working (does a little happy dance). I think I needed both of the fixes above to make it run, but I've got it going, blown it away, re-cloned and stared it again a number of times now and it seems to be good. Now all I need to do is work out how to use icinga and graphite :) |
That's awesome! Do you mind sharing the change in the docker-compose file for the MySQL/MariaDB as an example? |
Sure.. here it is. (had to add the .txt to upload). |
Thanks, @pnunn So looks like the docker-compose file was missing container_name: mysql I'll add it now. Let me know if anything else was missing 😄 |
Hi @pnunn, what exactly you did with "I also created the data directory after the git clone and set it to a+w."? |
Hi @jjethwa ;
i guess it's related to the jordan/icinga2 version, i used an older tag: jordan/icinga2:2.10.2 with that the database connection worked liked a charm |
I was having problems as described on this post with the latest image 2.13.5. I tried an older image as @reyerdam suggested and it worked. I then tried several images on the 2.13 family, and it seems that
Looking at the commit history, it seems that the cron support is causing this problem as the 55-cron file was introduced between the release of EDIT: |
Hey @jangeador I'm on vacation, but will take a look as soon as I get back home 😄 |
Hi @jangeador Thanks for your patience, I'm back! 😄 I ran through a quick test following the instructions here: https://github.com/jjethwa/icinga2#docker-compose and it seemed to work without throwing the error you received. For reference, I am on |
Hi,
I've cloned the repo and changed the root mysql password and generally followed the bouncing ball.
However, when I try and bring up the machines icinga2 fails with errors about not being able to log in with the root user.
I started the mariadb and graphite containers on their own and the root mysql password seems to be correct so I'm at a bit of a loss.
The errors are
icinga2_1 | warning/cli: Feature 'command' already enabled.
mysql_1 | 2020-04-11 1:59:56 29 [Warning] Access denied for user 'root'@'172.18.0.3' (using password: YES)
icinga2_1 | ERROR 1045 (28000): Access denied for user 'root'@'172.18.0.3' (using password: YES)
icinga2_1 | run-parts: /opt/setup/50-icinga2 exited with return code 1
graphite | 11/04/2020 01:59:57 :: [tagdb] Tagging carbon.agents.graphite-a.updateOperations
graphite | 11/04/2020 01:59:57 :: [tagdb] Tagged carbon.agents.graphite-a.updateOperations in 0.008032083511352539
mysql_1 | 2020-04-11 2:00:00 30 [Warning] Access denied for user 'root'@'172.18.0.3' (using password: NO)
mysql_1 | 2020-04-11 2:00:00 31 [Warning] Access denied for user 'root'@'172.18.0.3' (using password: YES)
and then icinga fails with an exit code of 1
Any ideas?
The text was updated successfully, but these errors were encountered: