Repository navigation
Closed
Description
Behavior
On macOS arm64, OSLS 3.81.1 (aws-sdk 2.1693.0) times out reading a chunked HTTPS 200 OK response to ListObjectsV2 on Node 26.13.1. The same request completes on Node 22.23.5. This may affect deploy finalization, which also calls ListObjectsV2.
Reproduce
In an empty directory, install OSLS and generate a disposable loopback TLS certificate:
npm install --no-save osls@3.81.1
openssl req -x509 -newkey rsa:2048 -nodes -days 2 -subj /CN=localhost -keyout key.pem -out cert.pemSave as repro.cjs. It invokes the real OSLS request wrapper against a local fixture; no AWS account or credentials are needed.
repro.cjs
const assert = require('node:assert/strict');
const { once } = require('node:events');
const { readFileSync } = require('node:fs');
const { Agent } = require('node:https');
const { createServer } = require('node:tls');
const request = require('osls/lib/aws/request.js');
(async () => {
const cert = readFileSync('cert.pem');
const key = readFileSync('key.pem');
const keys = Array.from({ length: 722 }, (_, i) => `assets/chunk-${i}.js`);
const xml = '<ListBucketResult>' + keys.map((key) =>
`<Contents><Key>${key}</Key><LastModified>2025-01-01T00:00:00Z</LastModified><ETag>"fixture"</ETag><Size>12</Size><StorageClass>STANDARD</StorageClass></Contents>`
).join('') + '</ListBucketResult>';
let wire = 'HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\nContent-Type: application/xml\r\nConnection: close\r\n\r\n';
for (let i = 0; i < xml.length; i += 1024) {
const chunk = xml.slice(i, i + 1024);
wire += `${chunk.length.toString(16)}\r\n${chunk}\r\n`;
}
wire += '0\r\n\r\n';
const server = createServer({ cert, key }, (socket) => {
socket.on('error', () => {});
socket.once('data', () => {
for (let i = 0; i < wire.length; i += 1460) socket.write(wire.slice(i, i + 1460));
socket.end();
});
}).listen(0, '127.0.0.1');
const agent = new Agent({ ca: cert, servername: 'localhost' });
try {
await once(server, 'listening');
const result = await request({ name: 'S3', params: {
region: 'us-east-1', endpoint: `https://127.0.0.1:${server.address().port}`,
credentials: { accessKeyId: 'fixture', secretAccessKey: 'fixture' },
s3ForcePathStyle: true, maxRetries: 0, httpOptions: { agent, timeout: 500 },
} }, 'listObjectsV2', { Bucket: 'fixture-bucket' });
assert.deepEqual(result.Contents.map(({ Key }) => Key), keys);
console.log(`OK: ${keys.length} keys`);
} finally {
agent.destroy();
server.close();
}
})().catch((error) => { console.error(error.code ?? error); process.exitCode = 1; });With each Node version, run:
SLS_AWS_REQUEST_MAX_RETRIES=0 node repro.cjs- Expected:
OK: 722 keyson both versions. - Actual: Node 22 prints
OK: 722 keys(3/3 runs); Node 26 exits withAWS_S3_LIST_OBJECTS_V2_TIMEOUT_ERROR(3/3 runs).
Related: #42. The reproducer does not assume which layer should fix the response handling.
Metadata
Metadata
Assignees
Labels
No labels
Activity
GrahamCampbell commentedon Nov 21, 2026
Thanks for the precise reproducer. This comes from the AWS SDK v2 that osls v3 still uses: it calls
read()once perreadableevent, and Node.js 26 changedread()to return one buffered chunk at a time (nodejs/node#60441), so the rest of the body is never consumed. That SDK is end-of-support and will not be fixed. osls v4 uses the AWS SDK v3 and completes the same fixture on Node.js 26, so please upgrade to v4, or stay on Node.js 24 with v3.GrahamCampbell commentedon Nov 21, 2026
I've added a clarification to our README in #515.
tsilicani commentedon Nov 21, 2026
Thanks for the quick response, for confirming the cause against the reproducer, and for updating the README. We appreciate your work on OSLS! We will evaluate v4 on Node 26 against an existing staging stack first. Is an in-place update the expected migration path when the service, stage, region, deployment bucket, and CloudFormation logical IDs stay unchanged, or are there any stack-state caveats beyond the migration guide?