I have created the build using command MIX_ENV=prod mix release --env=prod --verbose
. It successfully creates the build and I can able to run the console
and ping
commands and give me the pid
. Even when I run the start command it successfully started but when I go to htttp://localhost:4000
, the server does not run. When I run _build/prod/rel/project/bin/project foreground
command it just hangs in there with no output.
I am using MacOS version: 10.13.2, elixir: 1.6.5 (compiled with OTP 19), otp: Erlang/OTP 20. Here is the log
$ MIX_ENV=prod mix release --env=prod --verbose
Generated project app
==> Loading configuration..
==> Assembling release..
==> Building release project:0.0.1 using environment prod
==> One or more direct or transitive dependencies are missing from
:applications or :included_applications, they will not be included
in the release:
:jsx
This can cause your application to fail at runtime. If you are sure that this is not an issue, you may ignore this warning.
==> Release successfully built!
You can run it in one of the following ways:
Interactive: _build/prod/rel/project/bin/project console
Foreground: _build/prod/rel/project/bin/project foreground
Daemon: _build/prod/rel/project/bin/project start
I have already included all the application that shows as warning except jsx
because it shows an error of undefined application.
I have also gone through the distillery issue https://github.com/bitwalker/distillery/issues/276 and as this issue suggest I checked my app name and server is true set in the config file so it did not help. I have also logged issue here https://github.com/bitwalker/distillery/issues/433 in more detail.
Here is my release file config
environment :prod do
set include_erts: true
set include_src: false
set cookie: :"lfHBC,7lDxe6kbZJ%M.x4=r!>[F*DhL)ly`?d$>%iE=9y)V4_Oulis?4Rvm)~!55"
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 :project do
set version: current_version(:project)
set applications: [
:runtime_tools
]
end
When I tried to create a new phoenix application and do the same it runs properly and listen to port 4000 and output foreground command but with the same configuration in my application, it does not listen 4000 port and hangs on foreground command. When I see the netstat
for both it seems that 4000 port is not running for my app see
I am not sure how else I should debug this problem I tried all things I could. Please let me know if anyone needs any more information. I would appreciate any help/suggestion in this regard.
EDIT: Here are my config and prod files.I just pasted the endpoint detail let me know if anything else needed.
# config.exs
config :project, Project.Endpoint,
url: [host: "localhost"],
secret_key_base: some_secret_key,
render_errors: [view: Project.ErrorView, accepts: ~w(html json)],
check_origin: false,
pubsub: [name: Project.PubSub, adapter: Phoenix.PubSub.PG2]
# prod.exs
config :project, Project.Endpoint,
http: [port: 4000],
url: [scheme: "https", host: "server.example.com", port: 443],
server: true,
code_reloader: false