Vercel KV Error Codes
This section focuses on errors that can happen while using a client, Vercel KV SDK, or Vercel KV API to interact with your Vercel KV database.Vercel KV is available on Hobby and Pro plans
ReplyError: NOAUTH Authentication required
Your redis client failed to connect to your KV store. This error occurs when your password is missing from your connection parameters.
You'll most likely encounter this error when using your favorite redis CLI interface to connect to your KV store.
You can access the appropriate connection string with your KV store's password in the Quickstart section of the Storage tab in your vercel dashboard.
Your connection string should look like the following example:
redis://********example-store-name.redis.vercel-storage.com:12345
Troubleshoot:
- Check that your connection string does not have a typo, such as a missing
:
before the password
Unhandled error event: Error: read ECONNRESET at TCP.onStreamRead (node:internal/stream_base_commons:123:12)
Your redis client failed to connect to your KV store. This error occurs when your connection is not TLS enabled. All KV stores are TLS enabled by default. You cannot disable TLS.
Be sure to use the --tls
or equivalent option when connecting to your KV store through a CLI or redis client.
Troubleshoot:
- Enable TLS in your redis client or CLI when connecting to your KV store
- Ensure that your KV store's connection string starts with
redis://
.
"message" : "Unhandled error event:
ReplyError: ERR max concurrent connections exceeded\r
at Object.onceWrapper (events.js:286:20)\r
at Socket.emit (events.js:203:15)\r at Socket.EventEmitter.emit (domain.js:448:20)\r
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1093:10)\n"
Your redis client failed to connect to your KV store. This error occurs when your KV store has reached its max concurrent connection limit.
This can happen if you are not closing connections after opening them, such as in Serverless or Edge functions.
Troubleshoot:
- Try to create clients within the functions that will use them, then close them when the function is done with them
- Use our
@vercel/kv
SDK or the Vercel KV API to manage your database using REST. Using REST will allow you to avoid hitting your connection limit - Upgrade your plan to Pro or Enterprise to increase your connection limit
ReplyError: ERR max request size exceeded
The command you sent to your KV store exceeds the max request size, which varies based on your account plan.
Troubleshoot:
- You can split your data into smaller chunks and send them in separate commands
- You can upgrade your account plan to Pro or Enterprise to increase your max request size limit
ReplyError: ERR max single record size exceeded
An entry in your KV store has exceeded the max record size limit for your account.
You may reach this limit either by inserting a single huge value or appending many small values to an entry. This entry can be a String
, List
, Set
, Hash
etc. Read (GET
, LRANGE
, HMGET
, ZRANGE
etc) and delete (DEL
, LPOP
, HDEL
, SREM
etc) requests will not be affected.
Troubleshoot:
- You can split your data into smaller chunks and store them as separate entries with different keys.
- You can upgrade your account plan to Pro or Enterprise to increase your max request size limit
ReplyError: ERR max key size exceeded. Limit: X bytes, Actual: Z bytes
The size of the key you're trying to create in your KV store is larger than 32 KB.
Troubleshoot:
- 32 KB is the max size for a data key in your KV store. This size cannot be exceeded
ReplyError: ERR max field size exceeded. Limit: X bytes, Actual: Z bytes
The size of a HASH
field you're trying to create in your KV store exceeds the max field size limit, which is 32 KB.
Troubleshoot:
- 32 KB is the max size for a
HASH
field in your KV store. This size cannot be exceeded
ReplyError: ERR max member size exceeded. Limit: X bytes, Actual: Z bytes
The size of a SET or ZSET member you're trying to create in your KV store exceeds the max field size limit, which is 32 KB.
Troubleshoot:
- 32 KB is the max size for a
SET
orZSET
member in your KV store. This size cannot be exceeded
ReplyError: ERR DB capacity quota exceeded
Your KV store has exceeded the max size allowed for your account. See our docs on Vercel KV usage and pricing to learn more.
Troubleshoot:
- You can manually delete some entries to allow further writes
- Consider setting TTL (expiration time) for your keys, or enabling eviction for your KV store
- You can upgrade your account plan to Pro or Enterprise to increase your max KV store size limit
ReplyError: ERR max daily request limit exceeded
Your KV store has exceeded the max daily request count limit by sending too many commands in a 24 hour period. See our docs on Vercel KV usage and pricing to learn more.
Troubleshoot:
- Try to reduce the amount of commands your application or client sends per day
- You can upgrade your account plan to Pro or Enterprise to increase your max KV store daily request limit
UpstashError: WRONGPASS invalid or missing auth token
Your redis client failed to connect to your KV database. This error occurs when you try to authenticate with a missing or invalid auth token.
You can find the auth token in the Vercel dashboard, under the Storage tab. You can also find it in your project's settings, in the Environment Variables section. Your auth tokens should be:
KV_REST_API_TOKEN
KV_REST_API_READ_ONLY_TOKEN
If your KV database uses a custom Environment Variable prefix, it will replace
KV
in the Environment Variable names. For example, if your prefix is
SESSIONS
, your API token will be SESSIONS_REST_API_TOKEN
.
- Ensure your KV database is connected to your Vercel project. Follow the Vercel KV quickstart to learn how
- Ensure your KV database's credentials are available in your local environment variables with Vercel CLI. Follow the Vercel KV quickstart to learn how
Was this helpful?