ijdickinson

ijdickinson

I’m trying to get Honeycomb set up with my Elixir/Phoenix app. I’ve been following the guide in this blog post by Dave Lucia as a starting place.

It seemed to be going OK, but my app won’t start when I deploy it to fly.io. The error I get from flyctl logs is:

2023-03-07T15:50:11Z app[20e7bcfd] lhr [info]
{
  "Kernel pid terminated",
  application_controller,
  "{application_start_failure,
    tls_certificate_check,
    {{shutdown,
      {failed_to_start_child,tls_certificate_check_shared_state,{{badmatch,{error,enoent}
    },
    [{pubkey_os_cacerts,get,0,
      [{file,\"pubkey_os_cacerts.erl\"},{line,38}]
      },
      {tls_certificate_check_shared_state,maybe_load_authorities_trusted_by_otp,3,
      [{file,\"/app/deps/tls_certificate_check/src/tls_certificate_check_shared_state.erl\"},{line,362}]
      },
      {tls_certificate_check_shared_state,new_shared_state,2,
      [{file,\"/app/deps/tls_certificate_check/src/tls_certificate_check_shared_state.erl\"},{line,335}]
      },
      {tls_certificate_check_shared_state,handle_shared_state_initialization,2,
      [{file,\"/app/deps/tls_certificate_check/src/tls_certificate_check_shared_state.erl\"},{line,262}]
      },
      {gen_server,try_dispatch,4,
      [{file,\"gen_server.erl\"},{line,1123}]
      },
      {gen_server,handle_msg,6,
      [{file,\"gen_server.erl\"},{line,1200}]
      },
      {proc_lib,init_p_do_apply,3,
      [{file,\"proc_lib.erl\"},{line,240}]
      }
    ]
    }}},
    {tls_certificate_check_app,start,[normal,[]]}}}"
}

tls_certificate_check is not something I’ve set up, it’s added as a dependency of OpenTelemetry. So I’m not sure what it’s looking for and not finding. As far as I’ve been able to find, that’s the only diagnostic info I can locate.

Googling hasn’t given me any directions to try, so I’m feeling a bit stuck. Can anyone suggest anything to look at?

Showing Posts 1 to 7

BradS2S

BradS2S

enonet means it can’t find the file.

Do you have tls_certificate_check added as a dependency? I’m not familiar with this library but it is also possible you have to add a worker to the application file.

Or if that all checks out you might have a configuration issue where it is looking in the wrong place?

ijdickinson

ijdickinson OP

As far as I can tell, tls_certificate_check is only there as a transitive dependency of the Open Telemetry dependencies I have in my mix.exs. None of the docs that I’ve found mention any config for it, so I can believe that it’s failing to find a file, but I don’t know which one. When I have a moment (busy day, so far!) I’ll check the source code for that lib to see if it’s clearer what it’s looking for.

BradS2S

BradS2S

It looks the file that is missing/can’t find is here:

https://github.com/erlang/otp/blob/master/lib/public_key/src/pubkey_os_cacerts.erl

You can change where it is looking for the CA cert in the config.

The option type for the library is tls_client_option() which has one option: {cacertfile, client_cafile()}

This looks like it might work:

config :tls_certificate_check, file: "/path/to/ca/file.pem"

Also from the documentation it looks like you can disable it just to see it that resolves the error.

config :tls_certificate_check, use_otp_trusted_CAs: false
ijdickinson

ijdickinson OP

Thanks @BradS2S. Looking into this some more, I can reproduce the image if I run the Docker container locally, so it’s nothing to do with Fly.io. So that eliminates one variable!

On my dev machine, there are two copies of pubkey_os_cacerts.erl: one under the asdf install tree and one in /usr/lib/erlang/lib/public_key-1.13/src/. So I’m assuming it’s installed as part of the Erlang/Elixir installation.

If I shell into the Docker container, that pubkey file is nowehere in the image. I’m starting with hexpm/elixir:1.14.2-erlang-25.1.2-debian-bullseye-20221004-slim as my base image, so I’m left with two hypotheses: either I should use a different base image for my Docker build, which does contain the missing file. Or I should add a step in the Dockerfile to either copy the missing files from my local copy (which seems like a bit of a hack, tbh) or install some additional package which will provision the pubkey_os_cacerts.erl file correctly.

Anyone have any suggestions?

(PS I haven’t tried just disabling the check. Saving that for a last resort!)

BradS2S

BradS2S

Maybe add install to your docker file

RUN apt-get update
RUN apt-get install erlang-public-key

or I think this is how you do it for alpine:

RUN apk add --no-cache erlang-public-key

or just find a different docker image?

good luck :slight_smile:

ijdickinson

ijdickinson OP

In the end, the solution was to apt-get install erlang into the image.

Thanks again for your help, @BradS2S

BradS2S

BradS2S

Glad it worked out :slight_smile:

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews