OCSInventory-NG / OCSInventory-Docker-Stack

Docker stack for OCSInventory Server
GNU General Public License v3.0
42 stars 38 forks source link

Server can't connect to db docker #7

Closed Hugotte976 closed 4 years ago

Hugotte976 commented 5 years ago

General informations

Docker host's operating system :

Linux 4.9.0-9-amd64 SMP Debian 4.9.168-1 (2019-04-12) x86_64 GNU/Linux

Docker informations

Docker compose version :

docker-compose version 1.24.1, build 4667896b docker-py version: 3.7.3 CPython version: 3.6.8 OpenSSL version: OpenSSL 1.1.0j 20 Nov 2018

Docker version :

Docker version 18.09.5, build e8ff056dbc

Problem's description

Hello,

I'm having some trouble when I try to launch OCSinventory-NG by using the Docker stack

I've use the docker-compose.yml and adapt the variables (here for testing)

OCS_DBUSER : ocs OCS_DBPASS : passwd MYSQL_USER : ocs MYSQL_PASSWORD : passwd

After launch with the setup.sh I encounter an error on the webpage about MySQL

ERROR: MySql connection problem 1130
Host '172.19.0.3' is not allowed to connect to this MySQL server
ERROR: MySql connection problem 1130
Host '172.19.0.3' is not allowed to connect to this MySQL server

I've try to lunch the stack with the same docker-compose.yml on MacOS : and don't have any problems. By comparing the log between the two OS : I found that on my Linux server, I did not have the part about the initiation of the database

Recreating 0f77899cb201_ocsinventory-db ... done
Recreating ocsinventory-server          ... done
Attaching to ocsinventory-db, ocsinventory-server
ocsinventory-db | 2019-08-07T19:43:50.452026Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
ocsinventory-db | 2019-08-07T19:43:50.466687Z 0 [Note] mysqld (mysqld 5.7.27) starting as process 1 ...
ocsinventory-db | 2019-08-07T19:43:50.482875Z 0 [Note] InnoDB: PUNCH HOLE support available
ocsinventory-db | 2019-08-07T19:43:50.488198Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
ocsinventory-db | 2019-08-07T19:43:50.488245Z 0 [Note] InnoDB: Uses event mutexes
ocsinventory-db | 2019-08-07T19:43:50.488388Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
ocsinventory-db | 2019-08-07T19:43:50.488413Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
ocsinventory-db | 2019-08-07T19:43:50.488435Z 0 [Note] InnoDB: Using Linux native AIO
ocsinventory-db | 2019-08-07T19:43:50.489390Z 0 [Note] InnoDB: Number of pools: 1
ocsinventory-db | 2019-08-07T19:43:50.489764Z 0 [Note] InnoDB: Not using CPU crc32 instructions
ocsinventory-db | 2019-08-07T19:43:50.501424Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
ocsinventory-db | 2019-08-07T19:43:50.598377Z 0 [Note] InnoDB: Completed initialization of buffer pool
ocsinventory-db | 2019-08-07T19:43:50.611846Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
ocsinventory-db | 2019-08-07T19:43:50.639737Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
ocsinventory-server | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.0.3. Set the 'ServerName' directive globally to suppress this message
ocsinventory-db | 2019-08-07T19:43:50.727698Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
ocsinventory-db | 2019-08-07T19:43:50.728597Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
ocsinventory-db | 2019-08-07T19:43:50.906097Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
ocsinventory-db | 2019-08-07T19:43:50.910119Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
ocsinventory-db | 2019-08-07T19:43:50.910170Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
ocsinventory-db | 2019-08-07T19:43:50.911843Z 0 [Note] InnoDB: Waiting for purge to start
ocsinventory-db | 2019-08-07T19:43:50.964671Z 0 [Note] InnoDB: 5.7.27 started; log sequence number 2626948
ocsinventory-db | 2019-08-07T19:43:50.966029Z 0 [Note] Plugin 'FEDERATED' is disabled.
ocsinventory-db | 2019-08-07T19:43:50.976517Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
ocsinventory-db | 2019-08-07T19:43:51.030751Z 0 [Note] InnoDB: Buffer pool(s) load completed at 190807 19:43:51
ocsinventory-db | 2019-08-07T19:43:51.121662Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
ocsinventory-db | 2019-08-07T19:43:51.123315Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
ocsinventory-db | 2019-08-07T19:43:51.123893Z 0 [Note] IPv6 is available.
ocsinventory-db | 2019-08-07T19:43:51.124245Z 0 [Note]   - '::' resolves to '::';
ocsinventory-db | 2019-08-07T19:43:51.128303Z 0 [Note] Server socket created on IP: '::'.
ocsinventory-db | 2019-08-07T19:43:51.157683Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
ocsinventory-db | 2019-08-07T19:43:51.238293Z 0 [Note] Event Scheduler: Loaded 0 events
ocsinventory-db | 2019-08-07T19:43:51.239081Z 0 [Note] mysqld: ready for connections.
ocsinventory-db | Version: '5.7.27'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)

I thought the problem could come from creating a network for the stack, but after 2 hours of searching I did not find a solution I follow the tips on the #4 issue, but doesn't work too...

gillesdubois commented 4 years ago

Hi,

Our Docker image has been reworked completly. 2.6 / nightly / dev tags are now available.

A complete documentation is available on wiki. Compose files are now located on the image repository and not on this one anymore.

Regards, Gilles Dubois.