Skip to content

chore: add debug logging for decode errors#1352

Merged
kzantow merged 1 commit intoanchore:mainfrom
kzantow-anchore:fix/log-decode-errors
Nov 21, 2022
Merged

chore: add debug logging for decode errors#1352
kzantow merged 1 commit intoanchore:mainfrom
kzantow-anchore:fix/log-decode-errors

Conversation

@kzantow
Copy link
Copy Markdown
Contributor

@kzantow kzantow commented Nov 19, 2022

This PR adds debug logging for decode errors. If a file fails to decode, at least a user is now able to run syft -vv to see why all the formats failed, like this:

[0000] DEBUG format syft-6-json returned err: unable to decode: invalid character 'S' looking for beginning of value
[0000] DEBUG format cyclonedx-1-xml returned err: EOF
[0000] DEBUG format cyclonedx-1-json returned err: invalid character 'S' looking for beginning of value
[0000] DEBUG format spdx-2-tag-value returned err: unable to decode spdx-tag-value: got unknown checksum type sha256
[0000] DEBUG format spdx-2-json returned err: unable to decode spdx-json: invalid character 'S' looking for beginning of value
2022/11/19 09:34:55 error during command execution: failed to decode SBOM: unable to identify format

Provides a stop-gap solution for: #1351

Signed-off-by: Keith Zantow <kzantow@gmail.com>
@kzantow kzantow requested a review from a team November 19, 2022 15:17
@kzantow kzantow merged commit 0dddf51 into anchore:main Nov 21, 2022
@kzantow kzantow deleted the fix/log-decode-errors branch November 21, 2022 14:26
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
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