sushant12
Issue deploying to gigalixir - (RuntimeError) connect raised KeyError exception: key :database not found
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.
Marked As Solved
jesse
Just a guess, but try replacing StipeWeb.Repo with Stipe.Repo
4
Also Liked
jesse
No worries! It’s actually a very common error. I see it almost everyday.
4
Popular in Questions
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
For example for a current url like
http://localhost:4000/cosmetic/products?_utf8=✓&query=perfume&page=2,
I would like to get:
...
New
Hello everybody,
usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
Hi,
I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
Hi guys, i’m new in the Elixir world, and i have to say, that i love it!
i’m having some problem to understand anonymous functions with ...
New
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
I have a User schema with a :from_id field set to type :string:
defmodule TweetBot.Repo.Migrations.CreateUsers do
use Ecto.Migration
...
New
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
Lets say i have map like this fetching from my database
%{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => "XX...
New
Other popular topics
Hello!
tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability.
After spen...
New
Hello guys,
I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine)
This is a plugin that adds support for Elixir to JetBrains IntelliJ...
New
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar.
I p...
New
I am trying to run a deploy with docker and I successfully runned with this command:
docker build -t romenigld/blog-prod .
but when I t...
New
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New








