在Heroku中部署Phoenix应用程序,但会导致应用程序错误

时间:2017-03-31 02:43:45

标签: heroku deployment web-deployment phoenix-framework phoenix

我在Heroku中部署了我的应用程序,但是虽然部署正常,但在浏览器show view中:

enter image description here

错误的唯一线索是申请记录:

  : State changed from crashed to starting
2017-03-31T020 heroku[web.1]: Process exited with status 1
1]: Starting process with command `MIX_ENV=prod mix phoenix.server`

 =INFO REPORT==== 31-Mar-2017::02:20:04 ===
     application: boom_one
     exited: {{shutdown,
               {failed_to_start_child,'Elixir.BoomOne.Endpoint',
                {shutdown,
                 {failed_to_start_child,'Elixir.Phoenix.Endpoint.Server',
                  {shutdown,
                   {failed_to_start_child,
                    {ranch_listener_sup,'Elixir.BoomOne.Endpoint.HTTP'},
                    {'EXIT',
                     {noproc,
                      {gen_server,call,
                       [ranch_server,
                        {set_new_listener_opts,'Elixir.BoomOne.Endpoint.HTTP',
                         16384,
                         [{env,
                             [{'_',[],
                               [{[<<"socket">>,<<"websocket">>],
                           [{dispatch,
                                 [],'Elixir.Phoenix.Endpoint.CowboyWebSocket',
                                 {'Elixir.Phoenix.Transports.WebSocket',
                                  {'Elixir.BoomOne.Endpoint',
                                   'Elixir.BoomOne.UserSocket',websocket}}},
                                 {'Elixir.BoomOne.Endpoint',
                                {'_',[],'Elixir.Plug.Adapters.Cowboy.Handler',
                                  []}}]}]}]}]}]}}}}}}}}},
              {'Elixir.BoomOne',start,[normal,[]]}}
     type: permanent
 ** (exit) exited in: GenServer.call(Mix.State, {:get, {Map, :get, [:debug, false]}}, 5000)
     ** (EXIT) no process
     (mix) lib/mix/cli.ex:65: Mix.CLI.run_task/2
     (elixir) lib/code.ex:363: Code.require_file/2
     (elixir) lib/gen_server.ex:596: GenServer.call/3

 {"init terminating in do_boot",{noproc,{gen_server,call,[elixir_config,{get_and_put,at_exit,[]}]}}}

 init terminating in do_boot ()
 Crash dump is being written to: erl_crash.dump...done
1]: Process exited with status 1
1]: State changed from starting to crashed

我遵循了phoenix page tutorial on heroku

提前致谢!

2 个答案:

答案 0 :(得分:0)

我遇到了同样的问题并通过硬编码解决了这个问题&#34; secret_key_base&#34;设置而不是从系统环境变量读取。通常不推荐使用此解决方案,因为它在代码存储库中公开了密钥,但它可能有助于调试问题。

答案 1 :(得分:0)

问题有解决方案:

https://elixirforum.com/t/deploy-phoenix-application-in-heroku-but-result-in-application-error/4394/5

如何看待,将我的灵药从1.3换成1.4版本

谢谢!