Git Product home page Git Product logo

Comments (3)

Maddosaurus avatar Maddosaurus commented on July 20, 2024

After testing with the compose file a bit more, it seems there are side effects that I am not sure how to counter.
The first build on a fresh system succeeds, but if I change anything in the docker-compose file, I am presented with the internal error.
Even cleaning the system via

docker-compose rm -v
docker system prune
docker rmi misp
docker rmi mysql/mysql-server

removing all data dirs and resetting the git repo to HEAD does not change the outcome.
If you need any detailed logs or further info, please give me a heads up, I'm happy to help.

from x_old_misp_docker.

Maddosaurus avatar Maddosaurus commented on July 20, 2024

Seems like I have tracked down the problem.
It all boils down to a faulty MySQL DB-Connection. The config in app/Config/database.php correctly makes use of the DNS-name of the Docker-container.
However, somewhere deeper the line, something seems to cache the initial IP address of the db container. As soon as the addresses change (i.e. update, restart, ...), MISP fails with an internal error, as it cannot establish a connection to the database.
I'm not deep enough into the architecture to track it down further, but a workaround seems to be to assign fixed addresses to the containers in the docker-compose.yml. We should definitely try to track this down, but this might be a workaround for the time being.
The problem can be reproduced by restarting the Docker containers multiple times until there's an IP change. Afterwards, errors like this show up in the error.log:

2019-07-28 10:26:55 Error: [MissingConnectionException] Database connection "Mysql" is missing, or could not be created.
Exception Attributes: array (
  'class' => 'Mysql',
  'message' => 'SQLSTATE[HY000] [1045] Access denied for user \'misp\'@\'172.18.0.15\' (using password: YES)',
  'enabled' => true,
)
Request URL: /
Stack Trace:
#0 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Datasource/DboSource.php(278): Mysql->connect()
#1 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/ConnectionManager.php(105): DboSource->__construct(Array)
#2 /var/www/MISP/app/Controller/AppController.php(126): ConnectionManager::getDataSource('default')
#3 /var/www/MISP/app/Controller/EventsController.php(55): AppController->beforeFilter()
#4 /var/www/MISP/app/Lib/cakephp/lib/Cake/Event/CakeEventManager.php(243): EventsController->beforeFilter(Object(CakeEvent))
#5 /var/www/MISP/app/Lib/cakephp/lib/Cake/Controller/Controller.php(682): CakeEventManager->dispatch(Object(CakeEvent))
#6 /var/www/MISP/app/Lib/cakephp/lib/Cake/Routing/Dispatcher.php(189): Controller->startupProcess()
#7 /var/www/MISP/app/Lib/cakephp/lib/Cake/Routing/Dispatcher.php(167): Dispatcher->_invoke(Object(EventsController), Object(CakeRequest))
#8 /var/www/MISP/app/webroot/index.php(92): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#9 {main}

whereas 172.18.0.15 is the initial IP address of the db container, but not its current.

from x_old_misp_docker.

SteveClement avatar SteveClement commented on July 20, 2024

I cannot reproduce this.

from x_old_misp_docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.