How to resolve PoolableConnectionFactory exception in JMeter when trying to connect AWS postgres db in JMeter? - database

Here is how Database url is given : jdbc:postgresql://Hostname:portnumber/dbname
Kept the following jar file in C:\Program Files\Apache\apache-jmeter-5.0\lib
postgresql-9.1-901-1.jdbc4.jar
I am getting the below error in JMeter when trying to connect AWS postgres db in JMeter.
Cannot create PoolableConnectionFactory (FATAL: no pg_hba.conf entry for host "xxx", user "xxuser", database "xxname", SSL off).

Can it be the case you have SSL enabled in your PostgreSQL cluster? Looking at Requiring an SSL/TLS connection to an Aurora PostgreSQL DB cluster chapter
If you enable set rds.force_ssl and restart your DB cluster, non-SSL connections are refused with the following message:
psql: FATAL: no pg_hba.conf entry for host "host.ip", user "someuser", database "postgres", SSL off
So it might be the case you just need to enable SSL in your JDBC URL like:
jdbc:postgresql://Hostname:portnumber/dbname?ssl=true
Otherwise just add the following entry to your pg_hba.conf file:
hostnossl all all 0.0.0.0/0 trust
and upon Postgres restart you will be able to connect from anywhere by anyone without SSL
Also according to 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure and JMeter Best Practices you should always be using the latest version of JMeter so consider upgrading to JMeter 5.4.1 (or whatever is the latest stable version available at JMeter Downloads page)

Related

AWS RDS Instance is not connecting to Jmeter

I am trying to connect my RDS instance to a Jmeter load test however no matter what I try, I keep getting this error message in the Results Tree:
Cannot create PoolableConnectionFactory (The connection to the host database-1.cqdkrfikhe1t.us-east-1.rds.amazonaws.com, named instance database-1 failed. Error: "java.net.SocketTimeoutException: Receive timed out". Verify the server and instance names and check that no firewall is blocking UDP traffic to port 1434. For SQL Server 2005 or later, verify that the SQL Server Browser Service is running on the host.)
I feel it may be a problem with my Database URL in JDBC Connection Configuration.
The picture below shows the summary report.
I have mainly tried rewriting the Database URL multiple different ways but none of them seem to work. I have also tried removing and reinstalling the JDBC Drivers but that doesn't seem to work either. I have absolutely no idea what the problem could be. Could someone please help me out with this problem?
Edit: When I change the Database URL I sometimes get this error
message as well:
Cannot create PoolableConnectionFactory (The driver could not establish a secure connection to SQL Server by using Secure Sockets
Layer (SSL) encryption. Error: "PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to
find valid certification path to requested target".
ClientConnectionId:9b700d73-f3f0-4cf6-b3a4-607fa9827219)
I think you need to use port 1433
Check out Connecting to a DB instance running the Microsoft SQL Server database engine article
So cross check the port number, VPC options, public accessibility, etc. with the values from the JDBC Connection Configuration
More information: The Real Secret to Building a Database Test Plan With JMeter

Enable SSL in ColdFusion 2018 Administrator

