appsignal-ruby icon indicating copy to clipboard operation
appsignal-ruby copied to clipboard

Fix undefined method `id' for nil:NilClass Redis Client

Open scottpi opened this issue 11 months ago • 3 comments

The Redis Client Integration does not have an instance variable named 'config' at this point. I changed it to 'id' like the other Redis integration and it worked for me. This change only resolves the error of undefined method 'id' for nil:NilClass.

scottpi avatar Feb 29 '24 15:02 scottpi

Hi @scottpi! Could you let us know which redis gem version you're using?

unflxw avatar Feb 29 '24 15:02 unflxw

@unflxw
redis (4.8.0) redis-client (0.11.2)

scottpi avatar Feb 29 '24 15:02 scottpi

@scottpi That's a bit of an old version of redis-client. Can you upgrade the Gem? Our integration was written for newer gem versions.

If we decide to support older redis-client versions, it should also continue to work with newer versions.

tombruijn avatar Mar 01 '24 12:03 tombruijn

well, using the lower version 3.4.8 worked for with rails 7 default setup.

rhsn1 avatar Mar 13 '24 18:03 rhsn1

This patch breaks on newer redis versions, so we can't merge it without breaking other setups. If you can, please upgrade your version of redis-client. Of course, you can also use your patched version of the integration if you can't upgrade redis-client.

jeffkreeftmeijer avatar Mar 19 '24 09:03 jeffkreeftmeijer

Commenting here, since I ran into the same issue. That crashed our customers whole application and caused a downtime 🤒 It might be nice to add a minimum version requirement to the changelog, as nothing indicates which version is required :)

Just trying to prevent other people from making the same mistake, since it is pretty easily overlooked if you do not run redis in your dev setup.

nduitz avatar Apr 11 '24 10:04 nduitz

I've created a fix for the error happening on older redis-client versions in https://github.com/appsignal/appsignal-ruby/pull/1058

tombruijn avatar Apr 11 '24 11:04 tombruijn