runyonave

runyonave

Cannot get chromic_pdf to run in prod environment

We have been stuck on this for a few days now and I am really not sure what could be missing. I can get chromic_pdf to work perfectly fine on my dev environment. I.e. it can render and store PDFs from HTML without any issue.In terms of setting it up:

mix.exs:

{:chromic_pdf, "~> 1.17"}

runtime.exs

  config :tailboard, :pdf, url: System.fetch_env!("APP_URL")

  config :chromic_pdf,
    chrome_executable: System.get_env("CHROME_PATH"),
    discard_stderr: false,
    chrome_args: [
      "--no-sandbox",
      "--disable-dev-shm-usage",
      "--disable-gpu",
      "--disable-setuid-sandbox",
      "--disable-software-rasterizer",
      "--enable-logging=stderr",
      "--headless"
    ],
    log_level: :info,
    temp_dir: "/tmp/app"

application.exs

  def start(_type, _args) do
    TailboardWeb.AllowedAddressList.start()

    # Define workers and child supervisors to be supervised
    children = [
      ...other modules

      ChromicPDF
    ]

    # See https://hexdocs.pm/elixir/Supervisor.html
    # for other strategies and supported options
    opts = [strategy: :one_for_one, name: Tailboard.Supervisor]
    Supervisor.start_link(children, opts)
  end

In Dockerfile I get these dependencies:

RUN apt-get update -y && \
  apt-get install -y \
    libstdc++6 openssl libncurses5 locales ca-certificates chromium \
    libnss3 libfreetype6 libharfbuzz0b fonts-freefont-ttf imagemagick \
    tini fontconfig curl \
  && apt-get clean && rm -f /var/lib/apt/lists/*_*

Is there anything I am missing?

First Post!

windexoriginal

windexoriginal

Are you running Google Chrome rather than Chromium on your dev machine? Google Chrome is run from a different directory and started with a different command (“chrome” vs “chromium-browser”), which may be causing the issues in your container.

Where Next?

Popular in Troubleshooting Top

Ferenc
I have installed it on Phoenix 1.8.1 (without authentication or other packages and got 2 problems). I had to set up things manually the ...
New
jdj_dk
Hi everyone. I’m trying to setup a small cluster with three nodes. I’m using libcluster as I have before. But my nodes doesn’t have a us...
New
mohammedzeglam
I am trying deploy phoenix app to cloud run every thing works locally fine using public IP but when i deployed to cloud run the app could...
New
jason.o
I don’t get an error directly related to Paraxial, but removing that dependency stopped the crash. Has anyone experienced a similar issu...
New
michaelterryio
Hey, I’ve got a project with several path dependencies. Some are phoenix apps, but this likely isn’t relevant. I don’t fully understand...
New
arnoldwolfe
I’ve been unable to deploy apps for over a week now due to the following error. It all started when Github has issues with GitHub Actions...
New
onelastdance
Hey there, Using the install script method recommended here on Ubuntu 24.04: And then running the following commands: iex> :obser...
New
klo
Is there any way to go from a float 1.0 to 1.00 while retaining the float() type?
New
rayex
Hi, I am using the following versions: Erlang/OTP 27 [erts-15.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns] El...
New
apoorv-2204
The Issue of Enums in Elixir Elixir doesn’t have a native enum construct, so we usually rely on atoms, strings, or macros to represent na...
New

Other popular topics Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
New

We're in Beta

About us Mission Statement