MuleSoft · Database Connector
Could not obtain connection from data source
Short answer
Could not obtain connection from data source appears when a Mule app with a CloudHub static IP runs its database connectivity test at deployment before the static IP is assigned. Set the system property -DdoTestConnectivity=false.
VerifiedLast verified
01Error text
Could not obtain connection from data source02Likely causes
- The app is deployed to CloudHub with a static IP, and the connectivity test runs before the static IP is assigned.
- The database only accepts connections from that static IP, so the test connection is refused.
03How to fix it
- Confirm the app uses a CloudHub static IP and that the database allowlists it.
- Set the system property
-DdoTestConnectivity=falseso the connectivity test is skipped at deployment. - Deploy the app again.
04Official documentation
→Related errors
- DB:CONNECTIVITYDB:CONNECTIVITY covers several possible connection problems in Database Connector, including a poorly configured connection, no response from the database and a lost connection. Check the connection configuration first, then add a reconnection strategy.
- DB:CANNOT_REACHDB:CANNOT_REACH means Database Connector cannot establish a connection with the RDBMS. Check the host and port in the Database configuration and the network path from the app to the database server.
Test every fix in a non-production environment before you apply it to production. See how entries are verified.
More for MuleSoft work:Open MuleSoft jobsMuleSoft rates and salariesHire a senior MuleSoft developer