Database connection error while starting Dr. elephant
I am getting following error message in dr.log:
.MySQLNonTransientConnectionException: Could not create connection to database server.
Can somebody please help me in debugging the issue. @akshayrai
P.S: I am able to connect to mysql credentials provided in app-conf/elephant.conf using mysql shell
Detailed error (dr.log)
[error] c.j.b.h.AbstractConnectionHook - Failed to obtain initial connection Sleeping for 0ms and trying again. Attempts left: 0. Exception: java.lang.NullPointerException.Message:Could not create connection to database server.
Oops, cannot start the server.
Configuration error: Configuration error[Cannot connect to database [default]]
at play.api.Configuration$.play$api$Configuration$$configError(Configuration.scala:92)
at play.api.Configuration.reportError(Configuration.scala:570)
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:252)
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:243)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at play.api.db.BoneCPPlugin.onStart(DB.scala:243)
at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:88)
at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:88)
at scala.collection.immutable.List.foreach(List.scala:318)
at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:88)
at play.api.Play$$anonfun$start$1.apply(Play.scala:88)
at play.api.Play$$anonfun$start$1.apply(Play.scala:88)
at play.utils.Threads$.withContextClassLoader(Threads.scala:18)
at play.api.Play$.start(Play.scala:87)
at play.core.StaticApplication.
MySQL credentials provided in elephant.conf: db_url=localhost db_name=drelephant db_user=drelephant db_password=Test@20
application.log
2017-12-03 15:02:31,376 - [ERROR] - from com.jolbox.bonecp.hooks.AbstractConnectionHook in main Failed to obtain initial connection Sleeping for 0ms and trying again. Attempts left: 0. Exception: java.lang.NullPointerException.Message:Could not create connection to database server.
Hey,
Did you start Dr. Elephant with the directory containing elephant.conf as the first argument?
Getting the same error. Tried all steps in https://github.com/linkedin/dr-elephant/wiki/FAQ#4-database-default-is-in-an-inconsistent-state
Try after changing the mysqlConnectorVersion in Dependencies.scala which is compatible with your version of mysql. I got this error for mysql version 8.0.11 and after changing the connector version to 8.0.11, it started successfully.
for drelephant , I'm using mysql version [Server version: 8.0.11 MySQL Community Server - GPL] and receiving error connecting to mysql database, - my screenshot is below.. kindly help me get through this issue.
Thank you
#bin/start.sh /dr-elephant-2.0.13/app-conf Using config dir: /dr-elephant-2.0.13/app-conf Using config file: /app-conf/elephant.conf Reading from config file... db_url: localhost db_name: drelephant db_user: root http port: 8081 This is hadoop2.x grid. Adding Java library to path: /usr/hdp/current/hadoop-client/lib/native Starting Dr. Elephant .... error: Failed to start Dr. Elephant. Please check if this is a valid dr.E executable or logs under 'logs' directory.
LogFile:
[root@]# cat logs/application.log 2018-07-12 22:02:00,804 - [ERROR] - from com.jolbox.bonecp.hooks.AbstractConnectionHook in main Failed to obtain initial connection Sleeping for 0ms and trying again. Attempts left: 0. Exception: java.lang.NullPointerException.Message:Could not create connection to database server.
dr.log
[error] c.j.b.h.AbstractConnectionHook - Failed to obtain initial connection Sleeping for 0ms and trying again. Attempts left: 0. Exception: java.lang.NullPointerException.Message:Could not create connection to database server.
Oops, cannot start the server.
Configuration error: Configuration error[Cannot connect to database [default]]
at play.api.Configuration$.play$api$Configuration$$configError(Configuration.scala:92)
at play.api.Configuration.reportError(Configuration.scala:570)
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:252)
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:243)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at play.api.db.BoneCPPlugin.onStart(DB.scala:243)
at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:88)
at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:88)
at scala.collection.immutable.List.foreach(List.scala:318)
at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:88)
at play.api.Play$$anonfun$start$1.apply(Play.scala:88)
at play.api.Play$$anonfun$start$1.apply(Play.scala:88)
at play.utils.Threads$.withContextClassLoader(Threads.scala:18)
at play.api.Play$.start(Play.scala:87)
at play.core.StaticApplication.
Have you tried to change the mysql connector version as mentioned above, that might help
Try after changing the mysqlConnectorVersion in Dependencies.scala which is compatible with your version of mysql. I got this error for mysql version 8.0.11 and after changing the connector version to 8.0.11, it started successfully.
Hi, Where can I find that file?
@GolanPachu You can find it under project/Dependencies.scala
$ find . -name Dependencies.scala
./project/Dependencies.scala
@GolanPachu is the issue still not resolved?