As we have added the prepareThreshold=0 parameter in the system.yaml to the database connection string URL. Please note from the official postgresql site, once this parameter is enabled, it deactivates/disables the prepared statement and the error we see above is related to prepared statements. As a next step, in order to disable prepared statements in the Metadata microservice, we need to do perform the following changes in the system.yaml file ($JFROG_HOME/artifactory/var/etc ):
NOTE: Make sure to add above changes with the proper indentation. Restart the Artifactory instance for the changes to take effect. In some cases, even though Artifactory service is up and running, Artifactory UI package view of artifacts might fail with the 500 error or sometimes, Artifactory itself won’t come up due to the metadata service issue.
shared: database: type: postgresql driver: org.postgresql.Driver url: jdbc:postgresql://localhost:6432/artifactory?prepareThreshold=0 username: artifactory password: password metadata: database: type: postgresql url: go:user='artifactory' password='*******' dbname=artifactory host=localhost port=6432 sslmode=disable statement_cache_mode=describe disablePreparedStatementCache: true
NOTE: Make sure to add above changes with the proper indentation. Restart the Artifactory instance for the changes to take effect. In some cases, even though Artifactory service is up and running, Artifactory UI package view of artifacts might fail with the 500 error or sometimes, Artifactory itself won’t come up due to the metadata service issue.