Hello, I’m using React Remix with fly.io configuration,
I create a redis database copied the Redis URL from the fly cli, and also tries the upstash console by I keep getting
Error: connect ECONNREFUSED ::1:6379 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) {
errno: -61,
code: ‘ECONNREFUSED’,
syscall: ‘connect’,
address: ‘::1’,
port: 6379
},
I can connect to redis from my cli, but not through my app on localhost, I suggestion or things to try, I’m all out of ideas?
You can also try the following if the above doesn’t work for you:
To connect your local application to the Redis database on Fly.io, you can use the flyctl proxy command:
Open your Redis Fly App’s local directory:
cd your-redis-app-directory
Run the flyctl proxy for port 6379 or whichever REDIS_PORT you have configured:
fly proxy 6379
Update your React Remix application’s configuration to use the correct Redis URL and port provided by Fly.io or Upstash. Make sure the REDIS_PORT in your configuration matches the port used in flyctl proxy.
After making these changes, your local React Remix application should be able to connect to the Redis database on Fly.io. If you still encounter issues, please double-check your application’s configuration and ensure that it’s using the correct Redis URL and port.
okay! I have added the port 8080 to my fly.toml file, and the app now listens on that port, I have also tried fly redis connect my-redis-db and it works aswell. I can type commands and see usage spike in upstash. BUT I still can’t connect to it via node redis.
What I found:
fly cli gives my this url for redis: "redis://default:password@fly-app-redis1.upstash.io"
while upstash gives me: "redis://default:password@fly-app-redis1.upstash.io:37005"
which one do I choose? I tried both and I end up with the screen shot below.
some things I’m considering,
Do I need a dedicated v4 IP?
I have given up on trying to connect fly to my local machine via wireGaurd, as that is another problem to solve later, now I just run a different redis db locally and see if I can connect my remix app to redis on the cloud.
If someone can also direct my to how fly.io does networking, as nothing is able to connect to my fly machine unless I allow all ips to access my db (0.0.0.0), that would be helpful?
Thank you! got it working ended up being a connection issue in my prod env. But because I couldn’t connect to it from local, my mind went to it being a connection issue. Any idea of what latency I should expect from redis upstahs running on fly for a simple redis.get(object) and then running json.stringify?