Issue:

XRAY: How to resolve the SQLSTATE 53300 error

AuthorFullName__c
Sun Jinlong
articleNumber
000005972
ft:sourceType
Salesforce
FirstPublishedDate
2024-01-08T19:17:40Z
lastModifiedDate
2024-01-08
VersionNumber
1
When running the Xray database sync the Xray has a large number of analysis tasks running that will create a large number of PostgreSQL database connection links. If the number of database connection links created by the Xray is greater than the maximum number of database connection links opened by the PostgreSQL configuration, it will return the SQLSTATE 53300 with too many connection errors.
The error snippets are as follows:
[33m[jfxr ][0m [1m[31m[ERROR][0m [                ] [vulnerability:44              ] [main                ] Failed to check if vulnerability with id XRAY-id is already exists: failed to fetch public vulnerability
 --- at /go/src/jfrog.com/xray/backend/dbaccess/dao/public_vulnerabilities_dao.go:1116 (publicVulnerabilitiesDao.GetVulnerabilityBasicInfo) ---
Caused by: failed to connect to `host=<host_addr> user=<username> database=<db_name>`: server error (FATAL: remaining connection slots are reserved for non-replication superuser connections (SQLSTATE 53300))