Skip to content

fix: remove progress and control codes from log output #4699

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aarongorka
Copy link

@aarongorka aarongorka commented Aug 11, 2025

This commit removes some not very useful output from the /var/log/user-data.log output that looks like this:

1 file(s) remaining ^MCompleted 6.2 MiB/214.5 MiB (22.3 MiB/s) with 1
file(s) remaining ^MCompleted 6.5 MiB/214.5 MiB (23.1 MiB/s) with 1
file(s) remaining ^MCompleted 6.8 MiB/214.5 MiB (23.9 MiB/s) with 1
file(s) remaining

This goes on for potentially several screens worth of log output.

It also removes a similar progress bar output from the IMDS token fetching, and as a bonus side effect, prevents the token itself from being persisted to the logs.

Finally, quotes are added around some of the values returned by curl to prevent bash from splitting it if there's whitespace in the return value and subsequent unintentional behaviour.

This commit removes some not very useful output from the
`/var/log/user-data.log` output that looks like this:

```
1 file(s) remaining ^MCompleted 6.2 MiB/214.5 MiB (22.3 MiB/s) with 1
file(s) remaining ^MCompleted 6.5 MiB/214.5 MiB (23.1 MiB/s) with 1
file(s) remaining ^MCompleted 6.8 MiB/214.5 MiB (23.9 MiB/s) with 1
file(s) remaining
```

This goes on for potentially several screens worth of log output.

It also similar progress bar output from the IMDS token fetching, and as
a bonus side effect, prevents the token itself from being persisted to the
logs.

Finally, quotes are added around some of the values returned by curl to
prevent bash from splitting it if there's whitespace in the return
value and subsequent unintentional behaviour.
@aarongorka aarongorka requested a review from a team as a code owner August 11, 2025 04:19
@aarongorka
Copy link
Author

Screenshot 2025-08-11 at 2 03 45 pm

@aarongorka
Copy link
Author

Also, there's a number of other shellcheck violations in this file (which is odd because there is a # shellcheck shell=bash at the top?), but I wasn't sure if it'd be appropriate to fix them in this PR - happy to add them in if it's acceptable.

@npalm npalm self-requested a review August 11, 2025 13:52
@npalm
Copy link
Member

npalm commented Aug 11, 2025

Also, there's a number of other shellcheck violations in this file (which is odd because there is a # shellcheck shell=bash at the top?), but I wasn't sure if it'd be appropriate to fix them in this PR - happy to add them in if it's acceptable.

No clue why the check is there, no linters for the scripts are active, so assume it is useless. But maybe better to fix in a another PR.

@npalm npalm requested a review from Copilot August 12, 2025 06:38
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR cleans up log output by removing verbose progress indicators and control characters from the user-data.log. The changes make logs more readable by suppressing curl progress output and AWS S3 transfer progress, while also adding proper quoting to prevent bash word splitting issues.

  • Suppresses curl progress output using the -s flag
  • Disables AWS S3 copy progress output with --no-progress
  • Adds proper quoting around curl command substitutions to prevent word splitting

Copy link
Member

@npalm npalm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aarongorka looks good, any thought about the copliot suggestion before merging?

@aarongorka
Copy link
Author

Is there anything else I need to do to get this merged or can I leave it with you @npalm ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants