TE-12436: fix screenshot upload ECONNRESET for payloads over 2MB#500
Open
shrinishLT wants to merge 1 commit intoLambdaTest:mainfrom
Open
TE-12436: fix screenshot upload ECONNRESET for payloads over 2MB#500shrinishLT wants to merge 1 commit intoLambdaTest:mainfrom
shrinishLT wants to merge 1 commit intoLambdaTest:mainfrom
Conversation
Screenshots larger than ~2MB failed with "socket hang up" because form-data defaults maxDataSize to 2MB and the /screenshot request did not override axios maxBodyLength/maxContentLength. CombinedStream aborted mid-upload, the server saw a truncated body, and the TCP connection was reset. Set form.maxDataSize = Infinity and pass maxBodyLength/maxContentLength = Infinity on the axios request, matching the other upload paths in this file. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
parthlambdatest
approved these changes
Apr 16, 2026
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.
Summary
Fixes
ECONNRESET/ "socket hang up" on/screenshotuploads for any screenshot larger than ~2MB (full-page captures, high-DPI viewports, etc.).JIRA: TE-12436
Root Cause
form-datav4.x defaultsmaxDataSizeto2 * 1024 * 1024(2 MB).httpClient.uploadScreenshotdid not override it, and — unlike the other upload paths in the same file — also did not set axiosmaxBodyLength/maxContentLength.When the combined stream detected the overflow mid-upload,
CombinedStreamaborted the stream, the server saw a truncated body, and the TCP connection was reset. The axios config in the failing HYE log confirms this:The screenshot in the failing log was 2,114,763 bytes — only ~17 KB over the 2 MB form-data limit.
Fix
In
src/lib/httpClient.tsuploadScreenshot:form.maxDataSize = Infinityon theFormDatainstance so form-data does not abort large payloads.maxBodyLength: InfinityandmaxContentLength: Infinityon the axios request.This matches what the other upload methods (log upload, S3 upload) in the same file already do.
Test plan
ECONNRESET).Related
Internal RFC: internal-docs
RFC-TE-12436-smartui-cli-screenshot-upload-2mb-limit.md🤖 Generated with Claude Code