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

Super-linter LOG_LEVEL variable conflicts with Checkov and Renovate LOG_LEVEL #5217

Closed
1 task done
ferrarimarco opened this issue Feb 2, 2024 · 4 comments · Fixed by #5249 or #5209
Closed
1 task done

Super-linter LOG_LEVEL variable conflicts with Checkov and Renovate LOG_LEVEL #5217

ferrarimarco opened this issue Feb 2, 2024 · 4 comments · Fixed by #5249 or #5209
Labels
bug Something isn't working O: backlog 🤖 Backlog, stale ignores this label

Comments

@ferrarimarco
Copy link
Collaborator

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Checkov uses an environment variable named LOG_LEVEL to configure the log level, and this conflicts with our LOG_LEVEL variable

Expected Behavior

Don't export the LOG_LEVEL variable when running Checkov.

Super-Linter version

v6.0.0

Relevant log output

2024-02-01T15:35:52.7838131Z �[0m2024-02-01 15:35:51 [INFO]�[0m   Command output for CHECKOV:
2024-02-01T15:35:52.7838705Z ------
2024-02-01T15:35:52.7839016Z Traceback (most recent call last):
2024-02-01T15:35:52.7839549Z   File \"/venvs/checkov/bin/checkov\", line 2, in <module>
2024-02-01T15:35:52.7840122Z     from checkov.main import Checkov
2024-02-01T15:35:52.7841611Z   File \"/venvs/checkov/lib/python3.12/site-packages/checkov/main.py\", line 21, in <module>
2024-02-01T15:35:52.7842774Z     import checkov.logging_init  # noqa  # should be imported before the others to ensure correct logging setup
2024-02-01T15:35:52.7843760Z     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-01T15:35:52.7844765Z   File \"/venvs/checkov/lib/python3.12/site-packages/checkov/logging_init.py\", line 8, in <module>
2024-02-01T15:35:52.7845554Z     logging.basicConfig(level=LOG_LEVEL)
2024-02-01T15:35:52.7846246Z   File \"/usr/local/lib/python3.12/logging/__init__.py\", line 2144, in basicConfig
2024-02-01T15:35:52.7846923Z     root.setLevel(level)
2024-02-01T15:35:52.7847496Z   File \"/usr/local/lib/python3.12/logging/__init__.py\", line 1514, in setLevel
2024-02-01T15:35:52.7848170Z     self.level = _checkLevel(level)
2024-02-01T15:35:52.7848579Z                  ^^^^^^^^^^^^^^^^^^
2024-02-01T15:35:52.7849217Z   File \"/usr/local/lib/python3.12/logging/__init__.py\", line 213, in _checkLevel
2024-02-01T15:35:52.7850308Z     raise ValueError(\"Unknown level: %r\" % level)
2024-02-01T15:35:52.7851095Z ValueError: Unknown level: 'TRACE'
2024-02-01T15:35:52.7851550Z ------�[0m
2024-02-01T15:35:52.7852181Z �[0m2024-02-01 15:35:51 [DEBUG]�[0m   Ending GitHub Actions log group: CHECKOV�[0m

Steps To Reproduce

  1. Set LOG_LEVEL to TRACE
  2. Run super-linter

Anything else?

#5215

@ferrarimarco ferrarimarco added bug Something isn't working O: backlog 🤖 Backlog, stale ignores this label labels Feb 2, 2024
@ferrarimarco
Copy link
Collaborator Author

@grahame-student I'm not able to reproduce this issue. I tried with several different values for LOG_LEVEL. Do you remember which one triggered this?

@ferrarimarco
Copy link
Collaborator Author

Ok nevermind. I got it :)

@grahame-student
Copy link
Contributor

For anyone else following the conversation, I'm using NOTICE for the LOG_LEVEL

@ferrarimarco ferrarimarco changed the title Super-linter LOG_LEVEL variable conflicts with Checkov LOG_LEVEL Super-linter LOG_LEVEL variable conflicts with Checkov and Renovate LOG_LEVEL Feb 9, 2024
ferrarimarco added a commit that referenced this issue Feb 9, 2024
- Super-linter uses the LOG_LEVEL variable to let the user
  configure the desired log level. Checkov and Renovate use a variable
  with the same name for the same purpose, but accept a
  different set of values, and exit with an error if it gets an unknown
  value for that variable.
- Refactor the VERBOSE log level to the more commonly used INFO.
  Configuration validation will warn users if they use VERBOSE and
  instruct them to use INFO instead. This is not a breaking change
  because super-linter falls back on INFO if VERBOSE is set.
- Remove the TRACE log level because we rarely used it. As with VERBOSE,
  configuration validation will warn the user. Fall back to DEBUG if the
  user configured LOG_LEVEL to VERBOSE.

Close #5217
@ferrarimarco
Copy link
Collaborator Author

#5249 should take care of this.

ferrarimarco added a commit that referenced this issue Feb 9, 2024
- Super-linter uses the LOG_LEVEL variable to let the user
  configure the desired log level. Checkov and Renovate use a variable
  with the same name for the same purpose, but accept a
  different set of values, and exit with an error if it gets an unknown
  value for that variable.
- Refactor the VERBOSE log level to the more commonly used INFO.
  Configuration validation will warn users if they use VERBOSE and
  instruct them to use INFO instead. This is not a breaking change
  because super-linter falls back on INFO if VERBOSE is set.
- Remove the TRACE log level because we rarely used it. As with VERBOSE,
  configuration validation will warn the user. Fall back to DEBUG if the
  user configured LOG_LEVEL to VERBOSE.

Close #5217
ferrarimarco added a commit that referenced this issue Feb 9, 2024
- Super-linter uses the LOG_LEVEL variable to let the user
  configure the desired log level. Checkov and Renovate use a variable
  with the same name for the same purpose, but accept a
  different set of values, and exit with an error if it gets an unknown
  value for that variable.
- Refactor the VERBOSE log level to the more commonly used INFO.
  Configuration validation will warn users if they use VERBOSE and
  instruct them to use INFO instead. This is not a breaking change
  because super-linter falls back on INFO if VERBOSE is set.
- Remove the TRACE log level because we rarely used it. As with VERBOSE,
  configuration validation will warn the user. Fall back to DEBUG if the
  user configured LOG_LEVEL to VERBOSE.

Close #5217
github-merge-queue bot pushed a commit that referenced this issue Feb 9, 2024
- Super-linter uses the LOG_LEVEL variable to let the user
  configure the desired log level. Checkov and Renovate use a variable
  with the same name for the same purpose, but accept a
  different set of values, and exit with an error if it gets an unknown
  value for that variable.
- Refactor the VERBOSE log level to the more commonly used INFO.
  Configuration validation will warn users if they use VERBOSE and
  instruct them to use INFO instead. This is not a breaking change
  because super-linter falls back on INFO if VERBOSE is set.
- Remove the TRACE log level because we rarely used it. As with VERBOSE,
  configuration validation will warn the user. Fall back to DEBUG if the
  user configured LOG_LEVEL to VERBOSE.

Close #5217
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working O: backlog 🤖 Backlog, stale ignores this label
Projects
None yet
2 participants