Giter Club home page Giter Club logo

Comments (9)

ferd avatar ferd commented on May 29, 2024

Yep, this error is coming from

%% @doc Make sure a required app is running, or display an error message
%% and abort if there's a problem.
-spec ensure_running(atom(), command_line|api) -> ok | no_return().
ensure_running(App, Caller) ->
case application:start(App) of
ok -> ok;
{error, {already_started, App}} -> ok;
{error, Reason} ->
%% These errors keep rebar3's own configuration to be loaded,
%% which disables the log level and causes a failure without
%% showing the error message. Bypass this entirely by overriding
%% the default value (which allows logging to take place)
%% and shut things down manually.
Log = ec_cmd_log:new(warn, Caller),
ec_cmd_log:error(Log, "Rebar dependency ~p could not be loaded "
"for reason ~p~n", [App, Reason]),
throw(rebar_abort)
end.
where we have an explicit check to know if your install contains all the required and visible apps for rebar3 to run.

This means that whatever install you have with the apps either isn't configuring the lib to be in the path, or isn't containing them.

Did this ever work before or is this a first time thing?

from rebar3.

meppu avatar meppu commented on May 29, 2024

"It works on my machine" 😂

But as i said it also works on container when i use podman/docker exec. The problem is it doesn't work when i use it with erlang:open_port while it is running on container.

And i useElixir container, based on official Erlang container. So there should be no issues (since i can compile my project with it) but i also made a containerfile based on debian sid (unstable) repositories but it still gives same error.

FROM docker.io/elixir:1.14 AS builder

WORKDIR /app

COPY . .

RUN rebar3 get-deps
RUN rebar3 compile
RUN rebar3 as prod release

FROM docker.io/debian:unstable

# Install Deps
RUN apt-get update && apt-get install -y wget
RUN wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
RUN dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb

RUN apt-get install -y libodbc1 libsctp1

# Install Elixir + Erlang
RUN apt-get install -y elixir erlang rebar3 erlang-inets

# Prepare Mix
RUN mix local.hex --force
RUN mix local.rebar --force

# Copy Release
COPY --from=builder /app/_build/prod/rel/erland /release/erland

ENTRYPOINT [ "/release/erland/bin/erland" ]

The issue is when i run it with erlang:open_port while it is running in container, rebar3 is failing for any command.

Also setting DEBUG=1 environments doesn't give any information about it.

from rebar3.

tsloughter avatar tsloughter commented on May 29, 2024

The issue is likely the use of the debian erlang package. Better to use an Erlang docker image, asdf/kerl or the Erlang Solutions debian repos.

from rebar3.

meppu avatar meppu commented on May 29, 2024

The issue is likely the use of the debian erlang package. Better to use an Erlang docker image, asdf/kerl or the Erlang Solutions debian repos.

Erlang docker image is also not working.

from rebar3.

meppu avatar meppu commented on May 29, 2024

Ill publish an example rebar3 app to show issue now.

from rebar3.

meppu avatar meppu commented on May 29, 2024

Well, for some reason when i add inets to the applications, it worked. But i have no idea why it is working now. Can someone explain me what is related between inets and erlang:open_port?

from rebar3.

ferd avatar ferd commented on May 29, 2024

Oh so if it's building fine that's one thing.

But when you build a release, Rebar3 makes sure to only include the apps you need and request. So if you were somehow:

  1. building a release
  2. building the elixir app
  3. then calling rebar3 using the Erlang from the release built in step 1

then you would find yourself in a situation where you're using a minimal release's Erlang where inets was purposefully omitted by the tooling. So specifying inets to be there as well will make it work again, but you might still not be using the global install you thought you did?

from rebar3.

meppu avatar meppu commented on May 29, 2024

Yeah it still gives erl_include error when i need to run renar3 release inside of erlang app via open_port. But i also want to know why when i run rebar3 it doesn't uses the global installation.

Is there any way to just run shell command without these issues? I also need to get output information real-time.

from rebar3.

ferd avatar ferd commented on May 29, 2024

I'm not quite sure. The escript rebar3 runs will use whatever Erlang is closest in path based on the priorities.

If the error you see with rebar3 also happens with the basic 'erl' command, you know that's the problem. If it does not happen with 'erl' then something quite odd is going on.

from rebar3.

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.