Context
I'm working on provisioning Icinga2 Web2 with IDO PostgreSQL and IDO MySQL using Ansible on CentOS 7.
I base my work on the great https://github.com/Icinga/icinga2-ansible roles. I have forked the project (mickael-ange/icinga2-ansible) to added more automation and support such as IDO PostgreSQL. I'm using PostgreSQL server 9.4.
Well, I ends up with a version of icinga2-ansible-web2-ui role which installs Icinga2 Web2 with IDO PostgreSQL or IDO MySQL automatically without wizard.
My Problem
The server seems to work properly at the exception that I cannot figure out how to get data in Icinga2 Web2 interface such as:
Comments and Downtimes from Overview menu
Event Grid, Event Overview, Notifications, Timeline from History menu
I can create Comments and Schedule Downtimes, but they don't get listed in the UI. Downtimes are processed correctly.
I can send Notifications but they don't get listed in the UI as well. Notifications are sent out when SELinux is in permissive mode.
My questions is: is there any IDO or Icinga2 Web2 configuration to get the database populate with Comments, Downtimes, etc..?
My /etc/icinga2/features-enabled/ido-pgsql.conf
library "db_ido_pgsql"
object IdoPgsqlConnection "ido-pgsql" {
user = "icinga"
password = "icinga"
host = "localhost"
database = "icinga"
table_prefix = "icinga_"
instance_name = "icinga2"
instance_description = "icinga2 instance"
cleanup = {
downtimehistory_age = 48h
logentries_age = 31d
}
categories = DbCatConfig | DbCatState
}
Notes
Note 1
I have already searched in most of the documentation of Icinga2 project and forums I could find but no cigar. I'm surprise none gets this problem before so it is probably a problem on my side.
Note 2
After chatting on Icinga IRC channel and doing more tests I figure out that my problem only happens with PostgreSQL backend. It is working as expected with MySQL backend.
Debugging Sessions
Debugging session 1
I have gathered more info/logs about my environments.
PostgreSQL Permissions
I checked my PostgreSQL permissions for icinga user:
TABLE permissions are set to SELECT,INSERT,UPDATE,DELETE
SEQUENCE permissions are set to USAGE
I even tried configuring postgres as user to access to the backend (icinga_ido and icingaweb_ido resources) but I'm still not getting any Comments listed in the UI (after having created a comment).
Here are the PosgreSQL permissions listed by \dp command:
icinga=> \dp
Access privileges
Schema | Name | Type | Access privileges | Column access privileges
--------+-----------------------------------------------------------------+----------+---------------------------+--------------------------
public | icinga_acknowledgements | table | postgres=arwdDxt/postgres+|
| | | icinga=arwd/postgres |
public | icinga_acknowledgements_acknowledgement_id_seq | sequence | postgres=rwU/postgres +|
| | | icinga=U/postgres |
public | icinga_commands | table | postgres=arwdDxt/postgres+|
| | | icinga=arwd/postgres |
public | icinga_commands_command_id_seq | sequence | postgres=rwU/postgres +|
| | | icinga=U/postgres |
public | icinga_commenthistory | table | postgres=arwdDxt/postgres+|
| | | icinga=arwd/postgres |
public | icinga_commenthistory_commenthistory_id_seq | sequence | postgres=rwU/postgres +|
| | | icinga=U/postgres |
<truncated>
Furthermore, I have no error in PostgreSQL logs (e.g. /var/lib/pgsql/9.4/data/pg_log/postgresql-Thu.log) when creatinh Comment from Icinga UI.
However, I figured out there are errors when trying to browse SEQUENCE from pgAdmin UI using icinga user (no error with postgres user):
< 2016-01-21 03:55:52.436 GMT >STATEMENT: SELECT last_value, min_value, max_value, cache_value, is_cycled, increment_by, is_called
FROM icinga_acknowledgements_acknowledgement_id_seq
But I'm not sure if it makes sense or not as icinga user has only USAGE permission on SEQUENCE.
Comparing PostgreSQL and MySQL Backends' Debug Logs
So I ends up with comparing Icinga debug logs on both sides (MySQL IDO and PostgreSQL IDO) when I creates a comment. I can see that only with MySQL backend there are the SQL statements I was looking for, whom insert data in icinga_externalcommands, icinga_comments, and icinga_commenthistory tables.
I don't have enough reputation to provide more than 2 links (e.g. pastebin). So here are the logs.
Adding a Comment with PostgreSQL backend:
[2016-01-21 04:14:00 +0000] information/ExternalCommandListener: Executing external command: [1453349640] ADD_HOST_COMMENT;icinga2-web2-postgres;1;icingaadmin;dededewdwwewdew
[2016-01-21 04:14:00 +0000] debug/DbEvents: add external command history
[2016-01-21 04:14:00 +0000] notice/ExternalCommandProcessor: Creating comment for host icinga2-web2-postgres
[2016-01-21 04:14:00 +0000] information/ConfigCompiler: Compiling config file: /var/lib/icinga2/api/packages/_api/icinga2-web2-postgres-1453347670-1/conf.d/comments/icinga2-web2-postgres!icinga2-web2-postgres-1453349640-1.conf
[2016-01-21 04:14:00 +0000] information/ConfigItem: Committing config items
[2016-01-21 04:14:00 +0000] warning/ApplyRule: Apply rule 'satellite-host' (in /etc/icinga2/conf.d/satellite.conf: 29:1-29:41) for type 'Dependency' does not match anywhere!
[2016-01-21 04:14:00 +0000] warning/ApplyRule: Apply rule '' (in /etc/icinga2/conf.d/services.conf: 57:1-57:65) for type 'Service' does not match anywhere!
[2016-01-21 04:14:00 +0000] warning/ApplyRule: Apply rule '' (in /etc/icinga2/conf.d/services.conf: 65:1-65:53) for type 'Service' does not match anywhere!
[2016-01-21 04:14:00 +0000] information/ConfigItem: Instantiated 1 Comment.
[2016-01-21 04:14:00 +0000] information/ConfigItem: Triggering Start signal for config items
[2016-01-21 04:14:00 +0000] information/ConfigItem: Activated all objects.
[2016-01-21 04:14:00 +0000] notice/Comment: Added comment 'icinga2-web2-postgres!icinga2-web2-postgres-1453349640-1'.
[2016-01-21 04:14:01 +0000] debug/IdoPgsqlConnection: Query: COMMIT
[2016-01-21 04:14:01 +0000] debug/IdoPgsqlConnection: Query: BEGIN
Adding a Comment with MySQL backend:
[2016-01-21 04:12:49 +0000] information/ExternalCommandListener: Executing external command: [1453349569] ADD_HOST_COMMENT;icinga2-web2-mysql;1;icingaadmin;yggygyyj
[2016-01-21 04:12:49 +0000] debug/DbEvents: add external command history
[2016-01-21 04:12:49 +0000] notice/ExternalCommandProcessor: Creating comment for host icinga2-web2-mysql
[2016-01-21 04:12:49 +0000] information/ConfigCompiler: Compiling config file: /var/lib/icinga2/api/packages/_api/icinga2-web2-mysql-1453347256-1/conf.d/comments/icinga2-web2-mysql!icinga2-web2-mysql-1453349569-0.conf
[2016-01-21 04:12:49 +0000] information/ConfigItem: Committing config items
[2016-01-21 04:12:49 +0000] warning/ApplyRule: Apply rule 'satellite-host' (in /etc/icinga2/conf.d/satellite.conf: 29:1-29:41) for type 'Dependency' does not match anywhere!
[2016-01-21 04:12:49 +0000] warning/ApplyRule: Apply rule '' (in /etc/icinga2/conf.d/services.conf: 57:1-57:65) for type 'Service' does not match anywhere!
[2016-01-21 04:12:49 +0000] warning/ApplyRule: Apply rule '' (in /etc/icinga2/conf.d/services.conf: 65:1-65:53) for type 'Service' does not match anywhere!
[2016-01-21 04:12:49 +0000] information/ConfigItem: Instantiated 1 Comment.
[2016-01-21 04:12:49 +0000] information/ConfigItem: Triggering Start signal for config items
[2016-01-21 04:12:49 +0000] information/ConfigItem: Activated all objects.
[2016-01-21 04:12:49 +0000] notice/Comment: Added comment 'icinga2-web2-mysql!icinga2-web2-mysql-1453349569-0'.
[2016-01-21 04:12:50 +0000] debug/IdoMysqlConnection: Query: INSERT INTO icinga_externalcommands (command_args, command_name, command_type, endpoint_object_id, entry_time, instance_id) VALUES ('icinga2-web2-mysql;1;icingaadmin;yggygyyj', 'ADD_HOST_COMMENT', '1', 1, FROM_UNIXTIME(1453349569), 1)
[2016-01-21 04:12:50 +0000] debug/IdoMysqlConnection: Query: INSERT INTO icinga_comments (author_name, comment_data, comment_source, comment_time, comment_type, endpoint_object_id, entry_time, entry_time_usec, entry_type, expires, instance_id, internal_comment_id, is_persistent, name, object_id) VALUES ('icingaadmin', 'yggygyyj', '1', FROM_UNIXTIME(1453349569), '2', 1, FROM_UNIXTIME(1453349569), '947563', '1', '0', 1, '1', '1', 'icinga2-web2-mysql!icinga2-web2-mysql-1453349569-0', 68)
[2016-01-21 04:12:50 +0000] debug/IdoMysqlConnection: Query: INSERT INTO icinga_commenthistory (author_name, comment_data, comment_source, comment_time, comment_type, endpoint_object_id, entry_time, entry_time_usec, entry_type, expires, instance_id, internal_comment_id, is_persistent, name, object_id) VALUES ('icingaadmin', 'yggygyyj', '1', FROM_UNIXTIME(1453349569), '2', 1, FROM_UNIXTIME(1453349569), '947563', '1', '0', 1, '1', '1', 'icinga2-web2-mysql!icinga2-web2-mysql-1453349569-0', 68)
[2016-01-21 04:12:50 +0000] debug/IdoMysqlConnection: Query: COMMIT
[2016-01-21 04:12:50 +0000] debug/IdoMysqlConnection: Query: BEGIN
Restarting Icinga2 with PostgreSQL and MySQL Backends
When restarting Icinga2 with both PostgreSQL and MySQL Backends, I have pretty much the same logs which sounds good!
# Icinga2 restart with PostgreSQL
[2016-01-21 05:02:11 +0000] information/Application: Received request to shut down.
[2016-01-21 05:02:11 +0000] information/Application: Shutting down...
[2016-01-21 05:02:11 +0000] information/CheckerComponent: Checker stopped.
[2016-01-21 05:02:11 +0000] information/DbConnection: Resuming IDO connection: ido-pgsql
[2016-01-21 05:02:11 +0000] information/ConfigItem: Activated all objects.
[2016-01-21 05:02:11 +0000] information/ConfigCompiler: Compiling config file: /var/lib/icinga2/modified-attributes.conf
[2016-01-21 05:02:11 +0000] information/IdoPgsqlConnection: pgSQL IDO instance id: 1 (schema version: '1.14.0')
# Icinga2 restart with MySQL
[2016-01-21 05:03:20 +0000] information/Application: Received request to shut down.
[2016-01-21 05:03:20 +0000] information/Application: Shutting down...
[2016-01-21 05:03:20 +0000] information/CheckerComponent: Checker stopped.
[2016-01-21 05:03:20 +0000] information/DbConnection: Resuming IDO connection: ido-mysql
[2016-01-21 05:03:20 +0000] information/ConfigItem: Activated all objects.
[2016-01-21 05:03:20 +0000] information/ConfigCompiler: Compiling config file: /var/lib/icinga2/modified-attributes.conf
[2016-01-21 05:03:20 +0000] information/IdoMysqlConnection: MySQL IDO instance id: 1 (schema version: '1.14.0')
Packages Version
icinga2-2.4.1-1.el7.centos.x86_64
icinga2-ido-pgsql-2.4.1-1.el7.centos.x86_64
postgresql94-9.4.5-1PGDG.rhel7.x86_64
postgresql94-server-9.4.5-1PGDG.rhel7.x86_64
How to Reproduce this Issue
For those who has the energy to reproduce the problem you can clone mickael-ange/icinga2-ansible Github repo (branch: Issue-No-Historical-Data-in-Icinga2-Web2-and-DB) and follow instructions at icinga2-we2-vagrant.md. You need to install the required tools if it is not already the case. Then install role dependencies with librarian-ansible. Finally, I wrote a section (#ido-no-historical-data-in-icinga2-web2-and-db) to reproduce the problem.
Thank you in advance to take the time read until here!
Mickael
Finally, I figured out why historical data were not inserted into the DB, so I'm here responding to myself.
As explained in the documentation:
categories Optional. The types of information that should be written to the database.
So when I removed categories from my ido-pgsql.conf configuration. I restart Icinga2 then the data are written in the DB as expected. Comments, Downtimes, well everything I wanted is listed the UI now.
I also removed the cleanup section as it is probably not what I want too.
The final ido-pgsql.conf configuration:
library "db_ido_pgsql"
object IdoPgsqlConnection "ido-pgsql" {
user = "icinga"
password = "icinga"
host = "localhost"
database = "icinga"
table_prefix = "icinga_"
instance_name = "icinga2"
instance_description = "icinga2 instance"
}
Related
I want to setup a headless chrome driver for UI Test Automation in jenkins.
But to run the test command
sudo -E java -jar karate-0.9.3.jar karate_GUI.feature
I have to run as root and it requires --no-sandbox, which, if I'm not wrong, it's still not supported in v0.9.3.
If possible, how can I include --no-sandbox option?
I checked https://intuit.github.io/karate/karate-core/ and there is no --no-sandbox option.
My feature configuration:
Feature: message end-point
Background:
* configure driver = { type: 'chrome', executable: '/usr/bin/google-chrome', headless: true }
# Login Url
* def browserManagementUrl = 'http://localhost:8000/login/'
Scenario: GUI Testing for Login page
Given driver browserManagementUrl
And eval driver.input('input[name=name]', 'admin')
And eval driver.input('input[name=password]', 'adminadmin')
And driver.submit('#login-button')
When driver.submit('#login-button')
Then match driver.location == 'http://localhost:8000/select/'
The linux command and it's results
sudo -E java -jar karate-0.9.3.jar karate_GUI.feature
07:15:56.296 [main] INFO com.intuit.karate.Main - Karate version: 0.9.3
07:15:57.345 [ForkJoinPool-1-worker-1] WARN com.intuit.karate - skipping bootstrap configuration: could not find or read file: classpath:karate-config.js
07:15:57.418 [chrome_1560323757416] DEBUG c.i.k.driver.chrome_1560323757416 - command: [/usr/bin/google-chrome, --remote-debugging-port=9222, --no-first-run, --user-data-dir=/var/jenkins_home/workspace/my-karate_GUI#2/integrations/target/chrome_1560323757416, --disable-popup-blocking, --headless]
07:15:57.419 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - poll attempt #0 for port to be ready - localhost:9222
07:15:57.420 [chrome_1560323757416] DEBUG c.i.k.driver.chrome_1560323757416 - env PATH: /sbin:/bin:/usr/sbin:/usr/bin
07:15:57.423 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - sleeping for millis: 250
07:15:57.674 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - poll attempt #1 for port to be ready - localhost:9222
07:15:57.675 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - sleeping for millis: 250
07:15:57.793 [chrome_1560323757416] DEBUG c.i.k.driver.chrome_1560323757416 - [0612/071557.791933:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
07:15:57.810 [chrome_1560323757416] DEBUG c.intuit.karate.shell.CommandThread - command complete, exit code: 1 - [/usr/bin/google-chrome, --remote-debugging-port=9222, --no-first-run, --user-data-dir=/var/jenkins_home/workspace/my-karate_GUI#2/integrations/target/chrome_1560323757416, --disable-popup-blocking, --headless]
07:15:57.926 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - poll attempt #2 for port to be ready - localhost:9222
07:15:57.927 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - sleeping for millis: 250
07:15:58.178 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - poll attempt #3 for port to be ready - localhost:9222
[...]
07:16:02.206 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - poll attempt #19 for port to be ready - localhost:9222
07:16:02.207 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - sleeping for millis: 250
07:16:02.848 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1560323757416 - request:
1 > GET http://localhost:9222/json
1 > Accept-Encoding: gzip,deflate
1 > Connection: Keep-Alive
1 > Host: localhost:9222
1 > User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_212)
07:16:02.862 [ForkJoinPool-1-worker-1] ERROR c.i.k.driver.chrome_1560323757416 - org.apache.http.conn.HttpHostConnectException: Connect to localhost:9222 [localhost/127.0.0.1] failed: Connection refused (Connection refused), http call failed after 13 milliseconds for URL: http://localhost:9222/json
07:16:02.863 [ForkJoinPool-1-worker-1] ERROR c.i.k.driver.chrome_1560323757416 - http request failed:
org.apache.http.conn.HttpHostConnectException: Connect to localhost:9222 [localhost/127.0.0.1] failed: Connection refused (Connection refused)
07:16:02.918 [pool-1-thread-1] INFO com.intuit.karate.Runner - <<fail>> feature 1 of 1: karate_GUI.feature
---------------------------------------------------------
feature: karate_GUI.feature
report: target/karate_GUI.json
scenarios: 1 | passed: 0 | failed: 1 | time: 5.4993
---------------------------------------------------------
Karate version: 0.9.3
======================================================
elapsed: 6.39 | threads: 1 | thread time: 5.50
features: 1 | ignored: 0 | efficiency: 0.86
scenarios: 1 | passed: 0 | failed: 1
======================================================
failed features:
karate_GUI: karate_GUI.feature:8 -
org.apache.http.conn.HttpHostConnectException: Connect to localhost:9222 [localhost/127.0.0.1] failed: Connection refused (Connection refused)
Exception in thread "main" picocli.CommandLine$ExecutionException: there are test failures
at com.intuit.karate.Main$1.handleExecutionException(Main.java:133)
at picocli.CommandLine.parseWithHandlers(CommandLine.java:1157)
at com.intuit.karate.Main.main(Main.java:139)
I guess you do know that the UI automation pieces are still experimental and yes I don't think we support --no-sandbox - feel free to open a ticket and help us with some links to why this is needed, what it does etc.
A suggested workaround is you can pass a batch file as the executable key to the configure driver call. In this batch file you can then call the chromedriver executable with whatever custom parameters or arguments you need.
Do let us know if that works. It also sounds to me that a way to pass any custom flags is a needed feature, do add this to your feature request.
EDIT: for those landing here in future, I'm not 100% sure, but maybe the info here will help: https://github.com/intuit/karate/issues/1134#issuecomment-638990087
I am dealing with the project deposition made on FastAPI to a remote ubuntu server. I'll try to run the project from terminal (using SSH connection) by the command
gunicorn -k uvicorn.workers.UvicornWorker main:app
The output is
gunicorn -k uvicorn.workers.UvicornWorker main:app
[2020-07-14 15:24:28 +0000] [23102] [INFO] Starting gunicorn 20.0.4
[2020-07-14 15:24:28 +0000] [23102] [INFO] Listening at: http://127.0.0.1:8000 (23102)
[2020-07-14 15:24:28 +0000] [23102] [INFO] Using worker: uvicorn.workers.UvicornWorker
[2020-07-14 15:24:28 +0000] [23104] [INFO] Booting worker with pid: 23104
[2020-07-14 15:24:28 +0000] [23104] [INFO] Started server process [23104]
[2020-07-14 15:24:28 +0000] [23104] [INFO] Waiting for application startup.
[2020-07-14 15:24:28 +0000] [23104] [INFO] Application startup complete.
But I need the project to be available at the IP address of the server. If I try smth like
uvicorn main:app --host 66.226.247.55 --port 8000
I get
INFO: Started server process [23308]
INFO: Waiting for application startup.
INFO: Connected to database postgresql://recognition:********#localhost:5432/reco
INFO: Application startup complete.
ERROR: [Errno 99] error while attempting to bind on address ('66.226.247.55', 8000): cannot assign requested address
INFO: Waiting for application shutdown.
INFO: Disconnected from database postgresql://recognition:********#localhost:5432/reco
INFO: Application shutdown complete.
Where 66.226.247.55 - external IP adress from google cloud platform instances
How do I start a project so that it can be accessed via IP?
The --host should be the local address of your GCP server.
uvicorn main:app --host 0.0.0.0 --port 8000
and now access the application by http://66.226.247.55:8000
Note: You should open your 8000 port of GCP server.
If you're using nginx server
create a file in /etc/nginx/sites-enabled/
create file touch fastapi_nginx
copy code into file and adjust accordingly
server{
listen 80;
server_name "your public ip";
location / {
proxy_pass http://127.0.0.1:8000; #localhost
}
}
This should reroute to your public ip
You cannot launch your fast api app on your local to your remote server in GCP.
You must deploy your app to GCP. In other words you need to run that command on a remote server not your localhost.
In Azure cloud, I have the following infrastructure:
A Vnet with two subnets in.
Vnet: 10.0.0.0/8
aks-subnet: 10.240.0.0/16
persistence-subnet: 10.241.0.0/27
An Azure Kubernetes cluster was installed and associated to the aks-subnet.
In the persistence-subnet a managed Azure Database for MySQL paas, is deployed and associated to it.
The persistence-subnet has two service endpoints: Microsoft.Sql and Microsoft.Storage
The aks-subnet has the Microsoft.Sql service endpoint
The Azure Kubernetes cluster was deployed using the Azure CNI network profile so, every pod get an ip address belonging to the aks-subnet. Also I decided to choose Azure CNI,because I need to to communicate the pods inside aks-subnet with the MySQL managed service.
In the managed Azure Database for MySQL paas service I have whitelisted the aks-subnet ip address range, in order to allow to the pods inside aks-subnet access to the MySQL service.
"StartIpAddress": "10.240.0.0",
"EndIpAddress": "10.240.255.255"
In the AKS cluster, I am using helm3 to deploy the Wordpress helm chart, with this command
helm3 install wordpress-site-1 stable/wordpress --set image.registry=myregistry.azurecr.io,image.repository=wordpress,image.tag=5.2.4,image.pullPolicy=Always,wordpressUsername=site1,wordpressPassword=my-password,wordpressEmail=my#gmail.com,mariadb.enabled=false,externalDatabase.host=database-db.mysql.database.azure.com,externalDatabase.user=user#wdatabase-db,externalDatabase.password=my-password,externalDatabase.database=wordpress-site-1,externalDatabase.port=3306
NAME: wordpress-site-1
LAST DEPLOYED: Tue Oct 29 13:24:03 2019
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
1. Get the WordPress URL:
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
Watch the status with: 'kubectl get svc --namespace default -w wordpress-site-1'
export SERVICE_IP=$(kubectl get svc --namespace default wordpress-site-1 --template "{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}")
echo "WordPress URL: http://$SERVICE_IP/"
echo "WordPress Admin URL: http://$SERVICE_IP/admin"
2. Login with the following credentials to see your blog
echo Username: site1
echo Password: $(kubectl get secret --namespace default wordpress-site-1 -o jsonpath="{.data.wordpress-password}" | base64 --decode)
The deployment is running, but when I check the wordpress pod logs, I got this error message:
MySQL Connection Error: (2002) php_network_getaddresses: getaddrinfo failed: Name or service not known
[29-Oct-2019 13:01:13 UTC] PHP Warning: mysqli::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known in Standard input code on line 22
[29-Oct-2019 13:01:13 UTC] PHP Warning: mysqli::__construct(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known in Standard input code on line 22
MySQL Connection Error: (2002) php_network_getaddresses: getaddrinfo failed: Name or service not known
WARNING: unable to establish a database connection to 'mysql'
continuing anyways (which might have unexpected results)
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.240.0.36. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.240.0.36. Set the 'ServerName' directive globally to suppress this message
[Tue Oct 29 13:01:14.027023 2019] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.3.11 configured -- resuming normal operations
[Tue Oct 29 13:01:14.027099 2019] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
10.240.0.4 - - [29/Oct/2019:13:01:22 +0000] "GET /wp-login.php HTTP/1.1" 500 3003 "-" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:13:01:32 +0000] "GET /wp-login.php HTTP/1.1" 500 3003 "-" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:13:01:42 +0000] "GET /wp-login.php HTTP/1.1" 500 3003 "-" "kube-probe/1.14"
Looks like the wordpress pod, located inside aks-subnet is not able to reach the MySQL service, located in the persistence-subnet, despite I am providing it via helm install command the correct parameters.
It's weird, the pods has access to Internet, and also I have been checking of a careful way the rules and permissions to allow that communication.
Is there something that I am unknowing?
How can I reach the MySQL database from the Wordpress service deployed inside the Aks cluster?
UPDATE:
Before to deploy Wordpress with helm install command, I've created the docker registry secret pointing to Azure Container Registry data, of a manual way:
kubectl create secret docker-registry regcred --docker-server=my-registry.azurecr.io --docker-username=my-username --docker-password=my-password --docker-email=my-email#outlook.com
I referenced that regcred in my local helm chart in the deployment.yaml and I deployed Wordpress using the helm install command and looks like it works, or at least MySQL is not causing problems.
Just the ServerName Apache directive, because I don't have any hostname yet involved in my deploymnet process, not yet.
⟩ kubectl logs pod/wordpress-site-1-7f44b567d6-2949w -f
WordPress not found in /var/www/html - copying now...
Complete! WordPress has been successfully copied to /var/www/html
### APACHE SERVERNAME WARNING
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.240.0.103. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.240.0.103. Set the 'ServerName' directive globally to suppress this message
#####
[Tue Oct 29 16:13:16.327549 2019] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.3.11 configured -- resuming normal operations
[Tue Oct 29 16:13:16.327630 2019] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
10.240.0.4 - - [29/Oct/2019:16:13:18 +0000] "GET / HTTP/1.1" 302 255 "-" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:16:13:18 +0000] "GET /wp-admin/setup-config.php HTTP/1.1" 200 4289 "http://10.240.0.103:80/" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:16:13:28 +0000] "GET / HTTP/1.1" 302 255 "-" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:16:13:28 +0000] "GET /wp-admin/setup-config.php HTTP/1.1" 200 4289 "http://10.240.0.103:80/" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:16:13:38 +0000] "GET / HTTP/1.1" 302 255 "-" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:16:13:40 +0000] "GET / HTTP/1.1" 302 255 "-" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:16:13:40 +0000] "GET /wp-admin/setup-config.php HTTP/1.1" 200 4289 "http://10.240.0.103:80/" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:16:13:38 +0000] "GET /wp-admin/setup-config.php HTTP/1.1" 200 4289 "http://10.240.0.103:80/" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:16:13:48 +0000] "GET / HTTP/1.1" 302 255 "-" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:16:13:50 +0000] "GET / HTTP/1.1" 302 255 "-" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:16:13:50 +0000] "GET /wp-admin/setup-config.php HTTP/1.1" 200 4289 "http://10.240.0.103:80/" "kube-probe/1.14"
I understand that at this point nothing should happens with the database because we need to access to the Wordpress site via web and deploy the site, so is at that moment when the database tables will be created right?
So I did a port-forward operation from kubernetes:
⟩ kubectl port-forward pod/wordpress-site-1-7f44b567d6-2949w 8002:80
Forwarding from 127.0.0.1:8002 -> 80
Forwarding from [::1]:8002 -> 80
Handling connection for 8002
Handling connection for 8002
Handling connection for 8002
Handling connection for 8002
Handling connection for 8002
And when I go to http://localhost:8002/, the browser redirect to me to
http://localhost:8002/wp-admin/setup-config.php and I can see the wordpress wizard.
So I fill the data with my db name previously created in the database server
And when I submit the data in the wizard UI I got the following:
The message reference problems with the data connection
This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at wordpresssentiaassessment-db.mysql.database.azure.com. This could mean your host’s database server is down.
Are you sure you have the correct username and password?
Are you sure that you have typed the correct hostname?
Are you sure that the database server is running?
But maybe because from port-forward operation we cannot contact to the database from my local machine?
I mean, the process is not in able to do a reverse port forward to contact the database?
Do I need to expose the Wordpress service application to some domain and Ip public address in order to contact to the db and install Wordpresss?
So, I enter to the pod wordpress container to check wp-config.php
⟩ kubectl exec -it pod/wordpress-site-1-7f44b567d6-2949w /bin/sh
But the wp-config.php file does not exist,
# ls
index.php wp-activate.php wp-comments-post.php wp-cron.php wp-load.php wp-settings.php xmlrpc.php
license.txt wp-admin wp-config-sample.php wp-includes wp-login.php wp-signup.php
readme.html wp-blog-header.php wp-content wp-links-opml.php wp-mail.php wp-trackback.php
# cat wp-config.php
cat: wp-config.php: No such file or directory
I have a wp-config-sample.php and this is their content, but I cannot see anything about FQDN.
Or maybe do I need to do something in the wp-config.php, maybe rename the wp-config-sample.php to wp-config.php and add the variables injected in the pod in that file?
# nano wp-config-sample.php
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the
* installation. You don't have to use the web site, you can
* copy this file to "wp-config.php" and fill in the values.
*
* This file contains the following configurations:
*
* * MySQL settings
* * Secret keys
* * Database table prefix
* * ABSPATH
*
* #link https://codex.wordpress.org/Editing_wp-config.php
*
* #package WordPress
*/
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'database_name_here' );
/** MySQL database username */
define( 'DB_USER', 'username_here' );
/** MySQL database password */
define( 'DB_PASSWORD', 'password_here' );
/** MySQL hostname */
define( 'DB_HOST', 'localhost' );
/** Database Charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );
/** The Database Collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );
/**##+
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {#link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* #since 2.6.0
*/
define( 'AUTH_KEY', 'put your unique phrase here' );
define( 'SECURE_AUTH_KEY', 'put your unique phrase here' );
define( 'LOGGED_IN_KEY', 'put your unique phrase here' );
define( 'NONCE_KEY', 'put your unique phrase here' );
define( 'AUTH_SALT', 'put your unique phrase here' );
define( 'SECURE_AUTH_SALT', 'put your unique phrase here' );
define( 'LOGGED_IN_SALT', 'put your unique phrase here' );
define( 'NONCE_SALT', 'put your unique phrase here' );
/**##-*/
/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the Codex.
*
* #link https://codex.wordpress.org/Debugging_in_WordPress
*/
define( 'WP_DEBUG', false );
/* That's all, stop editing! Happy publishing. */
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', dirname( __FILE__ ) . '/' );
}
/** Sets up WordPress vars and included files. */
require_once( ABSPATH . 'wp-settings.php' );
It looks as though the application is trying to perform a reverse lookup of the IP address you have specified, probably because it intends on using SSL to authenticate the remote server. PTR records to assist in reverse lookup will not be available with a standard configuration for an internal IP address.
Try using the FQDN for your MySQL instance instead of the IP address.
It should look something like this:
{yourservername}.mysql.database.azure.com
This way your application will not need to perform reverse lookup, and Azure will cater for the routing appropriately.
EDIT:
The following line indicated your application is trying to connect to host 'mysql':
WARNING: unable to establish a database connection to 'mysql'
Check the FQDN has populated properly in wp-config.php
I have a springboot application that is connected to a mysql database. I want to use the .gitlab-ci.yml to handle the pipeline. I created the following config file.
before_script:
- echo "Execute scripts which are required to bootstrap the application. !"
after_script:
- echo "Clean up activity can be done here !."
services:
- mysql
stages:
- build
- connect
- test
- package
- deploy
variables:
MAVEN_CLI_OPTS: "--batch-mode"
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
MYSQL_DATABASE_NAME: gyyconsortiumdb
MYSQL_DATABASE_SCHEMA: "$CI_PROJECT_DIR/src/main/resources/static/sql/gyyconsortiumdb.sql"
MYSQL_ROOT_PASSWORD: mysql
cache:
paths:
- .m2/repository/
- target/
build:
stage: build
image: maven:latest
script:
- mvn $MAVEN_CLI_OPTS clean compile
connect:
stage: connect
image: mysql
before_script:
- mysql --version
script:
- echo "create database $MYSQL_DATABASE_NAME;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql
- mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql $MYSQL_DATABASE_NAME < $MYSQL_DATABASE_SCHEMA
- mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql -e "show databases; use $MYSQL_DATABASE_NAME; show tables;"
test:
stage: test
image: maven:latest
script:
- mvn $MAVEN_CLI_OPTS test
package:
stage: package
image: maven:latest
script:
- mvn $MAVEN_CLI_OPTS package
artifacts:
paths: [target/basecamp-0.0.1.war]
deploy_test:
stage: deploy
script:
- echo "######## To be defined ########"
environment: staging
deploy_prod:
stage: deploy
script:
- echo "######## To be defined ########"
only:
- master
environment: production
When the first job is running, it is pulling the mysql image from docker hub, and I don't know why? I thought the mysql should be built only on the connect job.
Also, after the connect job is success, the test job pull the mysql image again. And my test job doesn't recognize my database however the service was create successfully and I was able to see the database also created.
Build job console output:
Running with gitlab-runner 10.3.0 (5cf5e19a)
on docker-auto-scale (fa6cab46)
Using Docker executor with image maven:latest ...
Starting service mysql:latest ...
Pulling docker image mysql:latest ...
Using docker image mysql:latest ID=sha256:7d83a47ab2d2d0f803aa230fdac1c4e53d251bfafe9b7265a3777bcc95163755 for mysql service...
Waiting for services to be up and running...
Using docker image sha256:d6e999707ab00f954f4ab77c8ced4efce186099fb8318e1a0bc2f4fd8bb7bf6b for predefined container...
Pulling docker image maven:latest ...
Using docker image maven:latest ID=sha256:1f858e89a5843b0804a9e1498476a135f45e23a42fe673914f977e0882a6789e for build container...
Running on runner-fa6cab46-project-4899225-concurrent-0 via runner-fa6cab46-srm-1514081729-3d654341...
Cloning repository...
Cloning into '/builds/user/xxx'...
Checking out b9efb2da as 24-create-the-gitlab-ci-yml-file...
Skipping Git submodules setup
Checking cache for default...
Downloading cache.zip from http://runners-cache-3-internal.gitlab.com:444/runner/project/4899225/default
Successfully extracted cache
$ echo "Execute scripts which are required to bootstrap the application. !"
Execute scripts which are required to bootstrap the application. !
$ mvn $MAVEN_CLI_OPTS clean compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building xxx 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) # xxx ---
[INFO] Deleting /builds/user/xxx/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # xxx ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] Copying 108 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # xxx ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 35 source files to /builds/user/xxx/target/classes
[WARNING] /builds/user/xxx/src/main/java/com//www/xxx/domain/Project.java: Some input files use unchecked or unsafe operations.
[WARNING] /builds/user/xxx/src/main/java/com/xxx/www/xxx/domain/Project.java: Recompile with -Xlint:unchecked for details.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.111 s
[INFO] Finished at: 2017-12-24T02:18:07Z
[INFO] Final Memory: 30M/71M
[INFO] ------------------------------------------------------------------------
Running after script...
$ echo "Clean up activity can be done here !."
Clean up activity can be done here !.
Creating cache default...
.m2/repository/: found 1775 matching files
target/: found 197 matching files
Uploading cache.zip to http://runners-cache-3-
internal.gitlab.com:444/runner/project/4899225/default
Created cache
Job succeeded
Connect job console output
Running with gitlab-runner 10.3.0 (5cf5e19a)
on docker-auto-scale (e11ae361)
Using Docker executor with image mysql ...
Starting service mysql:latest ...
Pulling docker image mysql:latest ...
Using docker image mysql:latest ID=sha256:7d83a47ab2d2d0f803aa230fdac1c4e53d251bfafe9b7265a3777bcc95163755 for mysql service...
Waiting for services to be up and running...
Using docker image sha256:295a9e80fe6ae475bfeef8e318eb11db267d317fa6bc1ed8d72185dfd2adb8b7 for predefined container...
Pulling docker image mysql ...
Using docker image mysql ID=sha256:7d83a47ab2d2d0f803aa230fdac1c4e53d251bfafe9b7265a3777bcc95163755 for build container...
Running on runner-e11ae361-project-4899225-concurrent-0 via runner-e11ae361-srm-1514081811-5092ac06...
Cloning repository...
Cloning into '/builds/yimengael/basecamp'...
Checking out b9efb2da as 24-create-the-gitlab-ci-yml-file...
Skipping Git submodules setup
Checking cache for default...
Downloading cache.zip from http://runners-cache-5-internal.gitlab.com:444/runner/project/4899225/default
Successfully extracted cache
$ mysql --version
mysql Ver 14.14 Distrib 5.7.20, for Linux (x86_64) using EditLine wrapper
$ echo "create database $MYSQL_DATABASE_NAME;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql
mysql: [Warning] Using a password on the command line interface can be insecure.
$ mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql $MYSQL_DATABASE_NAME < $MYSQL_DATABASE_SCHEMA
mysql: [Warning] Using a password on the command line interface can be insecure.
$ mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql -e "show databases; use $MYSQL_DATABASE_NAME; show tables;"
mysql: [Warning] Using a password on the command line interface can be insecure.
Database
information_schema
mydb
mysql
performance_schema
sys
Tables_in_mydb
message
persistent_logins
project
project_description
role
user
user_role
Running after script...
$ echo "Clean up activity can be done here !."
Clean up activity can be done here !.
Creating cache default...
.m2/repository/: found 1775 matching files
target/: found 197 matching files
Archive is up to date!
Created cache
Job succeeded
Test job failed :
2017-12-24 02:21:43.827 INFO 62 --- [ main] c.g.w.b.xxxWebApplicationTests : Starting xxxWebApplicationTests on runner-4e4528ca-project-4899225-concurrent-0 with PID 62 (started by root in /builds/yimengael/xxx)
2017-12-24 02:21:43.829 DEBUG 62 --- [ main] c.g.w.b.xxxWebApplicationTests : Running with Spring Boot v1.5.8.RELEASE, Spring v4.3.12.RELEASE
2017-12-24 02:21:43.829 INFO 62 --- [ main] c.g.w.b.xxxWebApplicationTests : The following profiles are active: dev
2017-12-24 02:21:45.101 INFO 62 --- [ main] o.s.w.c.s.GenericWebApplicationContext : Refreshing org.springframework.web.context.support.GenericWebApplicationContext#62e20a76: startup date [Sun Dec 24 02:21:45 UTC 2017]; root of context hierarchy
2017-12-24 02:21:49.515 INFO 62 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2017-12-24 02:21:51.533 WARN 62 --- [ main] o.a.tomcat.jdbc.pool.ConnectionPool : maxIdle is larger than maxActive, setting maxIdle to: 50
2017-12-24 02:21:52.448 ERROR 62 --- [ main] o.a.tomcat.jdbc.pool.ConnectionPool : Unable to create initial connections of pool.
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'mydb'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
.....
2017-12-24 02:21:52.477 WARN 62 --- [ main] o.s.b.a.orm.jpa.DatabaseLookup : Unable to determine jdbc url from datasource
org.springframework.jdbc.support.MetaDataAccessException: Could not get Connection for extracting meta data; nested exception is
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'mydb'
at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:339)
at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:366)
at org.springframework.boot.autoconfigure.orm.jpa.DatabaseLookup.getDatabase(DatabaseLookup.java:72)
at org.springframework.boot.autoconfigure.orm.jpa.JpaProperties.determineDatabase(JpaProperties.java:139)
Could you please tell me why the test job does not pick up the mysql service the right way ?
Best,
G
When the first job is running, it is pulling the mysql image from
docker hub, and I don't know why?
Because you defined Mysql as a service. GitLab CI uses the services keyword to define what docker containers should be linked with your base image. So, it will be run for every stages.
Could you please tell me why the test job does not pick up the mysql
service the right way ?
Your database name in your gitlab config file is 'gyyconsortiumdb' which is different from what you defined in your spring config file as log shows you are trying to connect to 'mydb'
jdbc4.MySQLSyntaxErrorException: Unknown database 'mydb'
follow the link for more info
https://docs.gitlab.com/ce/ci/services/mysql.html
I've been using docker to build wordpress apps for some days. I got some working but now I don't know why I can get to connect the database container and the wordpress container.
I've reduced the failing condiguration to the simplest possible.
Right now I have the following docker-compose.yml file:
wordpress:
image: wordpress
links:
- db:mysql
ports:
- 8080:80
db:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: example
which is an exact copy of this official example:
https://hub.docker.com/_/wordpress/
(scroll down to "... via docker-compose").
If I do composer up with this file I got the following relevant log entries:
Creating miqueladell_db_1
Creating miqueladell_wordpress_1
Attaching to miqueladell_db_1, miqueladell_wordpress_1
db_1 | Initializing database
…lots of initialization…
wordpress_1 | Warning: mysqli::mysqli(): (HY000/2002): Connection refused in - on line 10
…this goes on for a while, db_1 says it's initializing and wordpress_1 says it can connect
and then…
db_1 | MySQL init process done. Ready for start up.
…some more database messages…
db_1 | 2016-01-12 14:34:46 139698309449664 [Note] mysqld: ready for connections.
wordpress_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.5. Set the 'ServerName' directive globally to suppress this message
wordpress_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.5. Set the 'ServerName' directive globally to suppress this message
wordpress_1 | [Tue Jan 12 14:34:47.180996 2016] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.10 (Debian) PHP/5.6.17 configured -- resuming normal operations
wordpress_1 | [Tue Jan 12 14:34:47.181253 2016] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
…at that momment if I browse to the wordpress endpoint I got…
wordpress_1 | 192.168.99.1 - - [12/Jan/2016:14:34:47 +0000] "GET / HTTP/1.1" 500 586 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36"
And an Error establishing a database connection on the front end.
I've pasted the full log here in case someone want's to take a look: http://pastebin.com/Z9U2iMsH
I've got my environment running before and I am sure that if not this particular example I have been able to run the containers and connect to the database with some of the examples I tried (without luck) today so I guess there is something wrong with my environment but I don't know how to debug it.
I've removed all containers, all images, re-donwloaded the images and rebuilt de containers. Even tested everyithing on a enpty folder with a newly created docker-compose.yml file.
In fact as reading the logs it seemed that maybe the wordpress process was exhausting its tries I have even restarted the wordpress container while the database container was already up and the result is the same.
Just in case it's relevant I'm running all of this locally on a mac using the docker quickstart terminal as descrived here:
https://docs.docker.com/mac/step_one/
and docker -v says:
Docker version 1.9.1, build a34a1d5
EDIT: Just tried using:
image: wordpress:4.4
instead of "no tag" which downloads latest (4.4.1 at the time of writing) and it works. So it seems that is a bug introduced on 4.4.1
I've oppened one here
https://github.com/docker-library/wordpress/issues/120
I'll keep the question open just in case but it seems quite clear that is a bug
It was a bug on the version 4.4.1 of the wordpress container.
I've oppened an issue here https://github.com/docker-library/wordpress/issues/120 and it's solved now.
Thanks all!