Skip to content

CredScan intermittently failing for large SBOM files #1797

@mthalman

Description

@mthalman

The Guardian: CredScan (Binary) step is having trouble with the SBOM files that are now being generated after the changes in #1787. This only happens for the very large SBOMs that get generated by the https://github.com/dotnet/dotnet-buildtools-prereqs-docker repo. And it happens intermittently, but more often than not.

------------------------------------------------------------------------------
Running Credential Scanner 2.3.12.23
------------------------------------------------------------------------------
/mnt/vss/_work/_gdn/packages/nuget/Microsoft.Security.CredScan.Client.linux-x64.2.3.12.23/lib/net6.0/CredentialScanner -I /mnt/vss/_work/1/a/sbom -f pre -e False -S /mnt/vss/_work/_gdn/packages/nuget/Microsoft.Security.CredScan.Client.linux-x64.2.3.12.23/lib/net6.0/ConfigFiles/FileSystemProvider.csk -b 7 -O /mnt/vss/_work/1/.gdn/.r/credscan/002/credscan
Start credential scanner
Initializing...
Initialization completed.
Start file scanning...
[WARNING] Failed to parse json file (/mnt/vss/_work/1/a/sbom/dotnet-buildtools_prereqs@sha256_b310f4d427a2c94ccbf1b22106a553f3a59417646eaad16e23f6bf3c72609cb7/manifest.spdx.json). Skipping advanced JsonScanner even though the file has a .json extension; Resuming full text scanning.
Unexpected end of content while loading JObject. Path 'files[1765].checksums[0]', line 47962, position 9.

[WARNING] Failed to parse json file (/mnt/vss/_work/1/a/sbom/dotnet-buildtools_prereqs@sha256_b310f4d427a2c94ccbf1b22106a553f3a59417646eaad16e23f6bf3c72609cb7/manifest.spdx.json). Skipping advanced JsonScanner even though the file has a .json extension; Resuming full text scanning.
Additional text encountered after finished reading JSON content: :. Path '', line 1, position 12.

[WARNING] Failed to parse json file (/mnt/vss/_work/1/a/sbom/dotnet-buildtools_prereqs@sha256_b310f4d427a2c94ccbf1b22106a553f3a59417646eaad16e23f6bf3c72609cb7/manifest.spdx.json). Skipping advanced JsonScanner even though the file has a .json extension; Resuming full text scanning.
Unexpected character encountered while parsing value: a. Path '', line 0, position 0.

[WARNING] Failed to parse json file (/mnt/vss/_work/1/a/sbom/dotnet-buildtools_prereqs@sha256_b310f4d427a2c94ccbf1b22106a553f3a59417646eaad16e23f6bf3c72609cb7/manifest.spdx.json). Skipping advanced JsonScanner even though the file has a .json extension; Resuming full text scanning.
JsonToken EndArray is not valid for closing JsonType None. Path '', line 2, position 7.

[WARNING] Failed to parse json file (/mnt/vss/_work/1/a/sbom/dotnet-buildtools_prereqs@sha256_b310f4d427a2c94ccbf1b22106a553f3a59417646eaad16e23f6bf3c72609cb7/manifest.spdx.json). Skipping advanced JsonScanner even though the file has a .json extension; Resuming full text scanning.
JsonToken EndArray is not valid for closing JsonType None. Path '', line 1, position 2.

[WARNING] Failed to parse json file (/mnt/vss/_work/1/a/sbom/dotnet-buildtools_prereqs@sha256_b310f4d427a2c94ccbf1b22106a553f3a59417646eaad16e23f6bf3c72609cb7/manifest.spdx.json). Skipping advanced JsonScanner even though the file has a .json extension; Resuming full text scanning.
Unexpected character encountered while parsing value: r. Path '', line 0, position 0.

[WARNING] Failed to parse json file (/mnt/vss/_work/1/a/sbom/dotnet-buildtools_prereqs@sha256_b310f4d427a2c94ccbf1b22106a553f3a59417646eaad16e23f6bf3c72609cb7/manifest.spdx.json). Skipping advanced JsonScanner even though the file has a .json extension; Resuming full text scanning.
Unexpected character encountered while parsing number: m. Path '', line 1, position 2.

[WARNING] Failed to parse json file (/mnt/vss/_work/1/a/sbom/dotnet-buildtools_prereqs@sha256_b310f4d427a2c94ccbf1b22106a553f3a59417646eaad16e23f6bf3c72609cb7/manifest.spdx.json). Skipping advanced JsonScanner even though the file has a .json extension; Resuming full text scanning.
Additional text encountered after finished reading JSON content: ,. Path '', line 1, position 0.

[WARNING] Failed to parse json file (/mnt/vss/_work/1/a/sbom/dotnet-buildtools_prereqs@sha256_b310f4d427a2c94ccbf1b22106a553f3a59417646eaad16e23f6bf3c72609cb7/manifest.spdx.json). Skipping advanced JsonScanner even though the file has a .json extension; Resuming full text scanning.
Additional text encountered after finished reading JSON content: ,. Path '', line 6, position 5.

[WARNING] Failed to parse json file (/mnt/vss/_work/1/a/sbom/dotnet-buildtools_prereqs@sha256_b310f4d427a2c94ccbf1b22106a553f3a59417646eaad16e23f6bf3c72609cb7/manifest.spdx.json). Skipping advanced JsonScanner even though the file has a .json extension; Resuming full text scanning.
Unexpected character encountered while parsing value: r. Path '', line 0, position 0.

[WARNING] Failed to parse json file (/mnt/vss/_work/1/a/sbom/dotnet-buildtools_prereqs@sha256_33984bb4dfb7a58ea7ac421aab05e734b7a86dab191f01ab79e8e1019a5271f6/manifest.spdx.json). Skipping advanced JsonScanner even though the file has a .json extension; Resuming full text scanning.
Unterminated string. Expected delimiter: ". Path 'files[1763].SPDXID', line 107793, position 58.

##[error]malloc_consolidate(): unaligned fastbin chunk detected

I've examined the JSON files and they are syntactically correct. The error indicated at the end seems to be the issue: a memory problem.

As a first step, we should compare the state of the SBOM now from what it was before the changes from #1787 to understand what difference exists now that would cause this to fail. Based on the logs, there is some big difference in what CredScanner is scanning for content because prior to the SBOM changes it was scanning about 6 MBs of content in one job and now is scanning 900+ MBs.

Metadata

Metadata

Assignees

Type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions