Redis-cli not installed in path

I’m new to fly (and web dev in general), so any help here is appreciated. I’ve made a chat app in django that uses redis to transmit chat messages through servers. It works great locally, but it says I don’t have redis-cli installed when I try to connect a redis server to my deployed fly app. Here’s the error message:
“Could not find redis-cli in your $PATH. Install it or point your redis-cli at: someurlError: exec: “redis-cli”: executable file not found in %PATH%”
I’ve already migrated with ssh, and only redis-dependent parts aren’t working. I just can’t figure out where/how to install redis-cli so that it registers with the fly deployment. Any help is really appreciated. Thanks!

Hi,

There are probably some Django people here who can offer much better advice than me, however normally what you do when using redis is specify the connection string like redis://127.0.0.1:6379 (editing the username, host etc as needed) and provide that to the app. Probably in a secret (or at least an environment variable). As shown in:

"LOCATION": "redis://127.0.0.1:6379",

… is that what you’ve done … and it’s complaining about the redis-cli not being present?

Only in my experience (with other apps) the redis-cli is for when you want to type redis commands (debugging, try it out etc):

If you do, and want to install the redis-cli, I guess you could add the commands to your Dockerfile (assuming you have one - there are different ways to deploy an app).

Keep in mind that if you were to simply SSH/console into the app and simply type the commands to install redis/redis-cli there, it will work … but only for as long as the machine lasts. If you add another machine, re-deploy it etc, Fly would again run the commands from your Dockerfile and not be aware of any commands you had run manually using SSH (like installing redis-cli). So your app would fail again. The Dockerfile contains the instructions for the image and so the commands really need to be in there.

… but I’m surprised the app needs the redis-cli at all :thinking:

Thanks a ton! I was surprised that the app needed redis-cli as well. I’m not any closer to figuring out where redis-cli needs to be installed, but I’m having a similar issue with migrating all of my changes. I can run it in ssh, but as soon as the machine shuts down, I have to do it all over again. Where + how can I have fly run shell commands for every machine?

1 Like

Try putting your commands in the Dockerfile.