Repository navigation
fix: add maxBuffer 10MB to execFileAsync calls in routes.ts - #615
Merged
gopaljilab merged 2 commits intoJun 2, 2026
Merged
Conversation
- execFileAsync was called with no maxBuffer option on both the preview and full assessment endpoints, defaulting to Node.js's 1MB stdout limit - Verbose Python output (scikit-learn/numpy deprecation warnings, model loading logs) can exceed 1MB causing ERR_CHILD_PROCESS_STDIO_MAXBUFFER which is silently caught and returned as a 500 to the user - Set maxBuffer to 10 * 1024 * 1024 (10MB) on both execFileAsync calls to safely handle verbose Python stdout without crashing Fixes gopaljilab#476
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
execFileAsyncwas called with nomaxBufferoption on both the preview (POST /api/assessments/preview) and full assessment (POST /api/assessments) endpoints:Node.js
execFiledefaults to amaxBufferof 1MB for stdout. In production environments where ML libraries (scikit-learn, numpy) print initialization warnings, deprecation notices, or model loading logs, stdout can exceed 1MB — causing the process to crash withERR_CHILD_PROCESS_STDIO_MAXBUFFER. This error is silently caught by the outercatchblock and returned as a generic 500 to the user with no indication of the root cause.Changes made:
maxBuffer: 10 * 1024 * 1024(10MB) to bothexecFileAsynccalls — the preview endpoint (line 561) and the full assessment endpoint (line 650)npx tsc --noEmitFixes #476
Type of Change
Checklist: