Introduction
In the Artifactory (or Access) service logs, you may observe warning messages related to the database connection pool (HikariCP). These messages indicate that the application attempted to use a database connection that had already been closed.
[jfac ] [WARN ] [1234567890abcdef] [c.z.h.p.PoolBase:180 ] [jf-access-grpc-8 ] - JFrog HikariCP Main - Failed to validate connection org.postgresql.jdbc.PgConnection@45375fd9 (This connection has been closed.). Possibly consider using a shorter maxLifetime value.
This warning occurs when an external component terminates an idle database connection before Artifactory's connection pool (HikariCP) does.
By default, the HikariCP maxLifetime is set to 30 minutes. If a connection sits idle in the pool, HikariCP will keep it alive for 30 minutes. However, if an external entity has a shorter idle timeout, it will "silently" close the connection. When Artifactory tries to use that connection, validation fails.
Common external entities that enforce idle timeouts include:
-
Network Devices: Firewalls, Load Balancers, or Proxies sitting between Artifactory and the Database.
-
Database Configuration: Settings within the database itself (e.g., PostgreSQL's idle_session_timeout).
In most cases, these warnings are benign and simply indicate that HikariCP is discarding a dead connection and replacing it with a new one, but they can be noisy and may precede connection issues if the idle timeout is set too aggressively.
Resolution
To resolve this issue, you must configure Artifactory to retire idle connections before the external entity closes them.
1. Determine the Timeout Identify the lowest idle timeout in your infrastructure (Network or DB) and calculate a value 1–2 minutes shorter than that timeout.
2. Configure Artifactory Add the following configuration to $JFROG_HOME/artifactory/var/etc/system.yaml.
shared:
database:
# Value in milliseconds (e.g. 900000 = 15 minutes)
# Set this lower than your DB/Network timeout
maxAge: 900000 # example: 15 minutes
3. Restart Artifactory for the changes to take effect.
The shared.database.maxAge setting controls how long Artifactory keeps a connection open in the pool before closing and replacing it, effectively acting as HikariCP’s maxLifetime for that pool.
Conclusion
This ensures the connection within Artifactory is refreshed proactively before an external entity closes it.