Skip to content

Conversation

@ryanbrandenburg
Copy link
Contributor

The output files for particularly large or complex repositories can be quite large which can lead to errors like this one:

Error: Cannot create a string longer than 0x1fffffe8 characters
    at Buffer.toString (node:buffer:830:17)
    at JSON.parse (<anonymous>)
    at ScanCodeProcessor._hasRealErrors (/opt/service/providers/process/scancode.js:94:26)

But we don't want that error to obscure the underlying exceptions, so I suggest that we first always log, and then add an extra level of try-catch in _hasRealErrors.

Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Merging!

@jamesiri
Copy link
Contributor

@pombredanne the merge is blocked by a scancode error

@JamieMagee JamieMagee force-pushed the dev/rybrande/LargeJson branch from eda3234 to c450982 Compare January 30, 2026 21:29
The PR added this.logger.error() calls but the test mocks only
had log and info methods. Also fixed prettier formatting.
@JamieMagee
Copy link
Contributor

The tests were failing because the new this.logger.error() calls didn't have a matching method in the test mocks. Added error to both logger mocks in scancodeTests.js. Also ran prettier on scancode.js to fix a missing space after try.

@JamieMagee JamieMagee merged commit 5377f54 into clearlydefined:master Jan 30, 2026
2 checks passed
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.

5 participants