Socket/Redis Error

After running the application for a long time, I began to receive this error:

“status”: “500”,

“message”: “Reached the max retries per request limit (which is 20). Refer to "maxRetriesPerRequest" option for details.”,

“stack”: “MaxRetriesPerRequestError: Reached the max retries per request limit (which is 20). Refer to "maxRetriesPerRequest" option for details.\n at Socket. (/opt/node_app/node_modules/ioredis/built/redis/event_handler.js:182:37)\n at Object.onceWrapper (node:events:628:26)\n at Socket.emit (node:events:513:28)\n at TCP. (node:net:301:12)”

Restarting the container Redis helped to get rid of the error.

Why does this problem with sockets/Redis arise and is there anything that can be done to prevent it from appearing in the future?

Is this on your local or production environment? I just put a nodejs app into production on Orangehost and was getting this same error. Turning off redis in the settings and on the production target and reuploading fixed it.

Hi. Yes, this is a production environment. At the moment, it has not been possible to find out what exactly causes this error, but it occurs periodically. The solution is quite simple - just need to reboot the container with Redis.