jyoost
February 4, 2022, 8:21pm
1
I am deploying an app that looks for DATABASE_URL ENV var.
I attached the database to the APP per instructions.
in the docs this paragraph does not explain what to put in fly.toml so the app can see the internal IP.
Note that for the app to be able to attach to the database it must
have private_network enabled in fly.toml. This enables it to look up
.internal addresses like the database URL. See Using Fly DNS for
further details.
please explain???
shaun
February 4, 2022, 8:36pm
2
If you provisioned your Postgres via flyctl
, this should be enabled by default. Are you hitting any errors when trying to connect?
jyoost
February 4, 2022, 8:46pm
3
@shaun
yes, ERROR:
django.db.utils.OperationalError: could not translate host name “dpg-c6rudbpt9dsa0ehlcio0” to address: Name or service not known
#29 4.803
Error error building: executor failed running [/bin/sh -c SECRET_KEY=dummy DATABASE_URL=postgres://saleor:zTYLDuAFed1fkTjp1pyBL2TWBi7hDWBT@dpg-c6rudbpt9dsa0ehlcio0/saleor python3 manage.py migrate --no-input]: exit code: 1
shaun
February 4, 2022, 8:52pm
4
@jyoost
The url structure should have the following format:
postgres://<username>:<password>@<postgres-app-name>.internal:5432
I attached the database to the APP per instructions.
Would you mind linking the instructions you were following?
Did you attach using our CLI? E.G. fly pg attach ...
?
jyoost
February 4, 2022, 8:55pm
5
@shaun
flyctl postgres attach --app djsaleor --postgres-app pg-saleor
Running flyadmin database-list
? Database “djsaleor” already exists. Continue with the attachment process? Yes
Running flyadmin user-list
Running flyadmin user-create
Running flyadmin grant-access
Postgres cluster pg-saleor is now attached to djsaleor
The following secret was added to djsaleor:
DATABASE_URL=postgres://djsaleor:305bvPK54yMaQ5q@top2.nearest.of.pg-saleor.internal:5432/djsaleor
jyoost
February 4, 2022, 9:06pm
6
@shaun
MY BAD! I had that DATABASE_URL hardcoded in my Dockerfile.
Sorry, my fault.
It deployed now. Thanks for your quick response. This platform seems to ROCK!
shaun
February 4, 2022, 9:08pm
7
@jyoost Haha, no problem at all! Glad you got it figured out!
jyoost
February 5, 2022, 5:34am
8
@sanswork my app is deploying, but the only thing in the logs is:
2022-02-05T05:29:52.397 proxy[09b8d96d] vin [error] Health check status changed ‘passing’ => ‘critical’
how do I find out why it is failing when nothing shows up in the logs?
Hi @jyoost
When a deployment fails, the first step is to look at a failed VM and see what you can figure out. …
To see the specific VM status, run fly status --all
to get a list of VMs. Find one with status failed
, then run fly vm status <id>
. This will give you a lot more information. Make sure you check the exit code, if it’s 0 it means health check failures, if it’s not zero it’s some issue crashing the process.
I’ve caved & created a PR - Steps to follow on seeing a failed health check by v1gnesh · Pull Request #49 · superfly/docs · GitHub
jyoost
February 5, 2022, 8:15pm
10
happy Saturday!
flyctl launch
An existing fly.toml file was found for app summer-fire-7886
App is not running, deploy...
Deploying summer-fire-7886
==> Validating app configuration
--> Validating app configuration done
Services
TCP 80/443 ⇢ 8000
Remote builder fly-builder-withered-forest-9872 ready
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.12 linux x86_64
[+] Building 95.8s (0/1)
[+] Building 20.8s (5/5) FINISHED
=> CACHED [internal] load remote build context 0.0s
=> CACHED copy /context / 0.0s
=> ERROR [internal] load metadata for docker.io/library/python:3.7-slim 5.4s
=> ERROR [internal] load metadata for docker.io/library/node:10 5.4s
=> ERROR [internal] load metadata for docker.io/library/python:3.7 10.4s
------
> [internal] load metadata for docker.io/library/python:3.7-slim:
------
------
> [internal] load metadata for docker.io/library/node:10:
------
------
> [internal] load metadata for docker.io/library/python:3.7:
------
Error error building: failed to solve with frontend dockerfile.v0: failed to create LLB definition: no active session for n8t4am48u2nooppecotf8zznc: context deadline exceeded
jyoost
February 5, 2022, 9:12pm
11
I ran flyctl launch a couple of times and it finally deployed and ran. WTF?