humankindof

humankindof

I have had success with this even recently but Im missing something now.

I am simply attempting to connect with a remote database on a new phoenix installation.

The service is not called “postgres” buy my_app is still looking for a db named Postgres apparently.

replacing the primary database connection, not adding a second.

same result using both a clean install, or a template from fullstackphoenix.

I followed this guide

among other guides for database migrations such as:

I configure the adapter in config/devs.ex file with the appropriate credentials

  username: "NOT_postgres",
  password: "NOT_postgres",
  hostname: "remote_connection-pool_digital-ocean.com",
  database: "NOT_postgres",
  port: "25061",
  ssl: true,
  ssl_opts: [verify: :verify_peer, cacertfile: 'ca-certificate.crt'],
  stacktrace: true,
  show_sensitive_data_on_connection_error: true,
  pool_size: 10

Then any mix ecto gets this error

11:19:58.852 [error] GenServer #PID<0.398.0> terminating
** (Postgrex.Error) FATAL 08P01 (protocol_violation) no such database: postgres
    (db_connection 2.4.2) lib/db_connection/connection.ex:100: DBConnection.Connection.connect/2
    (connection 1.1.0) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib 4.1.1) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol

I am wondering where else I need to declare db credentials. Or if there is something else simple I am forgetting.

I have tried adding credential in config/test.exs but it didn’t make a difference. and considered add to runtime.exs, but runtime.exs loads database_url from system environment exports. which are set.

Any assistance would be of value. Thanks…

Showing Posts 1 to 2

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Hi @humankindof if you are editing the dev.exs file, but are doing a deployment, that wont’ work. dev.exs configures your local development environment. When you do a deployment it’s running in the prod environment, and so you need to be setting values in runtime.exs.

You’ll see your runtime.exs file has an area enclosed in this block:

if config_env() == :prod do
# put your prod postgres details here
end
humankindof

humankindof OP

That was it man. Thank You.

— All posts loaded —

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