0

I keep getting an authentication error when trying to connect to a postgresql database. Here is the specific error:

[error] c.j.b.h.AbstractConnectionHook - Failed to obtain initial connection Sleeping for 0ms and trying again. Attempts left: 0. Exception: null.Message:FATAL: password authentication failed for user 

I've checked and double checked the username and password, so this is not the issue. I was able to successfully connect using psql to this very same database. Here is what my application.conf looks like

# Database configuration
# ~~~~~
# You can declare as many datasources as you want.
# By convention, the default datasource is named `default`
#
# db.default.driver=org.h2.Driver
# db.default.url="jdbc:h2:mem:play"
# db.default.user=sa
# db.default.password=""
#Database configuration using PostgreSQL database engine
db.default.driver=org.postgresql.Driver
db.default.url="jdbc:postgresql://website.com/database"
db.default.user="username"
db.default.password="password")

# Evolutions
# ~~~~~
# You can disable evolutions if needed
# evolutionplugin=disabled

# Logger
# ~~~~~
# You can also configure logback (http://logback.qos.ch/),
# by providing an application-logger.xml file in the conf directory.

# Root logger:
logger.root=ERROR

# Logger used by the framework:
logger.play=INFO

# Logger provided to your application:
logger.application=DEBUG

                                                    68,0-1        Bot

Thanks for the insight!

3
  • speculation: any special chars in the pwd being used? Commented Nov 25, 2013 at 23:46
  • it is strictly alpha-numeric Commented Nov 25, 2013 at 23:47
  • Sorry failed to read the question fully. Initial comment not valid Commented Nov 26, 2013 at 8:21

2 Answers 2

1
db.default.password="password")

the ) is a typing error? If not, remove it and try again.

Sign up to request clarification or add additional context in comments.

1 Comment

Sometimes you just have to worry about your own intelligence, thank yo u very much this was the issue :)
0
db.default.driver="org.postgresql.Driver"
db.default.url="postgres://username:password@localhost:5432/mydb"

This works fine for me, I don't event use the db.default.user and db.default.password

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.