Skip to content
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

access forbidden by rule #43

Open
clayrisser opened this issue Dec 14, 2020 · 1 comment
Open

access forbidden by rule #43

clayrisser opened this issue Dec 14, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@clayrisser
Copy link

clayrisser commented Dec 14, 2020

The WordPress pod crashes because the readiness probe fails to ping the nginx server. I get the following error.

Sun, Dec 13 2020 9:11:07 pm | 2020/12/14 03:11:07 [error] 52#52: *93 access forbidden by rule, client: 178.128.11.1, server: tmp-wordpress-wordpress-5f75494c76-gcx65, request: "GET /-/php-ping HTTP/1.1", host: "10.42.1.159:8080"
Sun, Dec 13 2020 9:11:12 pm | 2020/12/14 03:11:12 [error] 52#52: *136 access forbidden by rule, client: 178.128.11.1, server: tmp-wordpress-wordpress-5f75494c76-gcx65, request: "GET /-/php-ping HTTP/1.1", host: "10.42.1.159:8080"
Sun, Dec 13 2020 9:11:17 pm | 2020/12/14 03:11:17 [error] 52#52: *179 access forbidden by rule, client: 178.128.11.1, server: tmp-wordpress-wordpress-5f75494c76-gcx65, request: "GET /-/php-ping HTTP/1.1", host: "10.42.1.159:8080"

Expect

WordPress to run without crashing.

Reproduce

Create WordPress CRD on kubernetes using wordpress operator.

Below is the full log.

time="2020-12-14T03:10:55Z" level=info msg="create process:php-fpm"
--
Sun, Dec 13 2020 9:10:55 pm | time="2020-12-14T03:10:55Z" level=info msg="create process:nginx"
Sun, Dec 13 2020 9:10:55 pm | time="2020-12-14T03:10:55Z" level=info msg="stop listening"
Sun, Dec 13 2020 9:10:55 pm | time="2020-12-14T03:10:55Z" level=info msg="try to start program" program=php-fpm
Sun, Dec 13 2020 9:10:55 pm | time="2020-12-14T03:10:55Z" level=info msg="try to start program" program=nginx
Sun, Dec 13 2020 9:10:55 pm | time="2020-12-14T03:10:55Z" level=info msg="success to listen on address" addr="127.0.0.1:9001" protocol=tcp
Sun, Dec 13 2020 9:10:55 pm | time="2020-12-14T03:10:55Z" level=debug msg="wait program exit" program=php-fpm
Sun, Dec 13 2020 9:10:55 pm | time="2020-12-14T03:10:55Z" level=debug msg="wait program exit" program=nginx
Sun, Dec 13 2020 9:10:55 pm | [start-nginx] Initiated start-nginx.sh script.
Sun, Dec 13 2020 9:10:55 pm | 2020/12/14 03:10:55 Waiting for: unix:///var/run/php-www.sock
Sun, Dec 13 2020 9:10:55 pm | 2020/12/14 03:10:55 Problem with dial: dial unix /var/run/php-www.sock: connect: no such file or directory. Sleeping 1s
Sun, Dec 13 2020 9:10:55 pm | [14-Dec-2020 03:10:55] NOTICE: fpm is running, pid 29
Sun, Dec 13 2020 9:10:55 pm | [14-Dec-2020 03:10:55] NOTICE: ready to handle connections
Sun, Dec 13 2020 9:10:56 pm | time="2020-12-14T03:10:56Z" level=info msg="success to start program" program=php-fpm
Sun, Dec 13 2020 9:10:56 pm | time="2020-12-14T03:10:56Z" level=info msg="success to start program" program=nginx
Sun, Dec 13 2020 9:10:56 pm | 2020/12/14 03:10:56 Connected to unix:///var/run/php-www.sock
Sun, Dec 13 2020 9:10:56 pm | 2020/12/14 03:10:56 [notice] 48#48: using the "epoll" event method
Sun, Dec 13 2020 9:10:56 pm | 2020/12/14 03:10:56 [notice] 48#48: openresty/1.13.6.2
Sun, Dec 13 2020 9:10:56 pm | 2020/12/14 03:10:56 [notice] 48#48: OS: Linux 5.4.0-51-generic
Sun, Dec 13 2020 9:10:56 pm | 2020/12/14 03:10:56 [notice] 48#48: getrlimit(RLIMIT_NOFILE): 1048576:1048576
Sun, Dec 13 2020 9:10:56 pm | 2020/12/14 03:10:56 [notice] 48#48: start worker processes
Sun, Dec 13 2020 9:10:56 pm | 2020/12/14 03:10:56 [notice] 48#48: start worker process 49
Sun, Dec 13 2020 9:10:56 pm | 2020/12/14 03:10:56 [notice] 48#48: start worker process 50
Sun, Dec 13 2020 9:10:56 pm | 2020/12/14 03:10:56 [notice] 48#48: start worker process 51
Sun, Dec 13 2020 9:10:56 pm | 2020/12/14 03:10:56 [notice] 48#48: start worker process 52
Sun, Dec 13 2020 9:11:07 pm | 2020/12/14 03:11:07 [error] 52#52: *93 access forbidden by rule, client: 178.128.11.1, server: tmp-wordpress-wordpress-5f75494c76-gcx65, request: "GET /-/php-ping HTTP/1.1", host: "10.42.1.159:8080"
Sun, Dec 13 2020 9:11:12 pm | 2020/12/14 03:11:12 [error] 52#52: *136 access forbidden by rule, client: 178.128.11.1, server: tmp-wordpress-wordpress-5f75494c76-gcx65, request: "GET /-/php-ping HTTP/1.1", host: "10.42.1.159:8080"
Sun, Dec 13 2020 9:11:17 pm | 2020/12/14 03:11:17 [error] 52#52: *179 access forbidden by rule, client: 178.128.11.1, server: tmp-wordpress-wordpress-5f75494c76-gcx65, request: "GET /-/php-ping HTTP/1.1", host: "10.42.1.159:8080"
Sun, Dec 13 2020 9:11:18 pm | [14-Dec-2020 03:11:18] NOTICE: [pool www-async] child 44 exited with code 0 after 22.602159 seconds from start
Sun, Dec 13 2020 9:11:18 pm | time="2020-12-14T03:11:18Z" level=info msg="receive a signal to stop all process & exit" signal=terminated
Sun, Dec 13 2020 9:11:18 pm | time="2020-12-14T03:11:18Z" level=info msg="stop the program" program=nginx
Sun, Dec 13 2020 9:11:18 pm | time="2020-12-14T03:11:18Z" level=info msg="send stop signal to program" program=nginx signal=QUIT
Sun, Dec 13 2020 9:11:18 pm | time="2020-12-14T03:11:18Z" level=info msg="stop the program" program=php-fpm
Sun, Dec 13 2020 9:11:18 pm | [start-nginx] Stopping nginx.
Sun, Dec 13 2020 9:11:18 pm | [start-nginx] Killing subprocesses of process 28.
Sun, Dec 13 2020 9:11:18 pm | time="2020-12-14T03:11:18Z" level=info msg="send stop signal to program" program=php-fpm signal=QUIT
Sun, Dec 13 2020 9:11:18 pm | [start-php-fpm] Waiting for nginx to stop.
Sun, Dec 13 2020 9:11:18 pm | [14-Dec-2020 03:11:18] NOTICE: [pool www-async] child 59 started
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 48#48: signal 3 (SIGQUIT) received from 62, shutting down
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 52#52: gracefully shutting down
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 51#51: gracefully shutting down
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 51#51: exiting
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 52#52: exiting
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 52#52: exit
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 51#51: exit
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 50#50: gracefully shutting down
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 50#50: exiting
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 48#48: signal 17 (SIGCHLD) received from 52
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 48#48: worker process 52 exited with code 0
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 48#48: signal 29 (SIGIO) received
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 50#50: exit
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 48#48: signal 17 (SIGCHLD) received from 50
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 48#48: worker process 50 exited with code 0
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 48#48: signal 29 (SIGIO) received
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 48#48: signal 17 (SIGCHLD) received from 51
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 49#49: gracefully shutting down
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 48#48: worker process 51 exited with code 0
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 48#48: signal 29 (SIGIO) received
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 49#49: exiting
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 49#49: exit
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 48#48: signal 17 (SIGCHLD) received from 49
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 48#48: worker process 49 exited with code 0
Sun, Dec 13 2020 9:11:18 pm | 2020/12/14 03:11:18 [notice] 48#48: exit
Sun, Dec 13 2020 9:11:18 pm | [start-nginx] Stopped nginx.
Sun, Dec 13 2020 9:11:18 pm | [start-php-fpm] Stopping php-fpm.
Sun, Dec 13 2020 9:11:18 pm | [14-Dec-2020 03:11:18] NOTICE: Finishing ...
Sun, Dec 13 2020 9:11:18 pm | [14-Dec-2020 03:11:18] NOTICE: exiting, bye-bye!
Sun, Dec 13 2020 9:11:18 pm | time="2020-12-14T03:11:18Z" level=info msg="program stopped with status:exit status 0" program=nginx
Sun, Dec 13 2020 9:11:18 pm | time="2020-12-14T03:11:18Z" level=info msg="program exited" program=nginx
Sun, Dec 13 2020 9:11:18 pm | time="2020-12-14T03:11:18Z" level=info msg="Stopped by user, don't start it again" program=nginx
Sun, Dec 13 2020 9:11:18 pm | [start-php-fpm] Stopped php-fpm.
Sun, Dec 13 2020 9:11:18 pm | time="2020-12-14T03:11:18Z" level=info msg="program stopped with status:exit status 0" program=php-fpm
Sun, Dec 13 2020 9:11:18 pm | time="2020-12-14T03:11:18Z" level=info msg="program exited" program=php-fpm
Sun, Dec 13 2020 9:11:18 pm | time="2020-12-14T03:11:18Z" level=info msg="Stopped by user, don't start it again" program=php-fpm
@clayrisser clayrisser added the bug Something isn't working label Dec 14, 2020
@talss89
Copy link

talss89 commented Sep 6, 2022

We've experienced this issue too, and the quick answer is that this is a configuration issue with your K8s cluster.

Looking at your logs, the liveness probe URL is being accessed from your WAN interface on a node.

The access control rules for the liveness probe endpoint in this wordpress-runtime image reject access from outside the cluster private subnet of 10.0.0.0/8. You can override this CIDR by setting the STATS_WHITELIST_CIDR env variable (it appears). Here's where this gets applied to the nginx configuration:

{{- if (default "10.0.0.0/8" .Env.STATS_WHITELIST_CIDR) }}
allow {{ default "10.0.0.0/8" .Env.STATS_WHITELIST_CIDR }};
{{- end }}

We're waiting to hear back from our service provider (Linode / LKE) to see what can be done at their end. I'd suggest doing the same, or looking at your routing table on nodes.

Suggest this issue gets closed, as it's not a bug in bitpoke/stack-runtimes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants