Logs and return codes

Where they are

Logs are written to the logs directory next to the scripts. If writing there is not possible, ~/.era_installer/logs is used. The directory can be set with the ERA_LOG_DIR environment variable.

Each run leaves three files:

File Content

<command>_<date-time>.log

Progress: prechecks, plan, each command and its result.

<command>_<date-time>.params

Collected values — the answers file.

<command>_<date-time>.cmd

A ready-made non-interactive repeat command. If additional servers are listed in the master, commands for each of them are appended there too.

Next to them is the symbolic link last.log to the last run. Permissions on all files are 0600: they contain passwords.

When installing over ssh, the remote side log is fetched to logs/remote/<host>/. Thus after a failure both logs — yours and the server’s — are next to each other.

How to read

Lines are marked with a level, and the labels are not translated — the log remains suitable for grep regardless of the interface language.

Label Meaning

INFO

Normal progress.

WARN

Something is wrong, but installation continues.

ERROR

Error. Usually the last line before exit.

EXEC

A command the installer is about to execute.

SKIP

The command was not executed; the reason follows.

DEBUG

Details. Shown in the console only with --verbose.

EXEC is a declaration of a command, not proof that it ran. In --dry-run mode commands are printed in exactly the same way, and the line dry-run: not executed follows immediately. This is intentional: a trial run must show exactly what the real one will do.

Find what actually ran:

grep -A1 '\[EXEC' logs/last.log | grep -v 'not executed'

Find errors:

grep -E '\[(ERROR|WARN)' logs/last.log

The log header contains the installer version, OS, bash version, and launch command line. Passwords in it are already masked.

Passwords in logs

Values of parameters marked as secret in the registry are replaced with •••••• — both in the summary, in the command line in the header, and in printed commands.

The --log-secrets key disables masking. It is needed when analyzing an authentication failure and must not get into normal scenarios.

Return codes

They should be distinguished by one feature: whether the server was changed. Codes 2, 3, and 4 mean the apply phase was not reached and the server was not touched. Code 5 means application started and was interrupted — the server was partially changed, and the log shows at which step.