1

I'm trying to build a simple Erlang server with Cowboy on a Linux machine. However, when I run the server, I get the following error:

=INFO REPORT==== ===
    application: test_app
    exited: {bad_return,
                {{test_app_app,start,[normal,[]]},
                 {'EXIT',
                     {{badmatch,{error,eacces}},
                      [{test_app_app,start,2,
                           [{file,
                                "/testdir/test_app/src/test_app_app.erl"},
                            {line,19}]},
                       {application_master,start_it_old,4,
                           [{file,"application_master.erl"},{line,293}]}]}}}}
    type: temporary

Tried renewing the certbot-generated license. It seems like the error is related to a permission issue. How can I resolve this error and start my server?

1 Answers1

1

After some research and trial-and-error, I was able to resolve it.

  • Make sure to run rebar3 shell with sudo. The error is caused by a permission issue, so running rebar3 shell with sudo should resolve the issue.
  • Make sure that Erlang and Rebar3 were installed appropriately, not with a package that won't provide sudo privileges on Linux. For example, installing Erlang and Rebar3 with brew may cause permission issues on Linux. I used apt to install Rebar3 and Erlang, and it resolved the issue.

After implementing these changes, I was able to successfully start my Erlang server with Cowboy on my Linux machine without any permission issues.

I hope this solution helps anyone who encounters the same error.