Redis isn't available

I’ve followed all the instructions in the forums that I can find for ensuring that Redis is activated and ready to receive connections, but it never seems to be available. Ubuntu 14.04 (Trusty) is selected, and I’ve been rebuilding by pushing to Github.

Here is our .circle/config.yml:

This just results in the following line, until it times out
2017/12/28 21:07:28 Problem with dial: dial tcp getsockopt: connection refused. Sleeping 1s

Thank you for any help you can provide getting Redis working.

I don’t know Redis, but is there a console command you can use to test it? If so, run your build with the SSH option, and then you can debug it at leisure. Check to see if it is still running, and if there are any start-up error logs generated.

The services key is not valid in 2.0

      - redis

If you wish to use redis you should add it as a service using the official docker container just like you are doing with postgresql. Something like this should work.

      - image: circleci/ruby:2.4.1-node
          RAILS_ENV: test
          PGUSER: root
      - image: circleci/postgres:9.6.2-alpine
          POSTGRES_USER: root
          POSTGRES_DB: circle-test_test
      - image: redis

That did it. Thank you, @levlaz!

1 Like