Welcome to the Linux Foundation Forum!

Lab 4 - connection error to redis

vote app is unable to connect to redis in chapter "Feature-InternalServiceDiscovery" in the Lab 4 PDF.

  1. ConnectionError: Error -3 connecting to redis:6379. Try again.
  2.  

kubectl exec -ti redis-647d66978-r9c7t sh:

  1. [2023-08-03 15:08:16,321] ERROR in app: Exception on / [POST]
  2. Traceback (most recent call last):
  3. File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app
  4. response = self.full_dispatch_request()
  5. File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
  6. rv = self.handle_user_exception(e)
  7. File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
  8. reraise(exc_type, exc_value, tb)
  9. File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
  10. rv = self.dispatch_request()
  11. File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
  12. return self.view_functions[rule.endpoint](**req.view_args)
  13. File "/app/app.py", line 32, in hello
  14. data = json.dumps({'voter_id': voter_id, 'vote': vote})
  15. File "/usr/local/lib/python2.7/site-packages/redis/client.py", line 1282, in rpush
  16. return self.execute_command('RPUSH', name, *values)
  17. File "/usr/local/lib/python2.7/site-packages/redis/client.py", line 578, in execute_command
  18. connection.send_command(*args)
  19. File "/usr/local/lib/python2.7/site-packages/redis/connection.py", line 563, in send_command
  20. self.send_packed_command(self.pack_command(*args))
  21. File "/usr/local/lib/python2.7/site-packages/redis/connection.py", line 538, in send_packed_command
  22. self.connect()
  23. File "/usr/local/lib/python2.7/site-packages/redis/connection.py", line 442, in connect
  24. raise ConnectionError(self._error_message(e))
  25. ConnectionError: Error -3 connecting to redis:6379. Try again.

Tried both with schoolofdevops/vote:v5 and schoolofdevops/vote:latest.

Answers

  • Hi @dietrich.vatter,

    I went through all Lab 4 and it worked for me. I used Ubuntu LTS 22.04 and 16 GB of memory, 40 GB of storage on GCP.

    So, as I wasn't unable to reproduce the issue, I recommend the following:

    1.- Delete the deployment.
    2.- Delete the service.
    3.- Create the deplyoment.
    4.- Create the service.
    5.- Try the App again.

    Regards,
    Luis.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training