GameServerManagers / LinuxGSM

The command-line tool for quick, simple deployment and management of Linux dedicated game servers.
https://linuxgsm.com
MIT License
4.31k stars 821 forks source link

[BUG] Cron emails contain garbage characters #3729

Closed jrmain closed 12 months ago

jrmain commented 2 years ago

User Story

As a LinuxGSM server operator, I want the garbage characters (apparently spurious ANSI sequences) removed from LinuxGSM Cron emails, so that those emails are easier to read and parse.

Basic info

Further Information

When some LinuxGSM Cron functions run, they generate email. For example, I receive a daily email for each LGSM server when the scheduled update-lgsm function runs for each server.

These emails contain what appears to be ANSI formatting strings. Here are some highlights from this morning's update email:

[K[ .... ] Updating LinuxGSM vhserver: [K[ .... ] Updating LinuxGSM vhserver: Selecting repo [K[ OK ] Updating LinuxGSM vhserver: Selecting repo: GitHub fetching GitHub linuxgsm.sh...OK [2K checking vhserver...UPDATE fetching GitHub _default.cfg...OK [2K [K[ .... ] Updating LinuxGSM vhserver: Sending Email alert: [redacted] [K[ OK ] Updating LinuxGSM vhserver: Sending Email alert: [redacted] fetching GitHub ubuntu-18.04.csv...OK [2K checking GitHub module alert_email.sh...OK fetching GitHub check_deps.sh...OK [2K checking GitHub module check_executable.sh...OK fetching GitHub core_dl.sh...OK [2K checking GitHub module core_exit.sh...OK fetching GitHub core_functions.sh...OK [2K checking GitHub module core_getopt.sh...OK fetching GitHub fix_steamcmd.sh...OK [2K checking GitHub module fix_vh.sh...UPDATE fetching GitHub fix_vh.sh...OK [2K checking GitHub module info_distro.sh...UPDATE fetching GitHub info_distro.sh...OK [2K checking GitHub module info_game.sh...UPDATE fetching GitHub info_game.sh...OK [2K checking GitHub module info_messages.sh...UPDATE fetching GitHub info_messages.sh...OK [2K checking GitHub module install_complete.sh...OK fetching GitHub install_config.sh...OK [2K checking GitHub module install_header.sh...OK fetching GitHub install_server_files.sh...OK [2K checking GitHub module install_stats.sh...OK [K[ OK ] Updating LinuxGSM vhserver: Updating functions

(Those are all the lines that contain the garbage characters from the email. All the other lines look fine.)

The garbage characters make reading and parsing the email more difficult, and they don't add anything useful, so if they could be removed, that would be great.

Related settings: emailalert="on" ansi="off"

To Reproduce

Steps to reproduce the behaviour:

  1. Configure update-lgsm to run automatically using Cron, send email, and NOT use ANSI.
  2. Examine the resulting email.

Expected behaviour

No garbage characters in the email generated by update-lgsm.

jrmain commented 2 years ago

UPDATE: this is actually getting worse. Today's update emails look like this:

[K[ .... ] Updating LinuxGSM ut2k4server:
[K[ .... ] Updating LinuxGSM ut2k4server: Selecting repo
[K[ OK ] Updating LinuxGSM ut2k4server: Selecting repo: GitHub checking GitHub linuxgsm.sh...UPDATE fetching GitHub linuxgsm.sh...OK [2K checking ut2k4server...UPDATE backup ut2k4server...OK backup location /home/ut2k4server/lgsm/backup/script/ut2k4server-10_06_2022_00.bak copying ut2k4server...OK checking GitHub config _default.cfg...OK checking GitHub config ubuntu-18.04.csv...UPDATE fetching GitHub ubuntu-18.04.csv...OK [2K checking GitHub module alert_discord.sh...UPDATE fetching GitHub alert_discord.sh...OK [2K checking GitHub module alert.sh...UPDATE fetching GitHub alert.sh...OK [2K checking GitHub module check_config.sh...UPDATE fetching GitHub check_config.sh...OK [2K checking GitHub module check_deps.sh...UPDATE fetching GitHub check_deps.sh...OK [2K checking GitHub module check_executable.sh...OK checking GitHub module check_glibc.sh...OK checking GitHub module check_ip.sh...UPDATE fetching GitHub check_ip.sh...OK [2K checking GitHub module check_logs.sh...UPDATE fetching GitHub check_logs.sh...OK [2K checking GitHub module check_permissions.sh...UPDATE fetching GitHub check_permissions.sh...OK [2K checking GitHub module check_root.sh...OK checking GitHub module check.sh...UPDATE fetching GitHub check.sh...OK [2K checking GitHub module check_status.sh...UPDATE fetching GitHub check_status.sh...OK [2K checking GitHub module check_system_dir.sh...OK checking GitHub module check_system_requirements.sh...UPDATE fetching GitHub check_system_requirements.sh...OK [2K checking GitHub module check_tmuxception.sh...UPDATE fetching GitHub check_tmuxception.sh...OK [2K checking GitHub module check_version.sh...UPDATE fetching GitHub check_version.sh...OK [2K checking GitHub module command_console.sh...OK checking GitHub module command_details.sh...UPDATE fetching GitHub command_details.sh...OK [2K checking GitHub module command_install.sh...OK checking GitHub module command_monitor.sh...UPDATE fetching GitHub command_monitor.sh...OK [2K checking GitHub module command_postdetails.sh...UPDATE fetching GitHub command_postdetails.sh...OK [2K checking GitHub module command_restart.sh...OK checking GitHub module command_start.sh...UPDATE fetching GitHub command_start.sh...OK [2K checking GitHub module command_stop.sh...UPDATE fetching GitHub command_stop.sh...OK [2K checking GitHub module command_update_linuxgsm.sh...UPDATE fetching GitHub command_update_linuxgsm.sh...OK [2K checking GitHub module core_dl.sh...UPDATE fetching GitHub core_dl.sh...OK [2K checking GitHub module core_exit.sh...UPDATE fetching GitHub core_exit.sh...OK [2K checking GitHub module core_functions.sh...UPDATE fetching GitHub core_functions.sh...OK [2K checking GitHub module core_getopt.sh...UPDATE fetching GitHub core_getopt.sh...OK [2K checking GitHub module core_legacy.sh...UPDATE fetching GitHub core_legacy.sh...OK [2K checking GitHub module core_logs.sh...UPDATE fetching GitHub core_logs.sh...OK [2K checking GitHub module core_messages.sh...UPDATE fetching GitHub core_messages.sh...OK [2K checking GitHub module core_trap.sh...UPDATE fetching GitHub core_trap.sh...OK [2K checking GitHub module fix.sh...UPDATE fetching GitHub fix.sh...OK [2K checking GitHub module fix_ut2k4.sh...OK checking GitHub module info_distro.sh...UPDATE fetching GitHub info_distro.sh...OK [2K checking GitHub module info_game.sh...UPDATE fetching GitHub info_game.sh...OK [2K checking GitHub module info_messages.sh...UPDATE fetching GitHub info_messages.sh...OK [2K checking GitHub module install_complete.sh...OK checking GitHub module install_config.sh...UPDATE fetching GitHub install_config.sh...OK [2K checking GitHub module install_header.sh...OK checking GitHub module install_logs.sh...UPDATE fetching GitHub install_logs.sh...OK [2K checking GitHub module install_server_dir.sh...OK checking GitHub module install_server_files.sh...UPDATE fetching GitHub install_server_files.sh...OK [2K checking GitHub module install_ut2k4_key.sh...OK checking GitHub module query_gamedig.sh...UPDATE fetching GitHub query_gamedig.sh...OK [2K checking GitHub module query_gsquery.py...UPDATE fetching GitHub query_gsquery.py...OK [2K checking GitHub module update_steamcmd.sh...OK [K[ OK ] Updating LinuxGSM ut2k4server: Updating functions

h3o66 commented 2 years ago

to disable the colors you can try to add the following to the config: ansi="off"

hope this helps

jrmain commented 2 years ago

Thanks. As noted in my original report, that setting is already off.

jrmain commented 1 year ago

This issue was apparently resolved in v23.6.0, presumably in relation to #4352. I'm not seeing stray ANSI sequences in alert emails any more. Thanks!

dgibbs64 commented 1 year ago

Brilliant. I will get this linked and closed :)