Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Hot code upgrades do not start porcelain #41

@NilsLattek

Description

@NilsLattek

I am using https://github.com/gutschilla/elixir-pdf-generator which depends on porcelain.
Elixir: 1.4
Erlang: 19
Porcelain: 2.0.3

Everything works fine, but when I do a hot code upgrade using releases with distillery, I can get error when call the pdf/porcelain code after the upgrade:

Ranch listener MyApp.Endpoint.HTTP had connection process started with :cowboy_protocol:start_link/4 at #PID<0.24063.0> exit with reason: 
{{%Porcelain.UsageError{message: "Looks like the :porcelain app is not running. Make sure you've added :porcelain to the list of applications in your mix.exs."}, 
[{Porcelain, :driver, 0, [file: 'lib/porcelain.ex', line: 419]}, 
 {Porcelain, :"-exec/3-fun-0-", 3, [file: 'lib/porcelain.ex', line: 131]}, 
 {Porcelain, :catch_throws, 1, [file: 'lib/porcelain.ex', line: 273]}, 
 {PdfGenerator, :generate, 2, [file: 'lib/pdf_generator.ex', line: 136]}, 
 {PdfGenerator, :generate_binary, 2, [file: 'lib/pdf_generator.ex', line: 188]}, 
 ...
]}, 
{MyApp.Endpoint, :call, [
  %Plug.Conn{ ... }}

When I restart my application/release it works again. So this currently prevents me from using hot code upgrades. Everything else works after the upgrade.
Porcelain is added in the mix.exs file:

def application do
    [mod: {MyApp, []},
     extra_applications: [
       :logger,
       :runtime_tools,
       :misc_random,
       :porcelain
      ]
    ]
  end

I also tried to add it to the distillery release config, without a difference.
Any ideas? Is it better to post this on pdf_generator or distillery issue tracker?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions