Redis giving error in Guestbook example

4/13/2017

I have been running kubernetes e2e conformance test using a local cluster. When I running the guestbook test, I can see all the pods are running:

```

[root@localhost kubernetes]# cluster/kubectl.sh get pods --all-namespaces
NAMESPACE                 NAME                            READY     STATUS    RESTARTS   AGE
e2e-tests-kubectl-6z70j   frontend-1478469098-3hc82       1/1       Running   0          22s
e2e-tests-kubectl-6z70j   frontend-1478469098-673gg       1/1       Running   0          22s
e2e-tests-kubectl-6z70j   frontend-1478469098-hblqz       1/1       Running   0          22s
e2e-tests-kubectl-6z70j   redis-master-1101892589-vd4gm   1/1       Running   0          21s
e2e-tests-kubectl-6z70j   redis-slave-2881398718-58fq2    1/1       Running   0          21s
e2e-tests-kubectl-6z70j   redis-slave-2881398718-vqdvf    1/1       Running   0          21s
kube-system               kube-dns-3884805971-4sh48       3/3       Running   0          2h

```

But the test fails with the error:

```

Apr 13 04:08:29.608: INFO: Failed to get response from guestbook. err: <nil>, response: <br />
<b>Fatal error</b>:  Uncaught exception 'Predis\Response\ServerException' with message 'DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the loopback interface. If you want to connect from external computers to Redis you may adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent. 2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to 'no', and then restarting the server. 3) If you started the server manually just for testing, restart it with the '--protected-mode no' option. 4) Setup a bind address or an authen in <b>/usr/local/lib/php/Predis/Client.php</b> on line <b>370</b><br />

```

Now, I manually logged in to redis-slave container and did a wget on guestbook.php:

```

root@redis-slave-2881398718-vqdvf:/data# wget http://10.0.0.175:80/guestbook.php
converted 'http://10.0.0.175:80/guestbook.php' (ANSI_X3.4-1968) -> 'http://10.0.0.175:80/guestbook.php' (UTF-8)
--2017-04-13 09:08:41--  http://10.0.0.175/guestbook.php
Connecting to 10.0.0.175:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: 'guestbook.php'

guestbook.php                                     [ <=>                                                                                             ]  82.54K  --.-KB/s   in 0s     

2017-04-13 09:08:41 (224 MB/s) - 'guestbook.php' saved [84518]

```

Here are the env variables on redis-slave:

```

root@redis-slave-2881398718-vqdvf:/data# env
FRONTEND_PORT_80_TCP_ADDR=10.0.0.175
REDIS_SLAVE_PORT_6379_TCP=tcp://10.0.0.80:6379
REDIS_SLAVE_SERVICE_HOST=10.0.0.80
HOSTNAME=redis-slave-2881398718-vqdvf
REDIS_DOWNLOAD_URL=http://download.redis.io/releases/redis-3.2.0.tar.gz
KUBERNETES_PORT=tcp://10.0.0.1:443
KUBERNETES_PORT_443_TCP_PORT=443
TERM=xterm
FRONTEND_PORT_80_TCP_PORT=80
REDIS_SLAVE_PORT=tcp://10.0.0.80:6379
KUBERNETES_SERVICE_PORT=443
KUBERNETES_SERVICE_HOST=10.0.0.1
GET_HOSTS_FROM=dns
FRONTEND_PORT_80_TCP_PROTO=tcp
REDIS_MASTER_PORT_6379_TCP_ADDR=10.0.0.153
REDIS_MASTER_PORT_6379_TCP=tcp://10.0.0.153:6379
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
REDIS_SLAVE_PORT_6379_TCP_PROTO=tcp
REDIS_MASTER_SERVICE_PORT=6379
PWD=/data
REDIS_SLAVE_SERVICE_PORT=6379
FRONTEND_PORT=tcp://10.0.0.175:80
FRONTEND_SERVICE_PORT=80
REDIS_MASTER_SERVICE_HOST=10.0.0.153
SHLVL=1
HOME=/root
FRONTEND_SERVICE_HOST=10.0.0.175
REDIS_SLAVE_PORT_6379_TCP_ADDR=10.0.0.80
KUBERNETES_PORT_443_TCP_PROTO=tcp
REDIS_DOWNLOAD_SHA1=0c1820931094369c8cc19fc1be62f598bc5961ca
REDIS_VERSION=3.2.0
KUBERNETES_SERVICE_PORT_HTTPS=443
REDIS_MASTER_PORT_6379_TCP_PORT=6379
FRONTEND_PORT_80_TCP=tcp://10.0.0.175:80
REDIS_SLAVE_PORT_6379_TCP_PORT=6379
REDIS_MASTER_PORT_6379_TCP_PROTO=tcp
GOSU_VERSION=1.7
REDIS_MASTER_PORT=tcp://10.0.0.153:6379
KUBERNETES_PORT_443_TCP_ADDR=10.0.0.1
KUBERNETES_PORT_443_TCP=tcp://10.0.0.1:443
_=/usr/bin/env

```

Can you please help me debug this issue? TIA.

-- Pensu
kubernetes
php

0 Answers