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

10.7.4.2 Deploy to Digital Ocean Fails #269

Open
juddtaylor opened this issue Oct 29, 2024 · 1 comment
Open

10.7.4.2 Deploy to Digital Ocean Fails #269

juddtaylor opened this issue Oct 29, 2024 · 1 comment

Comments

@juddtaylor
Copy link

Everything is working in CI, and on local. Code doesn't look wildly different than what's on here for root-chapter-10-part2 (configuration files, Dockerfile, CI general.yml, and DO spec.yaml).

When deploying it builds fine, but fails at the deploy step, showing only these 2 lines in the log:

[2024-10-29 18:27:58] {"v":0,"name":"zero2prod","msg":"Failed to open `.pgpass` file: Os { code: 2, kind: NotFound, message: \"No such file or directory\" }","level":40,"hostname":"zero2prod-*****","pid":1,"time":"2024-10-29T18:27:58.90837181Z","target":"sqlx_postgres::options::pgpass","line":46,"file":"/usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-postgres-0.8.2/src/options/pgpass.rs","path":"/root/.pgpass"}
[2024-10-29 18:27:58] Error: Connection refused (os error 111)

I'll admit I haven't deployed to DO in quite a few chapters now, but it was working previously. I get the same result doing a docker run zero2prod from the command line.

I'm guessing this is a failed connection to the database?

@jdeinum
Copy link

jdeinum commented Dec 9, 2024

The first line in your logs is just a warning, see here for an explanation of why you're getting that and how to suppress it.

As for your your question, I would suspect you are correct. My best guess would be that your postgres instance isn't actually running or is listening on a non standard port. If you're running the database with docker, make sure that the container is running before you run your code/tests.

This however is a guess. If you provide some more context (docker logs, db config, etc), I could try to help more (assuming you haven't figured it out yet).

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

2 participants