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

godaddy/tartufo:3.1.0 docker images fails after scan #336

Closed
tbergquist-godaddy opened this issue Mar 25, 2022 · 4 comments · Fixed by #337
Closed

godaddy/tartufo:3.1.0 docker images fails after scan #336

tbergquist-godaddy opened this issue Mar 25, 2022 · 4 comments · Fixed by #337
Labels
bug Something isn't working

Comments

@tbergquist-godaddy
Copy link

🐛 Bug Report

Running the command docker run -t --rm -v "$(pwd):/git" godaddy/tartufo --config /git/tartufo.toml --output-dir /git/.tartufo pre-commit (targets latest which at the moment is 3.1.0 fails with this error message:

All clear. No secrets detected.
Traceback (most recent call last):
  File "/venv/bin/tartufo", line 8, in <module>
    sys.exit(main())
  File "/venv/lib/python3.10/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/venv/lib/python3.10/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/venv/lib/python3.10/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/venv/lib/python3.10/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/venv/lib/python3.10/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/venv/lib/python3.10/site-packages/click/decorators.py", line 38, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/venv/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/venv/lib/python3.10/site-packages/tartufo/commands/pre_commit.py", line 28, in main
    util.process_issues(str(repo_path), scanner, options)
  File "/venv/lib/python3.10/site-packages/tartufo/util.py", line 255, in process_issues
    write_outputs(scan.scan(), output_dir)
  File "/venv/lib/python3.10/site-packages/tartufo/util.py", line 127, in write_outputs
    for issue in issues:
  File "/venv/lib/python3.10/site-packages/tartufo/scanner.py", line 555, in scan
    yield from self.load_issues()
  File "/venv/lib/python3.10/site-packages/tartufo/scanner.py", line 507, in load_issues
    self.issue_file.seek(0)
  File "/venv/lib/python3.10/site-packages/tartufo/scanner.py", line 496, in issue_file
    if not self._issue_file:
AttributeError: 'GitPreCommitScanner' object has no attribute '_issue_file'. Did you mean: 'issue_file'?

To Reproduce

Run snippet from above

Expected Behavior

Docker image doesn't crash after scan.

Code Example

N/A

Environment

Docker

@tbergquist-godaddy tbergquist-godaddy added the bug Something isn't working label Mar 25, 2022
@tbergquist-godaddy
Copy link
Author

Running docker run -t --rm -v "$(pwd):/git" godaddy/tartufo:3.0.0 --config /git/tartufo.toml --output-dir /git/.tartufo pre-commit works

@tarkatronic
Copy link
Contributor

Hi @tbergquist-godaddy, thanks for this bug report! I'm looking into this problem this morning, and hope to have a resolution soon. Though looking at the error message, it appears that this is a problem specifically with pre-commit. Can you try with a scan-local-repo and see if it works for you?

tarkatronic added a commit that referenced this issue Mar 25, 2022
…fail (#337)

* Default _issue_file to None to ensure it is defined

* Version bump for quick bugfix release
@tarkatronic
Copy link
Contributor

@tbergquist-godaddy Sorry about that, took me less than a minute of investigation to realize what went wrong. v3.1.1 has been released now to fix the issue! Thank you again for the bug report!

@tbergquist-godaddy
Copy link
Author

Thank you for the quick fix 😊

I can confirm it is now working again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants