Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Cloud Run integration with REDIS memorystore not working

Hello,

I followed the tutorial in this link to connect to REDIS Memory store using the Integrations (New) option in the Cloud Run console. Behind the scenes the integration option provisions a VPC Serverless connector and deploys all resources needed for the connection. Cloud logging shows a REDIS client error as you can see in the screenshot.

This is a high priority production setup so I shall appreciate if we can receive help ASAP.Screenshot 2023-12-11 at 5.48.34 PM.pngScreenshot 2023-12-11 at 5.47.17 PM.pngScreenshot 2023-12-11 at 5.46.22 PM.pngScreenshot 2023-12-11 at 5.46.03 PM.png

Solved Solved
0 3 1,865
1 ACCEPTED SOLUTION

Thanks @Marramirez . I will try your solution and update here.

 

View solution in original post

3 REPLIES 3

Hello @dheerajpanyam!

You can do the following troubleshooting options:

  1. In your code, try to change your redis module into ioredis. This is because ioredis is a much more updated client. Also, take a look at this SO post as you might have the same problem.
  2. Add the following code before the creating/running the server to connect. Reference. 
    await client.connect()
  3. If the above options don't work, you can contact Google Cloud Support to further look into your case. Let me know if it helped, thanks!

Thanks @Marramirez . I will try your solution and update here.

 

@Marramirez It is working thanks so much. I will do more tests to see if i run into any issues hopefully this solution is production ready :). Also key is handling  the redis connections (closing and opening connections) similar to DB connection pooling any best practices or documentation around it?

Top Solution Authors