Redis isn't available


#1

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: https://gist.github.com/daniel-nelson/464b25ab6c2e53ddaaac6fd31aba49cd

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

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


#2

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.


#3

The services key is not valid in 2.0

    services:
      - 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.

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

#4

That did it. Thank you, @levlaz!


#5