Giter VIP home page Giter VIP logo

Comments (7)

hubertlepicki avatar hubertlepicki commented on June 3, 2024

To reproduce the bug, follow these steps:

  1. Create directory to host the example_app

mkdir example_app && cd example_app

  1. Place mix.exs in there containing the following text:
defmodule App.MixProject do
  use Mix.Project

  def project do
    [
      app: :app,
      version: "0.1.0",
      elixir: "~> 1.14",
      start_permanent: Mix.env() == :prod,
      deps: deps()
    ]
  end

  # Run "mix help compile.app" to learn about applications.
  def application do
    [
      extra_applications: [:logger]
    ]
  end

  # Run "mix help deps" to learn about dependencies.
  defp deps do
    [
      {:appsignal, "~> 2.7.4"},
      {:ssl_verify_fun, "~> 1.1.6", manager: :rebar3, only: [:test], runtime: false, override: true}
    ]
  end
end
  1. Place the following Dockerfile in the same directory
ARG ELIXIR_VERSION=1.15.0
ARG OTP_VERSION=26.0.1
ARG DEBIAN_VERSION=bullseye-20230522

ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}"

FROM ${BUILDER_IMAGE} as builder

# install build dependencies
RUN apt-get update -y && apt-get install -y build-essential git curl ca-certificates wget libc6-dev \
    && apt-get clean && rm -f /var/lib/apt/lists/*_*

RUN update-ca-certificates

WORKDIR /app

# install hex + rebar
RUN mix local.hex --force && \
    mix local.rebar --force

# set build ENV
ENV MIX_ENV="prod"

COPY mix.exs mix.exs

RUN mix deps.get --only $MIX_ENV
RUN mix deps.compile
  1. Build Docker image:
docker build .

If you notice, the mix.exs file contains a workaround for compilation issues of :ssl_verify_fun recommended by @josevalim , and it may or may not be related - since it's part of the dependency tree for :hackney

from appsignal-elixir.

hubertlepicki avatar hubertlepicki commented on June 3, 2024

OKAY please ignore me and this bug report, I figured it out.

The problem was in mix.exs on this line:

      {:ssl_verify_fun, "~> 1.1.6", manager: :rebar3, only: [:test], runtime: false, override: true}

It had only: [:test] which I blindly copied in and left there, removing this part fixes the issue.

from appsignal-elixir.

tombruijn avatar tombruijn commented on June 3, 2024

Hi @hubertlepicki, great you managed to get it to work! I remember the ssl_verify_fun needs an update for 1.15 to work. We're working this week on adding 1.15 to the CI so if any other things pop up we hope to fix it.

from appsignal-elixir.

hubertlepicki avatar hubertlepicki commented on June 3, 2024

@tombruijn thanks!

BTW: Did you folks consider getting rid of hackney dependency? It appears you use it to download Agent, and maybe there's a better way to do it now - either using the built in Erlang client (probably bad idea) or one of the lightweight pure Elixir clients such as Mint or Finch?

from appsignal-elixir.

tombruijn avatar tombruijn commented on June 3, 2024

Not right now. We used curl before, so that created an external dependency.

from appsignal-elixir.

josevalim avatar josevalim commented on June 3, 2024

If you are only downloading an agent, then using httpc is fine, as long as you use CAStore for certificates and configure the SSL stuff: https://github.com/livebook-dev/livebook/blob/main/lib/livebook/utils/http.ex#L1 - that's also how Phoenix downloads tailwind, esbuild, etc.

from appsignal-elixir.

tombruijn avatar tombruijn commented on June 3, 2024

We're using Hackney to download the agent on package installation, validate the Push API key on installation and send a diagnose report for support purposes.

Thanks for the livebook httpc example! We can try using that again.

I remember we tried using httpc before in PR #140, but ran into some issues figuring out how it worked.

from appsignal-elixir.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.