postgresql - Play Framework trying to access DB with windows username -
i have db.conf looks in conf folder:
db.default.driver=org.postgresql.driver db.default.url="jdbc:postgresql://62.210.145.112/babybets" db.default.username=postgres db.default.password="my_password"
it included in application.conf:
include "db.conf"
infos correct, use same jdbc connection string, user/pass connect intellij db view database.
when try access page, error:
play.api.configuration$$anon$1: configuration error[cannot connect database [default]] @ play.api.configuration$.play$api$configuration$$configerror(configuration.scala:94) ~[play_2.10-2.3.8.jar:2.3.8] @ play.api.configuration.reporterror(configuration.scala:743) ~[play_2.10-2.3.8.jar:2.3.8] @ play.api.db.bonecpplugin$$anonfun$onstart$1.apply(db.scala:247) ~[play-jdbc_2.10-2.3.2.jar:2.3.2] @ play.api.db.bonecpplugin$$anonfun$onstart$1.apply(db.scala:238) ~[play-jdbc_2.10-2.3.2.jar:2.3.2] @ scala.collection.traversablelike$$anonfun$map$1.apply(traversablelike.scala:244) ~[scala-library-2.10.5.jar:na] caused by: org.postgresql.util.psqlexception: fatal: password authentication failed user "john" @ org.postgresql.core.v3.connectionfactoryimpl.doauthentication(connectionfactoryimpl.java:293) ~[postgresql-9.1-901-1.jdbc4.jar:na] @ org.postgresql.core.v3.connectionfactoryimpl.openconnectionimpl(connectionfactoryimpl.java:108) ~[postgresql-9.1-901-1.jdbc4.jar:na] @ org.postgresql.core.connectionfactory.openconnection(connectionfactory.java:66) ~[postgresql-9.1-901-1.jdbc4.jar:na] @ org.postgresql.jdbc2.abstractjdbc2connection.<init>(abstractjdbc2connection.java:125) ~[postgresql-9.1-901-1.jdbc4.jar:na] @ org.postgresql.jdbc3.abstractjdbc3connection.<init>(abstractjdbc3connection.java:30) ~[postgresql-9.1-901-1.jdbc4.jar:na]
in above can see tries connect database using windows login "john".
i went through project agent ransack , tried following (case insensitive) regex:
[^\\]john[^\\]
it matches above error log.
question: why play using windows login connect db? how prevent ?
just info build.sbt looks this:
name := "babybets2" version := "1.0" lazy val `babybets2` = (project in file(".")).enableplugins(playscala) scalaversion := "2.10.5" librarydependencies ++= seq( cache , ws ) librarydependencies ++= seq("postgresql" % "postgresql" % "9.1-901-1.jdbc4", "com.typesafe.play" %% "play-slick" % "0.8.0", "ws.securesocial" %% "securesocial" % "2.1.4" ) unmanagedresourcedirectories in test <+= basedirectory ( _ /"target/web/public/test" )
ok crazy, there difference between play versions:
https://www.playframework.com/documentation/2.4.x/scaladatabase https://www.playframework.com/documentation/2.3.x/scaladatabase
db.default.username=postgres
vs
db.default.user=postgres
so apparently, if no user provided, play displays no useful error messages , tries connect windows login!
Comments
Post a Comment