adoptoposs / mjml_nif

Elixir NIF bindings for the MJML Rust implementation (mrml)
https://hexdocs.pm/mjml
MIT License
122 stars 17 forks source link

Error while downloading NIF #71

Closed cblavier closed 1 year ago

cblavier commented 2 years ago

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?

paulgoetze commented 2 years ago

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 commented 1 year ago

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

cblavier commented 1 year ago

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)

paulgoetze commented 1 year ago

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?

cblavier commented 1 year ago

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

cblavier commented 1 year ago

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