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

Issue installing agent on Erlang 22.1 #512

Closed
odarriba opened this issue Sep 18, 2019 · 6 comments
Closed

Issue installing agent on Erlang 22.1 #512

odarriba opened this issue Sep 18, 2019 · 6 comments
Labels

Comments

@odarriba
Copy link

Describe the bug

We have just updated one of our core applications to use Elixir 1.9.1 and Erlang 22.1.

On the CI (using the official Elixir 1.9.1 image with Erlang 22.1) all libraries are fetched, compiled and installed without any issue.

However, in our development environments (OSX based) we are seeing this error while installing appsignal:

==> appsignal
Downloading agent release from https://appsignal-agent-releases.global.ssl.fastly.net/d8dc806/appsignal-x86_64-darwin-all-static.tar.gz
could not compile dependency :appsignal, "mix compile" failed. You can recompile this dependency with "mix deps.compile appsignal", update it with "mix deps.update appsignal" or clean it with "mix deps.clean appsignal"
** (Protocol.UndefinedError) protocol String.Chars not implemented for %Poison.EncodeError{message: nil, value: {:error, {:error, {:option, :server_only, :honor_cipher_order}}}} of type Poison.EncodeError (a struct)
    (elixir) lib/string/chars.ex:3: String.Chars.impl_for!/1
    (elixir) lib/string/chars.ex:22: String.Chars.to_string/1
    mix_helpers.exs:498: Mix.Appsignal.Helper.write_report_file/2
    mix_helpers.exs:527: Mix.Appsignal.Helper.abort_installation/2
    (mix) lib/mix/task.ex:331: Mix.Task.run_task/3
    (mix) lib/mix/tasks/compile.all.ex:73: Mix.Tasks.Compile.All.run_compiler/2
    (mix) lib/mix/tasks/compile.all.ex:53: Mix.Tasks.Compile.All.do_compile/4
    (mix) lib/mix/tasks/compile.all.ex:24: anonymous fn/1 in Mix.Tasks.Compile.All.run/1

Our first thought was that maybe Erlang 22.1 (installed with asdf) was not fully built with SSL (as that flag, :honor_cipher_order, is used in the ssl module of Erlang), but it looks like it is correctly installed.

We have openssl installed using Homebrew:

$ brew info openssl 
openssl: stable 1.0.2s (bottled) [keg-only]
SSL/TLS cryptography library
https://openssl.org/
/usr/local/Cellar/openssl/1.0.2q (1,794 files, 12.1MB)
  Poured from bottle on 2018-12-28 at 11:06:51
/usr/local/Cellar/openssl/1.0.2s (1,795 files, 12.0MB)
  Poured from bottle on 2019-08-22 at 10:44:23
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/openssl.rb
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

openssl is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

If you need to have openssl first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc

For compilers to find openssl you may need to set:
  export LDFLAGS="-L/usr/local/opt/openssl/lib"
  export CPPFLAGS="-I/usr/local/opt/openssl/include"

For pkg-config to find openssl you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"

==> Analytics
install: 315,995 (30 days), 1,442,155 (90 days), 6,351,579 (365 days)
install_on_request: 44,771 (30 days), 192,738 (90 days), 854,417 (365 days)
build_error: 0 (30 days)

We rolled back Erlang to 22.0.5 and seems to work on OSX.

We are not sure if this is our computer's issue or something related to Erlang. But maybe you should know to investigate it.

To Reproduce

Steps to reproduce the behavior:

  • Using AppSignal for Elixir package version 1.10.12
  • In my app using Erlang 22.1, Elixir 1.9.1

Thanks! ❤️

@odarriba odarriba added the bug label Sep 18, 2019
@odarriba odarriba changed the title Issue installing extension on OSX / Erlang 22.1 Issue installing agent on OSX / Erlang 22.1 Sep 18, 2019
@tombruijn
Copy link
Member

Hi @odarriba,

Thanks for the detailed report. We're going to try and see if this happens on our macOS machines as well.

@tombruijn
Copy link
Member

tombruijn commented Sep 20, 2019

I can reproduce locally. (Do make sure to update asdf and the erlang & elixir plugins, otherwise it won't build with openssl)

Erlang has changed some SSL things: https://www.erlang.org/news/133
I think it may be related to this Hackney issue: benoitc/hackney#591
I haven't been able to figure out why else it could be happening.

Let's discuss with @jeffkreeftmeijer next week to see if he has any other insights.

@vihu
Copy link
Contributor

vihu commented Sep 20, 2019

Workaround while we wait for changes to bubble up: #514

@tombruijn tombruijn changed the title Issue installing agent on OSX / Erlang 22.1 Issue installing agent on Erlang 22.1 Sep 22, 2019
@larskrantz
Copy link

We experience this in our CI when using:
FROM elixir:1.9-alpine AS builder
Our temporary workaround is:
FROM elixir:1.9-alpine@sha256:d071898e73d43aec89870e4965217ffc66d092eb1197b1cd56daad0f78421935 AS builder if anyone else is stuck.

@tombruijn
Copy link
Member

tombruijn commented Sep 23, 2019

We have released version 1.10.13 with the workaround suggested by @vihu (Thanks again!)

Please upgrade to that if using OTP 22.1 and let us know here if it works for you

@tombruijn
Copy link
Member

The issue seems to be resolved. Hackney will release a new version today probably. After which we'll do another patch release that removes the workaround, PR #517.

Let us know if it's still happening for you on the latest release.

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

No branches or pull requests

4 participants