I want to add a database (Microsoft SQL) to the website I'm working on, using Cold Fusion Administrator (latest version).
After entering all needed data, I got the issue:
Connection verification failed for data source: dbKantine
java.sql.SQLException: The sqlserver package is not installed. You can install the package through the CLI package manager (C:/Users/MYNAME/.CommandBox/server/C1EA019F5A81794693D0EA837C1622B4-PROJECTNAME/adobe-2021.0.2.328618/WEB-INF/cfusion/bin/cfpm.bat) by running the command : install sqlserver.
I tried to execute the *.bat file mentioned, but nothing happened.
I also tried install sqlserver in the CommandBox, but it says:
Error getting ForgeBox entry [sqlserver]
The entry slug sent is invalid or does not exist
EDIT:
I got it installed using cfpm.sh and wrote there "install sqlserver".
But now it tells me this inside of Cold Fusion Administrator:
Connection verification failed for data source: MYDB
java.sql.SQLNonTransientConnectionException: [Macromedia][SQLServer JDBC Driver]An SSL socket connection could not be established because JRE 1.4 or above is required.
EDIT 2:
I setup everything again with ColdFusion 2018 (as I'm learning CF 2018 currently).
Now I get the issue:
Connection verification failed for data source: MYDB
java.sql.SQLNonTransientConnectionException: [Macromedia][SQLServer
JDBC Driver]The SQL Server login requires an SSL connection. The root
cause was that: java.sql.SQLNonTransientConnectionException:
[Macromedia][SQLServer JDBC Driver]The SQL Server login requires an
SSL connection.
What I tried:
I created a *.keystore file and a *.cer file.
I followed this (https://usermanual.wiki/adobe/CF11Configen.762142204/html#pf2f) instruction and tried to add the keystore file to the CF Administrator:
According to Data Source Management for ColdFusion > Enabling SSL Connection what you need is a truststore. The JVM used by ColdFusion already has a default truststore configured, typically jre\lib\security\cacerts, so no need to create one. Though depending on the server certificate, it may need to be imported into the truststore. The "Enable RMI Over SSL For Data Management" setting isn't relevant. It's for Flex Integration, not datasources.
Do the following to enable SSL connection:
In the ColdFusion Administrator, go to Data & Services > Data Sources.
Select the data source to enable SSL Connection.
In the data source page, click Show Advanced Settings.
In the Connection String text box, specify the connection properties as per the SSL requirements.
The relevant SQL Server SSL connection settings are:
EncryptionMethod - Values are noEncryption and SSL
TrustStore - The (full path) of the truststore file
TrustStorePassword - The password to access the truststore file
ValidateServerCertificate - Determines whether the driver validates the certificate sent by the database, true or false.
server
HostNameInCertificate - Host name for certificate validation. (Either a literal string "host_name" or #SERVERNAME#)
Sample connection string to enable SSL and validate the server certificate:
EncryptionMethod=SSL;ValidateServerCertificate=true;HostNameInCertificate=YourServerName;TrustStore=C:\commandbox\openjdk11\jre\lib\security\cacerts;TrustStorePassword=ThePassword
Sample connection string to enable SSL without validating the server certificate:
EncryptionMethod=SSL;ValidateServerCertificate=false;TrustStore=C:\commandbox\openjdk11\jre\lib\security\cacerts;TrustStorePassword=ThePassword

JDBC driver for Microsoft SQL server connectivity with Active Directory - Integrated authentication method using Jmeter

I need to make JDBC connection using Jmeter to Microsoft SQL server which uses Active Directory - Integrated authentication method to connect to DB. Below are the setting I have done in Jmeter.
When I ran the Jmeter it shows the below exception
java.sql.SQLException: Cannot create PoolableConnectionFactory (This driver is not configured for integrated authentication.
Kindly let me know is there any setting needs to be modified to overcome this issue.
Download Microsoft JDBC Driver
Copy mssql-jdbc-6.2.2.jre8.jar to JMeter Classpath
Copy sqljdbc_auth.dll from auth\x64 folder to java.library.path or specify java.library.path property to point to this file location using either -D command-line argument or via system.properties file
Restart JMeter to pick the files up
Add integratedSecurity=true line to your JDBC URL
More information: The Real Secret to Building a Database Test Plan With JMeter

Unable to connect JDBC to sonarqube using Postgresql

When I am installing sonarqube using postgresql, I got stuck with connecting it to jdbc of Postgresql. In /opt/sonarqube/conf, I uncommented JDBC as
sonar.jdbc.username=username
sonar.jdbc.password=password.
2.sonar.jdbc.url=jdbc:postgresql://localhost/username
Additionally, below is my sonar scanner conf that I uncommented
Default SonarQube server
sonar.host.url=http://localhost:9000
PostgreSQL
sonar.jdbc.url=jdbc:postgresql://localhost/username
This is what I followed for configuring Postgres DB
This is my log file shows
2017.03.08 14:39:13 INFO web[o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://localhost/username
2017.03.08 14:39:13 ERROR web[o.a.c.c.C.[.[.[/]] Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener
java.lang.IllegalStateException: Can not connect to database. Please check connectivity and settings (see the properties prefixed by 'sonar.jdbc.').
at org.sonar.db.DefaultDatabase.checkConnection(DefaultDatabase.java:104) ~[sonar-db-5.6.6.jar:na]
Is there any other thing that I need to do for JDBC connection of Postgresql. is there is any document available for sonarqube for postgresql.
This got worked out for me
[root#sonarqube ~]# egrep "^local|^host" /var/lib/pgsql/9.5/data/pg_hba.conf
uncomment below lines in pg_hba.conf
local all all md5
host all all 127.0.0.1/32 md5
host all all ::1/128 md5

Is possible to manage an OpenShift Database with pgAdmin?

Today I want to know if it is possible to manage a PostgreSQL on OpenShift using pgAdmin, in the same way that we can manage an Amazon RDS database?
Use port forwarding on your local machine to establish a connection to your remote server:
rhc port-forward -a applicationName
Now check the output on your command line to which port the postgres database service is mapped, if available this will be 5432 by default.
A step by step documentation about port forwarding is available at Getting Started with Port Forwarding on OpenShift.
Another way would be to configure the ssh-tunnel into your connection.
Tunnel-Host would be your applications name
Username the beginning string, when ssh'ing to that connection: XXX#application-name
Identity file would be id_rsa in .ssh fodler in your home directory
password your openshift password

Resources