BarelyFunctional

BarelyFunctional

Continuing on from another recent post of mine where I was helped to fix a Phoenix 1.3 app use edeliver to build it (thank you), I’m now finding I can start the production server, but can’t see the app.

Here’s what I’ve done/checked:

  • It runs locally on my mac on port 4000
  • I’m building and hosting it on the same server that has erlang installed
  • Just to be sure, I’ve tried building it with and without the erlang runtime

It’s behind an nginx reverse proxy server that hasn’t changed in settings since previously successfully built/deployed/ran a Phoenix 1.2 app on the same server.

I’m trying to understand how to read the logs in /var/log/ to see if the site is working.

Where do I start?

Showing Posts 11 to 20

BarelyFunctional

BarelyFunctional OP

Thanks Nobbz, I should have included the config/prod.exs, sorry. I’ve updated my latest post with it. However, as noted in an earlier post, uncommenting

config :phoenix, :serve_endpoints, true

or

config :phx1p3, Phx1p3Web.Endpoint, server: true

makes no difference.

I’ll get back to you with netstat -lnpt or the equivalent soon.

NobbZ

NobbZ

I only skimmed edelivers documentation, but whats the value of your MIX_ENV?

https://github.com/bitwalker/distillery/blob/master/docs/Common%20Issues.md#why-do-i-have-to-set-both-mix_env-and---env

Go on your server and try to connect to your port from dev.exs via curl, lynx, wget, whatever. If that works, try to rebuild and redeploy using MIX_ENV=prod.

jesse

jesse

Instead of just uncommenting those lines, try putting it in the config block like so instead.

config :phx1p3, Phx1p3Web.Endpoint,
#  load_from_system_env: true,
  http: [port: 8080],
  server: true,
  url: [host: "myapp.tld", port: 80],
  cache_static_manifest: "priv/static/cache_manifest.json"
BarelyFunctional

BarelyFunctional OP

Thanks jesse,

I’ve just tried that now and I’m getting this error - a new one that I haven’t seen before. I’m feeling jinxed!

mix edeliver build release production --verbose

-----> Compiling sources
Checking whether deps must be compiled for mix version 1.3.[01234]
Compiling 13 files (.ex)
Generated phx1p3 app
-----> Generating release
using mix to generate release
==> Loading configuration..
==> Assembling release..
==> Release failed, unable to load selected release
    - Make sure `rel/config.exs` has at least one release configured
    - Make sure at least one is set as default OR
    - Pass --name=<rel_name> to `mix release`
jesse

jesse

Have you run mix release.init yet?

BarelyFunctional

BarelyFunctional OP

Hey jesse,

Yeah, I ran it and it created the config.exs… which didn’t work the first time, so I’ve re initialised distillery with

$ mix release.init

and I’m getting the same error.

:frowning:

jesse

jesse

Can you post your rel/config.exs?

BarelyFunctional

BarelyFunctional OP

Thanks jesse,

$ cat rel/config.exs

# Import all plugins from `rel/plugins`
# They can then be used by adding `plugin MyPlugin` to
# either an environment, or release definition, where
# `MyPlugin` is the name of the plugin module.
Path.join(["rel", "plugins", "*.exs"])
|> Path.wildcard()
|> Enum.map(&Code.eval_file(&1))

use Mix.Releases.Config,
    # This sets the default release built by `mix release`
    default_release: :default,
    # This sets the default environment used by `mix release`
    default_environment: Mix.env()

# For a full list of config options for both releases
# and environments, visit https://hexdocs.pm/distillery/configuration.html


# You may define one or more environments in this file,
# an environment's settings will override those of a release
# when building in that environment, this combination of release
# and environment configuration is called a profile

environment :dev do
  # If you are running Phoenix, you should make sure that
  # server: true is set and the code reloader is disabled,
  # even in dev mode.
  # It is recommended that you build with MIX_ENV=prod and pass
  # the --env flag to Distillery explicitly if you want to use
  # dev mode.
  set dev_mode: false
  set include_erts: false
  set cookie: :"86$eKxz@y<XV8$)S,)o}J|nXq((%U8r@H@>[_@ikkbP?e9OD^q03l`;31kIYa>0Q"
end

environment :prod do
  set include_erts: true
  set include_src: false
  set cookie: :"*|8%iyp/*a=8GZx~IT:7qT_f<e0MIhHym4*U80{z{xT~vOLZaVwGTaR.FB;uXTac"
end

# You may define one or more releases in this file.
# If you have not set a default release, or selected one
# when running `mix release`, the first release in the file
# will be used by default

release :phx1p3 do
  set version: current_version(:phx1p3)
  set applications: [
    :runtime_tools
  ]
end

I’ve also tried setting the default release (as per my config posted earlier) with the following line changed

from:

default_environment: Mix.env()

to:

default_environment: :prod

jesse

jesse

What happens if you remove the plugin section?

href

href

Which version of Distillery are you running? 1.5.* has issues on FreeBSD.

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
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
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
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
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews