reportportal / service-api

Report portal. Main API Service
Apache License 2.0
44 stars 65 forks source link

Frequent errors in connecting to PostgreSQL - TImeout #2003

Closed mathew-jithin closed 3 months ago

mathew-jithin commented 4 months ago

Hi Guys,

Getting the following error very frequently in API service. We have deployed service-api on k8s with 3 pods running:

2024-06-03 14:26:27.061  WARN 1 --- [s-task-exec2592] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 0, SQLState: null
2024-06-03 14:26:27.061 ERROR 1 --- [s-task-exec2592] o.h.engine.jdbc.spi.SqlExceptionHelper   : HikariPool-1 - Connection is not available, request timed out after 30000ms.
2024-06-03 14:26:27.061 ERROR 1 --- [s-task-exec2592] c.e.t.r.c.log.impl.CreateLogHandlerImpl  : Failed to save log with attachments

java.util.concurrent.CompletionException: org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection
    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
    at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection

Considerations:

  1. We use the default connection limits (internally given for the services). connections parameter is not set under database, serviceapi or servicejobs.
  2. This was working fine with ReportPortal 5.7.2 and issues started happening after we migrated to 5.11.0. We did a fresh installation, so this is not a migration issue.
  3. We are on AWS RDS (EV: 14.11) with 2 vCPU & 4GB ram. We used to use the same on ReportPortal v5.7.2. So we continued with the same config.
wemersonmarques commented 3 months ago

I'm having the same problem. Any updates about it?

Pink-Bumblebee commented 3 months ago

Duplicate of https://github.com/reportportal/reportportal/issues/2287