Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[oatpp::postgresql::Executor::getConnection()]: Error. Can't connect. #3

Open
techstore56 opened this issue Oct 20, 2021 · 3 comments

Comments

@techstore56
Copy link

reproduce:

$ docker build -t example-postgresql .
$ docker run -p 8000:8000 -e CONFIG_PROFILE='dev' -t example-postgresql

D |2021-10-20 04:43:45 1634705025742559| Server:Loading configuration profile 'dev'
terminate called after throwing an instance of 'std::runtime_error'
what(): [oatpp::postgresql::Executor::getConnection()]: Error. Can't connect.

image

@lganzzzo
Copy link
Member

Hello @techstore56 ,

Most probably you don't have the database running.
Make sure that you have PostgreSQL database running at the correct address.

Also, it will be much easier to just run docker-compose up to run both database and the service.

@lizemin5235
Copy link

<migration.migrate(); // <-- run migrations. This guy will throw on error.> how to deal this error

@lganzzzo
Copy link
Member

<migration.migrate(); // <-- run migrations. This guy will throw on error.> how to deal this error

@lizemin5235 , use try - catch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants