Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application pdf_generator exited: PdfGenerator.start(:normal, []) returned an error: shutdown: failed to start child: PdfGenerator.PathAgent #69

Open
ruben44bac opened this issue Jun 10, 2020 · 2 comments

Comments

@ruben44bac
Copy link

Hi.
I have this problem when deploy my elixir project with docker, when I'm working in localhost I don't have problems, I'm using wkhtmltopdf and {:pdf_generator, ">=0.5.7"}
this is the error

22:47:37.725 [info] [alarm_handler: {:set, {:system_memory_high_watermark, []}}]
22:47:37.730 [info] Application pdf_generator exited: PdfGenerator.start(:normal, []) returned an error: shutdown: failed to start child: PdfGenerator.PathAgent
    ** (EXIT) an exception was raised:
        ** (RuntimeError) wkhtmltopdf executable was not found on your system
            (pdf_generator) lib/pdf_generator_path_agent.ex:76: PdfGenerator.PathAgent.maybe_raise/3
            (pdf_generator) lib/pdf_generator_path_agent.ex:69: PdfGenerator.PathAgent.raise_or_continue/1
            (pdf_generator) lib/pdf_generator_path_agent.ex:37: PdfGenerator.PathAgent.init_opts/1
            (elixir) lib/agent/server.ex:8: Agent.Server.init/1
            (stdlib) gen_server.erl:374: :gen_server.init_it/2
            (stdlib) gen_server.erl:342: :gen_server.init_it/6
            (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
22:47:37.731 [info] [alarm_handler: {:clear, :system_memory_high_watermark}]

this is my dockerfile:

FROM elixir:1.9.1 as builder

ENV MIX_ENV=prod

RUN apt install curl \
  && curl -sL https://deb.nodesource.com/setup_12.x | bash - \
  && apt-get install -y nodejs \
  && apt-get install -y npm

RUN apt-get update && \
    apt-get install -y --no-install-recommends wkhtmltopdf && \
    rm -rf /var/lib/apt/lists/*

RUN mix local.hex --force \
  && mix local.rebar --force
...

help!

@gutschilla
Copy link
Owner

Hi @ruben44bac ,

First of all, thanks for reporting! Looks like the executable cannot be found on path. You can either configure that path manually (see README) or ... lemme try to reproduce the error.

But before I can take a deeper look into this, I would really recommend to set the path to the wkhtmltopdf executable in the config. This should work. Please let me know if you run into further issues

@ruben44bac
Copy link
Author

Thank you!
Now I only have this problem, do you know why?

{:error,
 {:generator_failed,
  "/usr/local/bin/wkhtmltopdf: error while loading shared libraries: libXrender.so.1: cannot open shared object file: No such file or directory\n"}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants