taoensso / carmine

Redis client + message queue for Clojure
https://www.taoensso.com/carmine
Eclipse Public License 1.0
1.15k stars 130 forks source link

`wcar` connection URL problems #194

Closed 0atman closed 7 years ago

0atman commented 7 years ago

Hey there, thanks for an amazing library which works great in my local dev, however I'm having trouble when setting the :spec :url to what Heroku has given me: REDIS_URL: redis://h:[password]@myhost.eu-west-1.compute.amazonaws.com:11439

It gives me:

ERROR Carmine connection error
clojure.lang.ExceptionInfo: Carmine connection error {}
Caused by: java.net.ConnectException: Connection refused (Connection refused)

I've sshed into the box to confirm that the connection shouldn't be refused, I can telnet into the redis box.

I've tried splitting up the connection URL manually, as suggested in carmine.clj#L29, but this doesn't seem to work - I also note there doesn't seem to be a :user option.

What am I missing?

0atman commented 7 years ago

MORE CONTEXT!

The connection errors are because carmine is connecting to localhost, no matter what I do. Here is the full output from a repl session, from my ns store.core, which requires [taoensso.carmine :as redis]:

(def conn
  {:pool {}
   :spec {:url "redis://redistogo:[password]@chubb.redistogo.com:9836/"}})
#'store.core/conn

store.core=> (redis/wcar conn (redis/hget 1 2))
 java.net.ConnectException: Connection refused (Connection refused)
clojure.lang.ExceptionInfo: Carmine connection error

enable local redis in another terminal

store.core=> (redis/wcar conn (redis/hget 1 2))
"3"
 ^ this is now connecting to my local redis, despite `conn` pointing to redistogo.

What am I doing wrong? This usage seems exactly as carmine.clj#L28 suggests!

0atman commented 7 years ago

@ptaoussanis can you help me?

ptaoussanis commented 7 years ago

Hi Tristram,

(def conn {:pool {} :spec {:url "redis://redistogo:[password]@chubb.redistogo.com:9836/"}})

Could you possibly try with :uri instead of :url? (Assuming this wasn't just a typo?)

0atman commented 7 years ago

0atman commented 7 years ago

That was it, I am an idiot. I even pasted the line from carmine.clj above mine and was wondering what the difference was. Amazing. Thank you so much @ptaoussanis

ptaoussanis commented 7 years ago

No problem, these kinds of things easily happen. Happy the solution turned out to be simple!

Cheers :-)

0atman commented 7 years ago

I've added the information to the readme in this PR that I would have needed to get a week of my life back :laughing: #195