// troubleshooting guide · upstash

Upstash Redis Environment Variables Not Found (Vercel KV, Fly.io)

Status
Workaround available
platforms:
Vercel, Fly.io, Netlify, Next.js
updated:
November 15, 2026
reports:
4
Method
how we research
Share

RUNBOOK · upstash/env-variables-not-found4 FIXES

// quick answer

Redis.fromEnv() reads UPSTASH_REDIS_REST_URL/TOKEN (or Vercel's KV_REST_API_URL/TOKEN). If they're missing at runtime, or you use Fly.io's Upstash extension (which has no REST API), the client can't connect. Copy the REST values from the Console and set them in your platform.

Most likely fix: Set the REST variables

How to fix it

// try these in order, the most common fix is first

  1. FIX 1Set the REST variables

    1. 01Upstash Console > database > Connect > REST tab
    2. 02Add UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN to your platform's environment settings
    3. 03Redeploy
    Did this fix it?
  2. FIX 2Fix projects migrated from Vercel KV

    1. 01Replace @vercel/kv with @upstash/redis
    2. 02Keep KV_REST_API_URL/KV_REST_API_TOKEN (fromEnv reads them) or switch to the UPSTASH_ names
    3. 03If the store is missing in Vercel Storage, create a database in the Upstash Console and add its env vars to the project
    Did this fix it?
  3. FIX 3On Fly.io, use TCP or a direct database

    1. 01The Fly.io extension only offers the Redis protocol: use ioredis/redis with the rediss:// URL
    2. 02If you need REST (edge functions), create the database directly at console.upstash.com instead
    Did this fix it?
  4. FIX 4Pass credentials explicitly

    1. 01new Redis({ url: process.env.X, token: process.env.Y }) to rule out naming issues
    Did this fix it?

Symptoms

The SDK warns it can't find UPSTASH_REDIS_REST_URL, requests go to 'undefined', the app broke after the Vercel KV to Upstash migration, or no REST URL exists for a Fly.io Upstash database.

Why it happens

  • C-01Env vars set locally (.env) but not in the deployment
  • C-02Vercel KV store migrated to Upstash and the project still expects old variable names
  • C-03Fly.io Upstash Redis extension doesn't provide the REST API
  • C-04Variables set for Production but the code runs in Preview

// this guide also covers

  • upstash_redis_rest_url not found
  • upstash redis fromenv error
  • vercel kv upstash migration
  • fly io upstash rest api

Still not working?

If Upstash keeps failing, you're not alone. See every Upstash problem users report or the alternatives people switch to.

Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.

Talk to us

Watch Upstash Get an email when its price changes, it has an outage, or we publish a new fix. No spam.

Fixed it? Share this guide

The same problem in other apps

All not loading, error messages & connection guides →

Other Upstash errors

All 11 Upstash errors and fixes →