There is literally zero documentation on how to setup Upstash Redis, and the output of the Flyctl command is misleading and wrong. Reported here, but wanted to highlight here as well in case anyone has already figured this out.
Problem 1
There is no documentation on where to find the correct values for the following environment variables:
UPSTASH_REDIS_REST_URL
UPSTASH_REDIS_REST_TOKEN
This (very out of date) document says to look for a REST_URL
on the dashboard, but that doesn’t exist.
The dashboard appears to have been updated significantly since those screenshots, and now there is a many tabbed “Connect to your database” widget.
Unfortunately it does not have an ENV shell variable section, which is what I need for Fly.io deployment.
Other documentation appears to imply that we’d get the values from the info printed at the end of the flyctl create redis script, but the values, if they were given, were missed by me, and I copied the entire output, and still have it, perhaps they were disguised so as to appear to be relevant to something else.
Solution 1
“Connect to your database” widget should have an ENV section for the ENV variable version of the connection info.
Problem 2
Perhaps my confusion is that the value given by the script starts with redis://
, and I’ve seen other documentation indicating that UPSTASH_REDIS_REST_URL
is intended for HTTP REST interactions, so I’m expecting it to start with HTTP
, and indeed, some of the “Connect to a database” examples do have URLs starting with HTTP
.
A second issue then is that the flyctl integration gives bad output that isn’t relevant to what we actually need to setup Upstash Redis on our Fly.io apps.
What the output has currently (totally misleading / irrelevant to a Fly.io app needing UPSTASH_REDIS_REST_URL
)
Your database some-some-some-<num> is ready. Apps in the fisecal org can connect to Redis at redis://default:do-de-do-de-do-de-do-de@fly-some-some-some-<num>.upstash.io:6379
If you have redis-cli installed, use fly redis connect to get a Redis console.
Your database is billed at $0.20 per 100K commands. If you're using Sidekiq or BullMQ, which poll Redis frequently, consider switching to a fixed-price plan. See https://fly.io/docs/reference/redis/#pricing
Solution 2
Fix the output for the flyctl integration to give users the necessary info, namely:
UPSTASH_REDIS_REST_URL
UPSTASH_REDIS_REST_TOKEN