I'm deploying LiveView for the first time and what a strange sight. Browser says Internal server error
, yet server log has no error. I deploy again with :debug
logger level ( config :logger, level: :debug
).
Started Koodikool Platform.
[info] Running PlatformWeb.Endpoint with cowboy 2.8.0 at :::4010 (http)
[info] Access PlatformWeb.Endpoint at http://app.koodikool.ee
[info] GET /
[debug] Processing with Phoenix.LiveView.Plug.index/2
Parameters: %{}
Pipelines: [:browser]
[info] Sent 500 in 1ms
[debug] Converted error :function_clause to 500 response
Great.. So what it's telling me is that there's an error with a function so it turned the error into a 500 response. Thank you very much, but what's the error??
Elixir is supposed to log all errors by default, but my experience has proven otherwise. It's not too helpful either that people in the Slack respond with "You should see something logged as an error" (actual response, no fault on their end, I'm the one not understanding my system).
Not knowing what to do I enable debug_errors: true
in the Endpoint config. So now the browser points me in the right direction:
Looking at code it's apparent that the problem is something to do with the server file structure (data directory). So I literally can't test in local. And making a staging server also beats the point since it's not identical with production.
So what are we supposed to do in this situation? Why is there no error? I'll update if I learn what I should really do.