{"record":{"id":"59a3408c4cb16eaa","repo":"Budibase/budibase","slug":"redis-error-err","errorCode":null,"errorMessage":"Redis error: ${err}","messagePattern":"Redis error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/server/src/integrations/redis.ts","lineNumber":136,"sourceCode":"      await this.client.ping()\n      response.connected = true\n    } catch (e: any) {\n      response.error = e.message as string\n    } finally {\n      await this.disconnect()\n    }\n    return response\n  }\n\n  async disconnect() {\n    return this.client.quit()\n  }\n\n  async redisContext<T>(query: () => Promise<T>) {\n    try {\n      return await query()\n    } catch (err) {\n      throw new Error(`Redis error: ${err}`)\n    } finally {\n      await this.disconnect()\n    }\n  }\n\n  async create(query: { key: string; value: string; ttl: number }) {\n    return this.redisContext(async () => {\n      const response = await this.client.set(query.key, query.value)\n      if (query.ttl) {\n        await this.client.expire(query.key, query.ttl)\n      }\n      return response\n    })\n  }\n\n  async read(query: { key: string }) {\n    return this.redisContext(async () => {\n      return await this.client.get(query.key)","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/integrations/redis.ts#L118-L154","documentation":"redisContext is the wrapper every Redis integration operation (create, read, delete, command) runs through. It executes the query, disconnects in finally, and if the underlying redis client throws it rethrows as a uniform 'Redis error: <cause>'. This aggregates any Redis connection, timeout, or command-level failure under one message.","triggerScenarios":"Any call to create/read/delete/command when the Redis server is unreachable, the connection was closed, the URL/port/auth is wrong, or a command (e.g. SET with invalid TTL type) fails server-side; the raw client error is interpolated into the message.","commonSituations":"REDIS_URL pointing at a non-running host or wrong port in dev; Redis requiring a password (NOAUTH) but none configured; maxmemory/eviction failures; connection dropped by idle timeout before the command runs; Docker service not started in the local dev stack.","solutions":["Check the embedded cause in the message and confirm Redis is running/reachable at the configured URL (e.g. redis-cli ping on the host/port)","Verify REDIS connection config: correct host, port, password, and TLS settings","If running the Budibase dev stack, ensure Docker is up so the Redis container (port 6379) starts with yarn dev","Check Redis server logs for auth failures (NOAUTH/WRONGPASS) or memory limits (OOM command not allowed)","Wrap operations with retry/backoff for transient connection drops"],"exampleFix":"// before\nconst client = createClient({ url: \"redis://localhost:6379\" })\nawait client.connect()\n// after (auth + error handling)\nconst client = createClient({ url: \"redis://:password@localhost:6379\" })\nclient.on(\"error\", e => console.error(e))\nawait client.connect()","handlingStrategy":"try-catch","validationCode":"// preflight check before running redis operations\nconst ping = await client.ping().catch(() => null)\nif (ping !== \"PONG\") throw new Error(\"Redis unreachable at configured URL\")","typeGuard":null,"tryCatchPattern":"try {\n  await redisIntegration.create({ key, value, ttl })\n} catch (e) {\n  if (String(e.message).startsWith(\"Redis error:\")) {\n    // inspect cause: retry on transient connection drops, alert on NOAUTH/OOM\n  } else { throw e }\n}","preventionTips":["Health-check Redis (PING) at startup and before critical operations","Configure client reconnect/backoff for transient drops","Verify host/port/password/TLS config against the environment (docker compose ports, REDIS_PASSWORD)","Monitor Redis memory (maxmemory) and auth errors in server logs"],"tags":["redis","network","cache","connection"],"backgroundTag":"redis-connection-error","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}