Mix edeliver start production response is "Received 'pang' from ... "

I want to make a hot-swapping elixir code using edeliver and distillary but without phoenix.
This is my code :

defmodule Countup do
  use GenServer

  def start_link do
    GenServer.start_link(__MODULE__, 1)
  end

  def init(state) do
    send(self(), {:increment, 2})
    {:ok, state}
  end

  def handle_info({:increment, value}, state) do
    mystate = state + value
    IO.puts(mystate)
    Process.send_after(self(), {:increment, value}, 1_000)
    {:noreply, mystate}
  end

end

I am using :

{:edeliver, "~> 1.6"},
{:distillery, "~> 2.0"} 

and learn the step from :
https://www.digitalocean.com/community/tutorials/how-to-automate-elixir-phoenix-deployment-with-distillery-and-edeliver-on-ubuntu-16-04

Well, “response : recieve pang” already show up in this forum at :
https://elixirforum.com/t/mix-edeliver-start-production-cookie-mismatch-help/15937/13
I succeeded (do hot swapping) when using phoenix but failed when I didn’t use phoenix (in this code)

when I excecute ‘mix edeliver start production’, it result :

EDELIVER COUNTUP WITH START COMMAND

-----> starting production servers

production node:

  user    : sammy
  host    : example.com
  path    : /home/sammy/app_release
  response: ▸  Received 'pang' from countup@127.0.0.1!
▸  Possible reasons for this include:
▸    - The cookie is mismatched between us and the target node
▸    - We cannot establish a remote connection to the node
▸  Received 'pang' from countup@127.0.0.1!
▸  Possible reasons for this include:
▸    - The cookie is mismatched between us and the target node
▸    - We cannot establish a remote connection to the node


START DONE!

Any suggestions, reading or ways to navigate this?

Try it by using distillery, not edeliver, there’s no need for edeliver in this situation and it makes testing more difficult.

I can solve it by replace it using :

{:edeliver, “~> 1.6”},
{:distillery, “~> 2.0”}

I think edeliver pings before the app is ready. Every time I’v started an app with edeliver I received pang from the server. Running mix edeliver ping production right after should return pong.

Thanks for the information @ OvermindDL1 and mikemccall

1 Like