Troubleshooting
Common errors and how to fix them.
Checkup errors
pg_stat_statements not enabled
Symptom: Checkup warns that pg_stat_statements is not available. Query-level checks (K-series) are skipped.
Fix:
-- Enable the extension
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
Then restart PostgreSQL. The extension requires shared_preload_libraries to include pg_stat_statements:
# postgresql.conf
shared_preload_libraries = 'pg_stat_statements'
Permission denied
Symptom: Checkup fails with permission errors when querying system catalogs.
Fix: Create a monitoring user with the pg_monitor role:
CREATE USER postgres_ai_mon PASSWORD '****';
GRANT pg_monitor TO postgres_ai_mon;
Or use the CLI helper:
npx postgresai prepare-db postgresql://admin:password@host:5432/dbname
SSL negotiation failed
Symptom: Connection fails with SSL-related errors.
Fix: Add SSL mode to your connection string:
npx postgresai checkup "postgresql://user:pass@host:5432/dbname?sslmode=require"
For self-signed certificates:
npx postgresai checkup "postgresql://user:pass@host:5432/dbname?sslmode=require&sslrootcert=/path/to/ca.pem"
Connection refused
Symptom: Cannot connect to the database.
Fix: Check that:
- PostgreSQL is running and accepting connections
pg_hba.confallows connections from your IP- The port is correct (default: 5432)
- Any firewall or security group allows the connection
Monitoring stack errors
Grafana not loading
Symptom: http://localhost:3000 is unreachable after local-install.
Fix:
# Check service status
npx postgresai mon status
# Check logs for errors
npx postgresai mon logs
# Restart the stack
npx postgresai mon stop
npx postgresai mon start
If Docker containers are not starting, verify Docker is running:
docker ps
Metrics not appearing in dashboards
Symptom: Dashboards show "No data" for all panels.
Fix:
-
Check that the monitored database is reachable from the monitoring stack:
npx postgresai mon health -
Verify the data source in Grafana (Settings > Data Sources > VictoriaMetrics/Prometheus)
-
Wait for collection — some metrics take up to 5 minutes to appear after initial setup. Bloat metrics are collected every 2-3 hours.
-
Check pgwatch logs for connection errors:
npx postgresai mon logs pgwatch
Docker Compose version conflicts
Symptom: docker compose commands fail with syntax errors.
Fix: Ensure you have Docker Compose V2:
docker compose version
# Should show v2.x or later
If you have the old docker-compose (V1), upgrade Docker Desktop or install the Compose plugin.
Port conflicts
Symptom: local-install fails because port 3000 is already in use.
Fix: Stop the conflicting service, or check if a previous monitoring stack is still running:
npx postgresai mon stop
npx postgresai mon local-install
Upgrade issues
Dashboards missing after upgrade
Symptom: After upgrading, some dashboards are missing or show old versions.
Fix: Re-run local-install to pull new dashboard definitions:
npx postgresai mon stop
npx postgresai mon local-install -y
See Upgrading for the full upgrade procedure.
Getting help
If your issue is not listed here:
- Check the monitoring reference for configuration details
- Contact support: postgres.ai/contact