charlesjavelona

charlesjavelona

Deploying to Gigalixir not working

Deploying to prod on gigalixir shows: {"errors":{"detail":"Not Found"}}
No node for static files. It’s all API based.

When it’s delivered to dev it works.

$ - mix phx.server

[info] Running BujiWeb.Endpoint with cowboy 2.9.0 at 0.0.0.0:4000 (http)
[info] Access BujiWeb.Endpoint at http://localhost:4000

When it’s delivered to prod it doesn’t work

$ - MIX_ENV=prod mix phx.server
23:02:10.298 [info] Running BujiWeb.Endpoint with cowboy 2.9.0 at :::4000 (http)
23:02:10.310 [info] Access BujiWeb.Endpoint at http://${APP_NAME}.gigalixirapp.com:443

Any idea on why cowboy doesn’t show IP on prod? It crashes.

config/prod.exs

use Mix.Config

config :buji, BujiWeb.Endpoint,
  server: true,
  http: [port: {:system, "PORT"}], # Needed for Phoenix 1.2 and 1.4. Doesn't hurt for 1.3.
  url: [host: "${APP_NAME}.gigalixirapp.com", port: 443],
  secret_key_base: "${SECRET_KEY_BASE}",
  version: Mix.Project.config[:version] #To bust cache during hot updgrades

config :buji, Buji.Repo,
  adapter: Ecto.Adapters.Postgres,
  url: "${DATABASE_URL}",
  database: "",
  ssl: true,
  pool_size: 2

# For production, don't forget to configure the url host
# to something meaningful, Phoenix uses this information
# when generating URLs.
#
# Note we also include the path to a cache manifest
# containing the digested version of static files. This
# manifest is generated by the `mix phx.digest` task,
# which you should run after static files are built and
# before starting your production server.

# Do not print debug messages in production
config :logger, level: :info

First Post!

ruslandoga

ruslandoga

Any idea on why cowboy doesn’t show IP on prod?

It does show it, but it’s using ipv6 where zeros are ommited, :::4000, means it binds on all interfaces. I haven’t used gigalixir, but if I were you I’d double-check if ${APP_NAME}.gigalixirapp.com is interpreted correctly by gigalixir, since it seems like it’s not, otherwise it would’ve been replaced with env vars at

23:02:10.310 [info] Access BujiWeb.Endpoint at http://${APP_NAME}.gigalixirapp.com:443

By default neither phoenix nor elixir config support env var templates like this.

Where Next?

Popular in Questions Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: The documentation above suggests that while ...
New
JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
ashish173
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
dblack
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
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New

Other popular topics Top

9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36128 110
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
sergio
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

We're in Beta

About us Mission Statement