-
Hey! I tried all other resources - php bugs, stackoverflow, several AI agents. Starting to believe that this is something related to zip-stream? IDK. Maybe you can point me into the right direction. Really grasping for straws here. Thank you for reading. My code is pretty close to this example: I am streaming 283 files (2-4 mb per file) from S3 with psr7stream (guzzle). So the resulting zip is of > 1GB function getContentAsPsr7Stream() {
$object = $this->s3Client->getObject([
'Bucket' => $this->tenantBucketname,
'Key' => $key,
]);
$body = $object->get('Body');
Assert::isInstanceOf($body, \GuzzleHttp\Psr7\Stream::class);
return $body;
} i then do (symfony/http-foundation v5.4.48) return new StreamedResponse(function () use ($zipFileName, $manager, $pandoc, $dto): void {
$zip = new ZipStream(
outputName: $zipFileName,
defaultEnableZeroHeader: true,
contentType: 'application/octet-stream'
);
// ... define some variables
foreach ($images as $key => $image) {
$zip->addFileFromPsr7Stream($postFolder . '/' . $imagen, getContentAsPsr7Stream($key));
}
$zip->finish();
}); And then run into:
at /app/vendor/guzzlehttp/psr7/src/StreamWrapper.php line 86
Do you have any idea where to look next? I am not sure what is causing my script to timeout. It should run max 6 minutes, but stopps at 1 minute adding the error to the zipstream. Its not the max_execution_time (set to 0) The payload is just the array of image ids, so pretty basic and parsing is done after few milliseconds. So guess its not max_input_time. ini_set('max_input_time', 0); doesnt fix it either. I use nginx + php in docker and have nearly defaults for everything. Grasping for straws here! Thank you!
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Oh it varies with the stacktrace. Got one in: too if ($deflate) {
$data = deflate_add( // here
$deflate,
$data,
feof($this->unpackStream()) ? ZLIB_FINISH : ZLIB_NO_FLUSH
);
} |
Beta Was this translation helpful? Give feedback.
-
I got further down the rabbit hole, by reading this: I think this is unrelated to zipstream at all. Something in my environment is sending SIGPROF to php, cause I cannot reproduce this locally. Happy if someone has hints, but this is not related to streaming at all |
Beta Was this translation helpful? Give feedback.
I got further down the rabbit hole, by reading this:
https://bafford.com/2016/12/02/php-misleading-error-maximum-execution-time-of-0-seconds-exceeded/
I think this is unrelated to zipstream at all. Something in my environment is sending SIGPROF to php, cause I cannot reproduce this locally.
Happy if someone has hints, but this is not related to streaming at all