sushant12

sushant12

I am having an issue deploying my phoenix app to gigalixir.

2019-09-24T01:05:40.350124+00:00 stipe[stipe-767f97457f-657ng]: web.1  | ** (RuntimeError) connect raised KeyError exception: key :database not found. The exception details are hidden, as they may contain sensitive data such as database credentials. You may set :show_sensitive_data_on_connection_error to true when starting your connection if you wish to see all of the details
2019-09-24T01:05:40.350152+00:00 stipe[stipe-767f97457f-657ng]: web.1  |     (elixir) lib/keyword.ex:393: Keyword.fetch!/2
2019-09-24T01:05:40.350182+00:00 stipe[stipe-767f97457f-657ng]: web.1  |     (postgrex) lib/postgrex/protocol.ex:92: Postgrex.Protocol.connect/1
2019-09-24T01:05:40.350260+00:00 stipe[stipe-767f97457f-657ng]: web.1  |     (db_connection) lib/db_connection/connection.ex:69: DBConnection.Connection.connect/2
2019-09-24T01:05:40.350286+00:00 stipe[stipe-767f97457f-657ng]: web.1  |     (connection) lib/connection.ex:622: Connection.enter_connect/5
2019-09-24T01:05:40.350315+00:00 stipe[stipe-767f97457f-657ng]: web.1  |     (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
2019-09-24T01:05:40.350334+00:00 stipe[stipe-767f97457f-657ng]: web.1  | Last message: nil
2019-09-24T01:05:40.350452+00:00 stipe[stipe-767f97457f-657ng]: web.1  | 01:05:40.270 [error] GenServer #PID<0.1683.0> terminating
2019-09-24T01:05:40.350459+00:00 stipe[stipe-767f97457f-657ng]: web.1  | ** (RuntimeError) connect raised KeyError exception: key :database not found. The exception details are hidden, as they may contain sensitive data such as database credentials. You may set :show_sensitive_data_on_connection_error to true when starting your connection if you wish to see all of the details
2019-09-24T01:05:40.350460+00:00 stipe[stipe-767f97457f-657ng]: web.1  |     (elixir) lib/keyword.ex:393: Keyword.fetch!/2
2019-09-24T01:05:40.350463+00:00 stipe[stipe-767f97457f-657ng]: web.1  |     (postgrex) lib/postgrex/protocol.ex:92: Postgrex.Protocol.connect/1
2019-09-24T01:05:40.350504+00:00 stipe[stipe-767f97457f-657ng]: web.1  |     (db_connection) lib/db_connection/connection.ex:69: DBConnection.Connection.connect/2
2019-09-24T01:05:40.350585+00:00 stipe[stipe-767f97457f-657ng]: web.1  |     (connection) lib/connection.ex:622: Connection.enter_connect/5
2019-09-24T01:05:40.350620+00:00 stipe[stipe-767f97457f-657ng]: web.1  |     (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
2019-09-24T01:05:40.350645+00:00 stipe[stipe-767f97457f-657ng]: web.1  | Last message: nil
2019-09-24T01:05:40.350692+00:00 stipe[stipe-767f97457f-657ng]: web.1  | 01:05:40.271 [info] Application stipe exited: shutdown
2019-09-24T01:05:40+00:00 stipe[gigalixir]: Readiness probe failed: dial tcp 10.56.12.134:4000: connect: connection refused
2019-09-24T01:05:41.359831+00:00 stipe[stipe-5c6c65949d-84thz]: web.1  | {"Kernel pid terminated",application_controller,"{application_terminated,stipe,shutdown}"}
2019-09-24T01:05:41.359881+00:00 stipe[stipe-5c6c65949d-84thz]: web.1  | Kernel pid terminated (application_controller) ({application_terminated,stipe,shutdown})
2019-09-24T01:05:41.362196+00:00 stipe[stipe-5c6c65949d-84thz]: web.1  | 
2019-09-24T01:05:41.782657+00:00 stipe[stipe-767f97457f-657ng]: web.1  | {"Kernel pid terminated",application_controller,"{application_terminated,stipe,shutdown}"}
2019-09-24T01:05:41.782745+00:00 stipe[stipe-767f97457f-657ng]: web.1  | Kernel pid terminated (application_controller) ({application_terminated,stipe,shutdown})
2019-09-24T01:05:41.786425+00:00 stipe[stipe-767f97457f-657ng]: web.1  | 
2019-09-24T01:05:43+00:00 stipe[gigalixir]: Readiness probe failed: dial tcp 10.56.12.134:4000: connect: connection refused

And this is my prod.exs file

config :stipe, StipeWeb.Endpoint,
  load_from_system_env: true,
  # Needed for Phoenix 1.2 and 1.4. Doesn't hurt for 1.3.
  http: [port: {:system, "PORT"}],
  # Without this line, your app will not start the web server!
  server: true,
  secret_key_base: "${SECRET_KEY_BASE}",
  url: [host: "${APP_NAME}.gigalixirapp.com", port: 443],
  cache_static_manifest: "priv/static/cache_manifest.json"

config :stipe, StipeWeb.Repo,
  adapter: Ecto.Adapters.Postgres,
  url: "${DATABASE_URL}",
  database: "",
  ssl: true,
  show_sensitive_data_on_connection_error: true,
  # Free tier db only allows 4 connections. Rolling deploys need pool_size*(n+1) connections where n is the number of app replicas.
  pool_size: 2

I wonder why it cant connect to db as mentioned in the logs. And even with the show_sensitive_data_on_connection_error: true, enabled I still see the enable it to show sensitive info message in the log

Also I am using distillery.

Showing Posts 1 to 3

jesse

jesse

Just a guess, but try replacing StipeWeb.Repo with Stipe.Repo

sushant12

sushant12 OP

this is so embarassing. I didnt even see it was namespaced under StipeWeb. I wish the error was more verbose and told me that there is no repo inside StipeWeb.

jesse

jesse

No worries! It’s actually a very common error. I see it almost everyday.

— All posts loaded —

Where Next? Top

Trending in Questions Top

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New

Other Trending Topics Top

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
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews