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

Frontend cannot connect to redis data-base in guestbook example. #5091

Closed
piosz opened this issue Mar 5, 2015 · 8 comments · Fixed by #5284
Closed

Frontend cannot connect to redis data-base in guestbook example. #5091

piosz opened this issue Mar 5, 2015 · 8 comments · Fixed by #5284
Assignees
Labels
kind/support Categorizes issue or PR as a support question. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Milestone

Comments

@piosz
Copy link
Member

piosz commented Mar 5, 2015

It comes up in the new guestbook.sh e2e test (#3693). I'll try to reproduce manually.

<br /> <b>Fatal error</b>: Uncaught exception 'Predis\Connection\ConnectionException' with message 'Error while reading line from the server [tcp://10.0.211.28:6379]' in /vendor/predis/predis/lib/Predis/Connection/AbstractConnection.php:141 Stack trace:
#0 /vendor/predis/predis/lib/Predis/Connection/StreamConnection.php(208): Predis\Connection\AbstractConnection-&gt;onConnectionError('Error while rea...')
#1 /vendor/predis/predis/lib/Predis/Connection/AbstractConnection.php(130): Predis\Connection\StreamConnection-&gt;read()
#2 /vendor/predis/predis/lib/Predis/Connection/AbstractConnection.php(122): Predis\Connection\AbstractConnection-&gt;readResponse(Object(Predis\Command\StringGet))
#3 /vendor/predis/predis/lib/Predis/Client.php(246): Predis\Connection\AbstractConnection-&gt;executeCommand(Object(Predis\Command\StringGet))
#4 /vendor/predis/predis/lib/Predis/Client.php(228): Predis\Client-&gt;executeCommand(Object(Predis\Command\StringGet))
#5 /app/index.php(32): Predis\Client-&gt;__call('get', Array)
#6 /app/index.php(32): Predis\Client-&gt;get('messag in <b>/vendor/predis/predis/lib/Predis/Connection/AbstractConnection.php</b> on line <b>141</b><br />```
@piosz
Copy link
Member Author

piosz commented Mar 5, 2015

Reproduced in my own cluster:

pszczesniak@piosz:~/git/kubernetes$ ./cluster/kubectl.sh create -f examples/guestbook/
current-context: "tidal-shield-848_kubernetes"
Running: ./cluster/../cluster/gce/../../_output/local/bin/linux/amd64/kubectl create -f examples/guestbook/
frontend-controller
frontend
redis-master-controller
redis-master
redis-slave-controller
redisslave
pszczesniak@piosz:~/git/kubernetes$ ./cluster/kubectl.sh get services frontend -o json
current-context: "tidal-shield-848_kubernetes"
Running: ./cluster/../cluster/gce/../../_output/local/bin/linux/amd64/kubectl get services frontend -o json
{
    "kind": "Service",
    "id": "frontend",
    "uid": "ec64398f-c342-11e4-b4a3-42010af08af6",
    "creationTimestamp": "2015-03-05T14:21:32Z",
    "selfLink": "/api/v1beta1/services/frontend?namespace=default",
    "resourceVersion": 68039,
    "apiVersion": "v1beta1",
    "namespace": "default",
    "port": 8000,
    "protocol": "TCP",
    "labels": {
        "name": "frontend"
    },
    "selector": {
        "name": "frontend"
    },
    "createExternalLoadBalancer": true,
    "publicIPs": [
        "104.154.37.133"
    ],
    "containerPort": "http-server",
    "portalIP": "10.0.171.36",
    "sessionAffinity": "None"
}
pszczesniak@piosz:~/git/kubernetes$ curl 104.154.37.133:8000/index.php?cmd=get\&key=messages
<br />
<b>Fatal error</b>:  Uncaught exception 'Predis\Connection\ConnectionException' with message 'Connection timed out [tcp://10.0.144.100:6379]' in /vendor/predis/predis/lib/Predis/Connection/AbstractConnection.php:141
Stack trace:
#0 /vendor/predis/predis/lib/Predis/Connection/StreamConnection.php(96): Predis\Connection\AbstractConnection-&gt;onConnectionError('Connection time...', 110)
#1 /vendor/predis/predis/lib/Predis/Connection/StreamConnection.php(70): Predis\Connection\StreamConnection-&gt;tcpStreamInitializer(Object(Predis\Connection\ConnectionParameters))
#2 /vendor/predis/predis/lib/Predis/Connection/AbstractConnection.php(96): Predis\Connection\StreamConnection-&gt;createResource()
#3 /vendor/predis/predis/lib/Predis/Connection/StreamConnection.php(144): Predis\Connection\AbstractConnection-&gt;connect()
#4 /vendor/predis/predis/lib/Predis/Connection/AbstractConnection.php(181): Predis\Connection\StreamConnection-&gt;connect()
#5 /vendor/predis/predis/lib/Predis/Connection/StreamConnection.php(183): Predis\Connection\AbstractConnection in <b>/vendor/predis/predis/lib/Predis/Connection/AbstractConnection.php</b> on line <b>141</b><br />

Am I doing anthing wrong?

@piosz
Copy link
Member Author

piosz commented Mar 5, 2015

Also the same stuff from browser. While I'm clicking Submit I can see:

screen shot 2015-03-05 at 3 25 07 pm

@bgrant0607 bgrant0607 added kind/support Categorizes issue or PR as a support question. priority/support labels Mar 5, 2015
@piosz
Copy link
Member Author

piosz commented Mar 5, 2015

This may be related to #4914

@piosz
Copy link
Member Author

piosz commented Mar 9, 2015

The problem is that when frontend pods are created, information about redis services may not be propagated yet. I'll change guestbook example to use SkyDNS instead of host:port.

@piosz
Copy link
Member Author

piosz commented Mar 10, 2015

@brendandburns what do you think about using kube-dns instead of host:port in guestbook example. Please notice that kube-dns is not yet reliable #5181

@mulloymorrow
Copy link
Contributor

@mulloymorrow
Copy link
Contributor

@piosz
Copy link
Member Author

piosz commented Mar 19, 2015

It's actually not related. The problem was not with redis itself but with distributing redis address over containers.

@piosz piosz added this to the v1.0 milestone Mar 23, 2015
@piosz piosz added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Mar 23, 2015
akram pushed a commit to akram/kubernetes that referenced this issue Apr 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants