Reference
5 min read

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.
Table of Contents

Vercel KV is available on Hobby and Pro plans

terminal
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:

terminal
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:

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:

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:

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 or ZSET 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:

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:

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
Last updated on April 27, 2024