You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When http (or https) config is provided but doesn't include the port, the emitted error should be clear.
Actual behavior
The emitted error is very cryptic, and doesn't provide a useful clue for fixing it:
** (EXIT from #PID<0.95.0>) shutdown: failed to start child: SamplePhoenix.Endpoint
** (EXIT) an exception was raised:
** (RuntimeError) could not find persistent term for endpoint SamplePhoenix.Endpoint. Make sure your endpoint is started and note you cannot access endpoint functions at compile-time
lib/phoenix/endpoint.ex:536: SamplePhoenix.Endpoint.persistent!/0
lib/phoenix/endpoint.ex:544: SamplePhoenix.Endpoint.url/0
(phoenix 1.7.2) lib/phoenix/endpoint/supervisor.ex:425: Phoenix.Endpoint.Supervisor.log_access_url/2
(phoenix 1.7.2) lib/phoenix/endpoint/supervisor.ex:17: Phoenix.Endpoint.Supervisor.start_link/3
The minimal script to reproduce the bug:
# modified version of https://github.com/wojtekmach/mix_install_examplesApplication.put_env(:phoenix,:json_library,Jason)Application.put_env(:sample,SamplePhoenix.Endpoint,http: [ip: {127,0,0,1}],server: true,secret_key_base: String.duplicate("a",64))Mix.install([{:plug_cowboy,"~> 2.5"},{:jason,"~> 1.0"},{:phoenix,"~> 1.7.0"}])defmoduleSamplePhoenix.EndpointdousePhoenix.Endpoint,otp_app: :sampleendSupervisor.start_link([SamplePhoenix.Endpoint],strategy: :one_for_one)
To fix the error, we must add the port to the http settings, which is completely not obvious from the given error.
I've just had two issues reported in the site_encrypt library related to this bug. Here's one: sasa1977/site_encrypt#48. I could detect this situation in the library code and raise the error before forwarding to Phoenix, but I think it would be better if a more informative error is reported directly in Phoenix.
The text was updated successfully, but these errors were encountered:
I've experienced the same issue, was only able to solve because of your issue. Thank you @sasa1977 ❤️ !
In my case I'm using main_proxy and it is not obvious at all that you have to set a port to the endpoint that will not even be provided by a port.
Another thing to mention is that the ip is also necessary, tried with just the port configuration and it didn't work.
hi @williamweckl we're also using main_proxy and running into the same issue—how did you end up solving it? we don't even have http or https configs for our non-proxy apps
Environment
Expected behavior
When http (or https) config is provided but doesn't include the port, the emitted error should be clear.
Actual behavior
The emitted error is very cryptic, and doesn't provide a useful clue for fixing it:
The minimal script to reproduce the bug:
To fix the error, we must add the port to the http settings, which is completely not obvious from the given error.
I've just had two issues reported in the site_encrypt library related to this bug. Here's one: sasa1977/site_encrypt#48. I could detect this situation in the library code and raise the error before forwarding to Phoenix, but I think it would be better if a more informative error is reported directly in Phoenix.
The text was updated successfully, but these errors were encountered: