Closed punitcse closed 6 years ago
You have a lot of dependencies in :included_applications
, is that for a particular reason? If you aren't starting those manually, and they are required by your application, then things will definitely be broken. You should only use :included_applications
if you truly need to control those applications lifecycles.
In any case, this looks like you are probably missing the requisite Phoenix configuration to start the server. You need to set server: true
in the endpoint configuration in config.exs
or prod.exs
(usually the latter). Can you confirm whether that's the case? You can also run bin/trackbees remote_console
and dump your config at the shell with Application.get_all_env(:trackbees)
Sure I will remove included application.
I have already add server: true
in prod.ex file. Here is the output for Application.get_all_env(:trackbees)
....
{Trackbees.Endpoint,
[
secret_key_base: "hDq+GvvUL88RGa4oiTHODlb0oAQcGu041l9tF2DxEYzjDS0TyHQt7FxVI1RuDBIQ",
render_errors: [view: Trackbees.ErrorView, accepts: ["html", "json"]],
check_origin: false,
pubsub: [name: Trackbees.PubSub, adapter: Phoenix.PubSub.PG2],
http: [port: 4000],
load_from_system_env: true,
server: true,
code_reloader: false
]},
...
I am wondering why I am not getting the url
when I have added it to both config and prod.ex file.
I'm closing this for now. If you are able to find a reproduction with a smaller application, or can provide me access to this one, I can try to troubleshoot that way. My strong suspicion is that this is due to how you are using :included_applications
, and something is being missed. Furthermore, :jsx
is missing from the release, which is likely to cause issues - you need to fix that warning before we trying to reproduce. If you are adding :jsx
to :included_applications
, but not starting it, and other dependencies require it in their :applications
lists, they will not start. You should avoid using :included_applications
unless specifically needed - especially in the quantity seen, as the odds of conflicts are extremely high.
As far as the configuration issue goes, without seeing the original configuration files, I can't say why the value you are expecting isn't coming through. It may help to also know what version of Distillery this is happening with.
Feel free to reopen this issue if you can provide additional information that will help me troubleshoot (particularly a way to reproduce the case), but at this point I can neither reproduce, nor have enough information to provide much in the way of help, beyond the suggestions I've already made.
Steps to reproduce
Create the build using command
MIX_ENV=prod mix release --env=prod --verbose
. It successfully creates the build and I can able to run theconsole
andping
. Even when I run the start command it successfully started but when I go to htttp://localhost:4000, server does not run.Expected result
When I run
PORT=4000 _build/prod/rel/trackbees/bin/trackbees start
it should start the daemon and I can see the localhost:4000 running. I also could not able to see any log while checking withPORT=4000 _build/prod/rel/trackbees/bin/trackbees foreground
command.Verbose Logs
What OS, Erlang/Elixir versions are you seeing this issue on?
MacOS version: 10.13.2, elixir: Elixir 1.6.5 (compiled with OTP 19), otp: Erlang/OTP 20
rel/config.exs
, as it is often my first troubleshooting question, and you'll save us both time :)use Mix.Releases.Config,
This sets the default release built by
mix release
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: true set include_erts: false set cookie: :"TC__ke}MFh8DTsfg4E5;(7ob8h???wN@AIC<TYaJ4_yg).Q)V5[,PNysMr}S1q" end
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 filewill be used by default
release :trackbees do set version: current_version(:trackbees) set applications: [ :runtime_tools ] end