【发布时间】:2017-02-24 23:11:45
【问题描述】:
我正在将我的 heroku 数据库从业余开发者升级到标准 0(使用官方说明 https://devcenter.heroku.com/articles/upgrading-heroku-postgres-databases#upgrade-with-pg-copy-default)。
一切顺利,直到我推广新数据库并重新启动应用程序。然后我收到以下错误:
o.s.boot.SpringApplication : Application startup failed
...
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.api.FlywayException: Unable to obtain Jdbc connection from DataSource
...
Caused by: org.flywaydb.core.api.FlywayException: Unable to obtain Jdbc connection from DataSource
...
Caused by: org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "54.xxx.xx.xxx", user "u94bf9vxxxxxx", database "d2mqk0b6xxxxxx", SSL off
...
如果我再次切换回旧数据库,一切都会恢复正常。我唯一要更改的是提升的数据库。
连接到我需要注意的爱好和标准数据库之间有什么区别吗?
我的 application.yml 的相关部分如下所示:
spring:
datasource:
driverClassName: org.postgresql.Driver
url: ${JDBC_DATABASE_URL}
username: ${JDBC_DATABASE_USERNAME}
password: ${JDBC_DATABASE_PASSWORD}
flyway:
enabled: true
locations: classpath:db/migrations
任何关于如何调试它的建议也非常受欢迎。
【问题讨论】:
-
不能说我最近用过 Heroku,但你可以访问
pg_hba.conf吗?如果是这样,请提供肯定有助于隔离问题的内容。 -
很遗憾没有,这是隐藏的,不可编辑。
标签: postgresql heroku spring-boot flyway