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

zbsbpyhn  于 2022-11-24  发布在  Phoenix
关注(0)|答案(2)|浏览(178)

我在Heroku中部署了我的应用程序,但尽管部署成功,但在浏览器显示视图中:

错误的唯一线索在应用程序日志中:

: 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

8ehkhllq

8ehkhllq1#

我遇到了同样的问题,通过硬编码“secret_key_base”设置而不是从系统环境变量中阅读来解决它。通常不建议使用此解决方案,因为它会暴露代码库中的密钥,但它可能有助于调试问题。

1szpjjfi

1szpjjfi2#

这个问题已经有了解决方案,正如elixirforum.com中提到的,你必须把elixir版本从1.3改为1.4

相关问题