Elixir Phoenix closure: failed to start the child

When starting the application in production mode, the following error appears. Everything works fine on the developer's side, it can migrate, compile and release without problems in a production application, but when it starts, it will work at startup. I am sure that this is something very obvious that I am missing. I am running Erlang 19 and Elixir 1.3.2.

17: 42: 52.768 [info] The application curriculum came out: Curriculum.start (: normal, []) returned an error: shutdown: the child could not start: The curriculum. ** (EXIT) shutdown: the child could not start: Phoenix.Endpoint.Server ** (EXIT) the exception was thrown: ** (FunctionClauseError) lack of function matching in System.get_env / 1 (elixir) lib / system.ex: 358: System.get_env (4000) (phoenix) lib / phoenix / endpoint / server.ex: 34: Phoenix.Endpoint.Server.to_port / 1 (phoenix) lib / phoenix / endpoint / server.ex: 28: Phoenix.Endpoint .Server.default / 3 (phoenix) lib / phoenix / endpoint / server.ex: 17: anonymous fn / 5 in Phoenix.Endpoint.Server.init / 1 (elixir) lib / enum.ex: 1623: Enum. "- reduce / 3-lists ^ foldl / 2-0 -"/ 3 (phoenix) lib / phoenix / endpoint / server.ex: 15: Phoenix.Endpoint.Server.init / 1 (stdlib) supervisor.erl: 294 :: supervisor.init / 1 (stdlib) gen_server.erl: 328: : gen_server.init_it / 6 {"Kernel pid terminates" application_controller, "{application_start_failure, syllabus, {{shutdown, {failed_to_start_child, 'Elixir.Curriculum.Endpoint', {shutdown, {failed_to_start_child, 'Elixirndpoint.ho ', {function_clause, [{' elixir system ", get_env, [4000], [{file, \" Library / system.ex \ "}, {line, 358}]}, {'Elixir.Phoenix.Endpoint. Server ', to_port, 1, [{file \ "Library / phoenix / endpoint /server.ex \"}, {line, 34}]}, {' Elixir.Phoenix.Endpoint.Server ', default, 3, [{file, \ "Library / phoenix / endpoint /server.ex \ "}, {line, 28}]}, {'Elixir.Phoenix.Endpoint.Server', '- init / 1-fun-0 -', 5, [{file , \ "lib / phoenix / endpoint / server.ex \"}, {line, 17}]}, {'Elixir.Enum', '- reduce / 3-lists ^ foldl / 2-0 -', 3, [ {file, \ "lib / enum.ex \"}, {line, 1623}]}, {'Elixir.Phoenix.Endpoint.Server', initial, 1, [{file, \ "Library / phoenix / endpoint / server.ex \ "}, {line, 15}]}, {supervisor, initial, 1, [{file, \" supervisor.erl \ "}, {line, 294}]}, {gen_server, init_it, 6, [{file, \ "gen_server.erl \"}, {line, 328}]}]}}}}}, {'Elixir.Curriculum', beginning, [normal, []]}}}}ex \ "}, {line, 17}]}, {'Elixir.Enum', '- reduce / 3-lists ^ foldl / 2-0 -', 3, [{file, \" lib / enum.ex \ "}, {line, 1623}]}, {'Elixir.Phoenix.Endpoint.Server', initial, 1, [{file, \" Library / phoenix / endpoint /server.ex \ "}, {line, 15 }]}, {supervisor, initial, 1, [{file, \ "supervisor.erl \"}, {line, 294}]}, {gen_server, init_it, 6, [{file, \ "gen_server.erl \" }, {line, 328}]}]}}}}}, {'Elixir.Curriculum', start, [normal, []]}}}}}ex \ "}, {line, 17}]}, {'Elixir.Enum', '- reduce / 3-lists ^ foldl / 2-0 -', 3, [{file, \" lib / enum.ex \ "}, {line, 1623}]}, {'Elixir.Phoenix.Endpoint.Server', initial, 1, [{file, \" Library / phoenix / endpoint /server.ex \ "}, {line, 15 }]}, {supervisor, initial, 1, [{file, \ "supervisor.erl \"}, {line, 294}]}, {gen_server, init_it, 6, [{file, \ "gen_server.erl \" }, {line, 328}]}]}}}}}, {'Elixir.Curriculum', start, [normal, []]}}}}}}, {line, 294}]}, {gen_server, init_it, 6, [{file, \ "gen_server.erl \"}, {line, 328}]}]}}}}}, {'Elixir.Curriculum' , start, [normal, []]}}} "}}, {line, 294}]}, {gen_server, init_it, 6, [{file, \ "gen_server.erl \"}, {line, 328}]}]}}}}}, {'Elixir.Curriculum' , start, [normal, []]}}} "}

Prod.exs

http: [port: {:system, 4000}],url: [host: "example.com"],cache_static_manifest: "priv/static/manifest.json",server: true
config :phoenix, :serve_endpoints, true

import_config "prod.secret.exs"
+4
1

port config/prod.exs . :

port: 4000

4000 :

port: {:system, "PORT"}

port ( ).

+2

Source: https://habr.com/ru/post/1650059/


All Articles