tansan

tansan

I followed their fly launch guide and it should be straightforward and it should work out of the box after they inject the DATABASE_URL, but it just keeps failing and I haven’t been able to figure out why.

Anyone here figure out how?

INFO [fly api proxy] listening at /.fly/api
  2023/08/14 07:35:35 listening on [fdaa:2:c486:a7b:d829:3bff:2a58:2]:22 (DNS: [fdaa::3]:53)
  07:35:36.341 [error] Postgrex.Protocol (#PID<0.141.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (my-app-name-db.flycast:5432): non-existing domain - :nxdomain
  07:35:36.341 [error] Postgrex.Protocol (#PID<0.140.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (my-app-name-db.flycast:5432): non-existing domain - :nxdomain
  07:35:37.693 [error] Postgrex.Protocol (#PID<0.140.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (my-app-name-db.flycast:5432): non-existing domain - :nxdomain
  07:35:38.029 [error] Postgrex.Protocol (#PID<0.141.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (my-app-name-db.flycast:5432): non-existing domain - :nxdomain
  07:35:39.302 [error] Could not create schema migrations table. This error usually happens due to the following:
    * The database does not exist

My app is using the this in runtime:

    url: System.fetch_env!("DATABASE_URL"),
    pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10")

Showing Posts 1 to 10

hubertlepicki

hubertlepicki

I suspect this is wrong?

(my-app-name-db.flycast:5432): non-existing domain - :nxdomain

Specific my-app-name-db.flycast.

Either the DATABASE _URL is wrong or you’re overwriting it in config file with example value.

tansan

tansan OP

That’s what I suspected at first as well, but it was correct. I am assuming they are doing some kind of internal routing with docker images.

slouchpie

slouchpie

Do you have this in your Repo config

socket_options: [:inet6]

?

tansan

tansan OP

I have it in my runtime, but it’s commented out. Do you think this has to something to do with it?

slouchpie

slouchpie

I remember this was a problem for me.
Fly apps communicate using IP v6.

You should have something like this in your runtime.exs

  config :my_app, MyAppWeb.Endpoint,
    server: true,
    url: [host: endpoint_host, port: 80],
    http: [
      port: 4000,
      # IMPORTANT: support IPv6 addresses
      transport_options: [socket_opts: [:inet6]]
    ]

and similarly this

  config :my_app, MyApp.Repo.Local,
    url: database_url,
    # IMPORTANT: Or it won't find the DB server
    socket_options: [:inet6],
    pool_size: 10,
tansan

tansan OP

Ah maybe that is it! Thank you for the help.

Actually, in that short time, I ended up switching over to railway.app instead. I’ve found a lot of little things a lot better in railway.app than render and fly.io. From env var management to ease of spinning up services to support. The developer experience was much better than the other two.

If anyone wants my referral link, I can send it to you!

dimitarvp

dimitarvp

Please do, I’m interested.

tansan

tansan OP

I sent you a DM. I wasn’t sure if we can post referral links here.

dimitarvp

dimitarvp

I received it, thank you!

SwampyShr3k

SwampyShr3k

I personally think all the paas(fly, render, railway) while easy to deploy end up having quite a bit of limitations as you start using them. Have found Porter to have a better dev ex and scales with you since its in your own AWS- but probably only the best option if you have credits.

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
Cxx-mlr
I’m working on a small exercise involving update_in/3, and I came up with this solution: data = %{ name: "Periodic Table", category:...
New
ChrisAmelia
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication): toke...
New
dillonoconnor
Is there any way to avoid the Hologram compiler running when using iex? It seems like the front-end code could potentially be disregarded...
New
thiagogsr
** (ArgumentError) expected :max_attempts to be a positive integer, got: {:@, [line: 10, column: 19], [{:max_attempts, [line: 10, column:...
New
unaware8150
Hello folks! So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews