This error happened to be in my logs when I did a hot upgrade for elixir application using distillery. As its clear from error, the Porcelain app was not being started after the hot upgrade. It’s already there in application list as well.
After looking around I found a solution to re-init the Porcelain application after the hot upgrade which was
def config_change(changed, _new, removed) do
EvercamMediaWeb.Endpoint.config_change(changed, removed)
ensure_porcelain_init()
:ok
end
defp ensure_porcelain_init() do
Task.async(fn ->
# Wait ten seconds after deploy and then try to reinit porcelain
:timer.sleep(10000)
Porcelain.Init.init()
end)
end
But even after doing this Porcelain app is not started and I get the error when I start any process which includes Porcelain .
When I do this
iex(4)> Porcelain.Init.init
:ok
iex(5)>
There is no error but even after that the above error still exists.
I’ve not used hot upgrades so far, but have you tried to use Application.ensure_started/2? From its description it seems to be much more what you actually want.
If Porcelain did not restart after the hot upgrade then that implies to me that it’s supervisor is set to something like transient or temporary or so, what is it set to?
Actually, there is a process already running when I deploy application. that process is running few commands for shell, e.g. ffmpeg. Is that causing any problem?
The Porcelain process should have stopped first to do hot code deploy?
Actually if you have done hot upgrades then can you tell me is there any place in Application which get called when you do upgrade? with distillery? I can reinit the application again but I dont know the place where i Can.
Not seeing the issue off-hand, it’s only called when the system sends a message to a system managed process like a GenServer. I’d have to see a SSCCE repo example to say why otherwise.