mjml_nif icon indicating copy to clipboard operation
mjml_nif copied to clipboard

Error while downloading NIF

Open cblavier opened this issue 2 years ago • 3 comments

Hey there,

My CI is constantly failing with this error:

12:59:54.780 [notice] TLS :client: In state :hello_middlebox_assert at ssl_gen_statem.erl:736 generated 
CLIENT ALERT: Fatal - Unexpected Message 03:23
834 - {:unexpected_msg, {:internal, {:encrypted_extensions, %{sni: {:sni, []}}}}} 03:23
835  03:23
836== Compilation error in file lib/mjml.ex == 03:23
837** (RuntimeError) Error while downloading precompiled NIF: couldn't fetch NIF from 
https://github.com/adoptoposs/mjml_nif/releases/download/v1.3.5/libmjml_nif-v1.3.5-nif-2.16-x86_64-unknown-linux-
gnu.so.tar.gz: {:error, {:failed_connect, [{:to_address, {'objects.githubusercontent.com', 443}}, {:inet, [:inet], {:tls_alert,
{:unexpected_message, 'TLS client: In state hello_middlebox_assert at ssl_gen_statem.erl:736 generated CLIENT ALERT: Fatal -
Unexpected Message\n {unexpected_msg,{internal,{encrypted_extensions,\#{sni => {sni,[]}}}}}'}}}]}}.

Using Erlang 25.0 / Elixir 1.13.4

Any idea what's going on?

cblavier avatar Sep 08 '22 13:09 cblavier

Thanks @cblavier for opening the issue. Currently I don't really have an idea why it failed. From the precompiled NIF side the lib should be available at the given URI: https://github.com/adoptoposs/mjml_nif/releases/download/v1.3.5/libmjml_nif-v1.3.5-nif-2.16-x86_64-unknown-linux-gnu.so.tar.gz

From your error message it looks like it was some connection error to objects.githubusercontent.com, which is where GitHub seems to fetch the uploaded assets of a repo's release from.

I'm not sure if your issue is in any way related to a TSL/SSL config in your lib/app, but this is what I came across, which looks like it might point you into the right direction: https://github.com/swoosh/swoosh/issues/411

paulgoetze avatar Sep 10 '22 20:09 paulgoetze

@cblavier any update regarding this? Is it still an issue for you?

paulgoetze avatar Oct 17 '22 21:10 paulgoetze

Hey Paul, I'm in vacation right now so I will check next week. Our current status is that we disabled to precompiled NIF feature to build it with Rust from our CI environment (as this issue only occurs on CI)

cblavier avatar Oct 18 '22 07:10 cblavier

Hey @cblavier, just checking in if the issue is still valid for you. Did you already have a chance to gather more insides and/or resolve it?

paulgoetze avatar Feb 02 '23 20:02 paulgoetze

Trying right now with latest version of the library to set the MJML_BUILD var to 0 on our CI env

cblavier avatar Feb 06 '23 10:02 cblavier

It's now working perfectly with prebuilt NIF, I don't really know why, but I'm closing it anyway :) Thanks!

cblavier avatar Feb 06 '23 10:02 cblavier