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

--logger-sasl-reports : Unknown option #687

Closed
Hermanverschooten opened this issue Jun 25, 2019 · 11 comments
Closed

--logger-sasl-reports : Unknown option #687

Hermanverschooten opened this issue Jun 25, 2019 · 11 comments
Labels
investigating The issue isn't confirmed yet, but I'm looking into it

Comments

@Hermanverschooten
Copy link

Hermanverschooten commented Jun 25, 2019

Steps to reproduce

Disitllery version: 2.1.0
Erlang version: 22.0.3-1
Elixir version: 1.9.0

Verbose Logs

Jun 25 09:04:14 studentenjobs systemd[1]: Started StudentenJobs Website.
Jun 25 09:04:15 studentenjobs studenten_jobs[9985]: Starting dependencies..
Jun 25 09:04:15 studentenjobs studenten_jobs[9985]: Starting repos..
Jun 25 09:04:15 studentenjobs studenten_jobs[9985]: Running migrations for studenten_jobs
Jun 25 09:04:15 studentenjobs studenten_jobs[9985]: --logger-sasl-reports : Unknown option
Jun 25 09:04:15 studentenjobs systemd[1]: studenten_jobs.service: Main process exited, code=exited, status=1/FAILURE
Jun 25 09:04:15 studentenjobs systemd[1]: studenten_jobs.service: Failed with result 'exit-code'.
Jun 25 09:04:15 studentenjobs systemd[1]: studenten_jobs.service: Service hold-off time over, scheduling restart.
Jun 25 09:04:15 studentenjobs systemd[1]: studenten_jobs.service: Scheduled restart job, restart counter is at 5.
Jun 25 09:04:15 studentenjobs systemd[1]: Stopped StudentenJobs Website.

Description of issue

I upgraded to distillery version 2.1.0 this morning and this broke my deployment via circleci.
So I upgraded elixir and erlang too, and changed the necessary references and commands according to the changelog.

But my application will not start anymore., due to the Unknown option error above.
If I remove my migration hook, it starts.
the hook contains:

#!/bin/sh

release_ctl eval --mfa "ReleaseTasks.migrate/1" --argv -- "$0"
@bitwalker
Copy link
Owner

I'm not clear why this would be failing, that option is known to Elixir (even in the newly released 1.9.0). Could you run the release with DEBUG_BOOT=true set in the environment and paste the output here? Feel free to strip sensitive information, I mostly am looking for where that error is raised specifically and what the arguments are.

@bitwalker bitwalker added the investigating The issue isn't confirmed yet, but I'm looking into it label Jun 25, 2019
@Hermanverschooten
Copy link
Author

I have set that option in systemd service and uncommented the release_ctl
syslog.txt.
I only replaced the cookie with xxx.

@Hermanverschooten
Copy link
Author

I recreated the issue with a simple test phx app. https://github.com/Hermanverschooten/dist_test
Creating the release and running it locally produces the same error.

@hubertlepicki
Copy link

I have similar issue, but my main application would start - the remote_console however not. It's crashing with:

./bin/myapp_phoenix remote_console
--logger-sasl-reports : Unknown option
Node myapp-staging@X.X.X.X is not running!

plus I get the constant error showing up in my logs on the running app:

--logger-sasl-reports : Unknown option
pong

which repeats every 1 second or so.

At the same time of upgrading Distillery to 2.1, I have also upgraded to Erlang 22.0.3 and Elixir 1.9 so I understand any of these may be an issuue.

@Hermanverschooten
Copy link
Author

I too have the issue that the remote_console is not working and complains the node is not running.

@hubertlepicki
Copy link

I recreated the issue with a simple test phx app. https://github.com/Hermanverschooten/dist_test
Creating the release and running it locally produces the same error.

Have you deleted the app?

@hubertlepicki
Copy link

I think it's not about "--logger-sasl-reports false" but "pong"... as this is repeating on my console as error all the time now.

@hubertlepicki
Copy link

hubertlepicki commented Jun 26, 2019

Further investigation shows that if I modify two scripts on the built release I have no problem anymore.

I edited releases/0.1.0/libexec/erts.sh two functions there to get rid of --logger-sasl-reports false line:

# Use release_ctl for local operations
# Use like `release_ctl eval "IO.puts(\"Hi!\")"`
# NOTE: removed the following line below "elixir" line:
#           --logger-sasl-reports false \
release_ctl() {
    command="$1"; shift
    elixir -e "Distillery.Releases.Runtime.Control.main" \
           -- \
           "$command" "$@"
}

# Use release_ctl for remote operations
# Use like `release_remote_ctl ping`
# NOTE: removed the following line below "elixir" line:
#           --logger-sasl-reports false \
release_remote_ctl() {
    require_cookie

    command="$1"; shift
    name="${PEERNAME:-$NAME}"
    elixir -e "Distillery.Releases.Runtime.Control.main" \
           -- \
           "$command" \
           --name="$name" \
           --cookie="$COOKIE" \
           "$@"
}

this makes app start with no issues and no "Unknown option"l is logged every second.

However, remote_console still fails with:

/bin/myapp_phoenix remote_console
Erlang/OTP 22 [erts-10.4.2] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [hipe]

--erl : Unknown option
-noshell -user Elixir.IEx.CLI : Unknown option
--erl : Unknown option
-hidden -kernel net_ticktime 60 : Unknown option
--logger-sasl-reports : Unknown option
No file named false

The fix for that is to launch it with "USE_ERL_SHELL=true" environment variable set.

The problem seems to boil down to "elixir" and "iex" from within release not accepting any options. My "iex" and "elixir" installed in the system do accept these options, but the ones in release do not.

include_erts: false doesn't fix the issue either.

It appears the shell scripts generating the commands are doing something Erlang 22.0 or Elixir 1.9 doesn't like when passing arguments. I suspect --logger-sasl-reports="true" instead of --logger-sasl-reports true would work but that's just a hunch...

@Hermanverschooten
Copy link
Author

I forgot to push it,...

@ejscunha
Copy link

We are also having this issue when executing a pre_start hook which uses the release_ctl script. We get the --logger-sasl-reports : Unknown option message. Also with Elixir 1.9 and OTP 22.

@bitwalker
Copy link
Owner

This is fixed in 2.1.1 (published to Hex) and master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating The issue isn't confirmed yet, but I'm looking into it
Projects
None yet
Development

No branches or pull requests

4 participants