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

ValueError: path is on mount 'D:', start on mount 'C:' when scanning repositories on different mounts #6920

Open
aswin-kevin opened this issue Dec 23, 2024 · 1 comment
Labels

Comments

@aswin-kevin
Copy link

Describe the issue
I am encountering an issue with the Checkov executable on a Windows 11 machine when scanning repositories located on a different drive mount than the one where the Checkov executable is located. The issue causes a ValueError indicating that the path is on a different mount, which prevents the scan from completing successfully. This issue was reported and closed in 2021, but I am still experiencing it in December 2024.

Examples

# Running the following command in PowerShell
.\checkov.exe -d D:\projects\others\fooworld --skip-path target -o json --output-file-path D:\projects\others\fooworld\iac-test-res --framework cloudformation dockerfile helm json yaml kubernetes terraform terraform_plan --quiet

Expected outcome: The scan should complete successfully and produce the expected output file.

Exception Trace

2024-12-17 13:03:03,581 [MainThread  ] [ERROR]  Exception traceback:
Traceback (most recent call last):
  File "checkov\main.py", line 519, in run
    self.scan_reports = runner_registry.run(
  File "checkov\common\runners\runner_registry.py", line 176, in run
    for result in parallel_runner_results:
  File "concurrent\futures\_base.py", line 619, in result_iterator
  File "concurrent\futures\_base.py", line 437, in result
  File "concurrent\futures\_base.py", line 389, in __get_result
  File "concurrent\futures\thread.py", line 57, in run
  File "checkov\common\runners\runner_registry.py", line 835, in _parallel_run
    report = runner.run(
  File "checkov\terraform\runner.py", line 134, in run
    self.check_tf_definition(report, root_folder, runner_filter, collect_skip_comments)
  File "checkov\terraform\runner.py", line 230, in check_tf_definition
    self.pbar.set_additional_data({"Current File Scanned": os.path.relpath(full_file_path.file_path)})
  File "ntpath.py", line 703, in relpath
ValueError: path is on mount 'D:', start on mount 'C:'
Traceback (most recent call last):
  File "checkov\main.py", line 519, in run
  File "checkov\common\runners\runner_registry.py", line 176, in run
  File "concurrent\futures\_base.py", line 619, in result_iterator
  File "concurrent\futures\_base.py", line 437, in result
  File "concurrent\futures\_base.py", line 389, in __get_result
  File "concurrent\futures\thread.py", line 57, in run
  File "checkov\common\runners\runner_registry.py", line 835, in _parallel_run
  File "checkov\terraform\runner.py", line 134, in run
  File "checkov\terraform\runner.py", line 230, in check_tf_definition
  File "ntpath.py", line 703, in relpath
ValueError: path is on mount 'D:', start on mount 'C:'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "checkov\main.py", line 849, in <module>
  File "checkov\main.py", line 708, in run
  File "checkov\main.py", line 736, in exit_run
NameError: name 'exit' is not defined
[15920] Failed to execute script 'main' due to unhandled exception!

Desktop (please complete the following information):

  • OS: windows 11
  • Checkov Version : 3.2.171

Additional context
This issue was previously reported and closed in 2021, but it seems to persist. Any insights or suggestions for a workaround would be greatly appreciated.

@Lingom-R
Copy link

It is happening for the frameworks "dockerfile" and "terraform" (found this while doing a random check).

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

No branches or pull requests

2 participants