> ## Documentation Index
> Fetch the complete documentation index at: https://docs.springwinter.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Debug private PostgreSQL and Valkey connections

> Diagnose timeouts, TLS failures, authentication errors and connection-pool pressure while keeping SQL databases and Valkey private in your AWS account.

SpringWinter SQL and Valkey resources use private project networking. A laptop timeout does not establish a database outage. Identify whether the client is a project task or a local client using an explicitly opened tunnel, then separate routing, TLS, authentication and application pooling.

## Diagnose by error layer

| Error | Meaning and likely causes | Safe next step |
| - | - | - |
| Connection timeout | No completed network path, unavailable resource, wrong endpoint/Region | Inspect current resource state, project network and security-group rules; use the connection view or authorized tunnel |
| Name cannot resolve | Wrong/stale endpoint or client DNS context | Compare the current endpoint privately; do not substitute a random public IP |
| Certificate verification failed | Missing CA, wrong hostname, proxy/tunnel hostname mismatch or expired chain | Install the correct trusted CA and configure driver hostname verification; do not turn TLS checks off |
| Password authentication failed | Wrong user/secret/database or stale application runtime value | Verify the intended secret through authorized controls; rotate only with an approved plan and update dependants |
| Too many connections / pool timeout | Per-process pool multiplied by tasks/workers, leaks or long transactions | Calculate total pools and inspect sanitized application metrics; reduce concurrency/leaks before resizing |
| Redis `MOVED` | Cluster-aware routing is required | Use a compatible cluster client; changing ports or retrying the same single-node request is not a cluster solution |
| Valkey TLS handshake fails | Plaintext client/port, unsupported TLS settings or trust configuration | Use the actual TLS endpoint and supported client; verify certificates and command compatibility |

Read [AWS RDS troubleshooting](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Troubleshooting.html) and [ElastiCache Serverless connection guidance](https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/GettingStarted.serverless.connect.html). Do not follow a public-database workaround when a private connection is the intended architecture.

## Inspect configuration without exposing it

Check that required variable **names** exist in the runtime scope. Build variables do not automatically become runtime credentials. Never print the full environment or a URL with username/password into chat, logs, screenshots or GitHub issues. For browser code, `NEXT_PUBLIC_*` and `VITE_*` are public values and must not contain database or provider secrets.

Use SpringWinter's database Connect view for the correct writer/reader target and explicit tunnel controls where supported. Close a tunnel after use. A reader endpoint is not a writer; read replicas and failover standbys have different roles. AWS resource state can be available while an application still has the wrong credentials or schema.

## Plan the connection budget

Calculate `web task copies × processes per task × pool size`, then add worker pools, migrations, monitoring and administrative headroom. This is a concurrency budget, not a promise that the database supports that many connections. Check the selected engine/class limit and application transaction duration. A task-count increase can exhaust the database even when CPU looks healthy.

For Valkey, check cluster compatibility, TLS, supported commands and logical database 0. Durable job state and acknowledged results need an explicit recovery design; a cache is not automatically a reliable backup.

## Test safely and verify recovery

Create a new isolated database or complete disposable copy for connection and migration experiments. Do not run troubleshooting queries, migrations or fixtures against an existing database under this guide. Use the reviewed application's ordinary health/readiness behavior for live verification through authorized product controls.

Verify a representative application operation with synthetic test data in the approved test environment. Test reconnect after a planned task or database change, check error rates and confirm pool release. Never claim backup recovery from a successful connection alone.

See [SQL databases](https://docs.springwinter.dev/deploy/databases.md), [caches](https://docs.springwinter.dev/deploy/caches.md), [environment variables](https://docs.springwinter.dev/concepts/environment-variables.md), [full-stack deployment](https://docs.springwinter.dev/guides/full-stack-apps.md) and [compatibility](https://docs.springwinter.dev/reference/compatibility.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.