You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fprintf(): supplied resource is not a valid stream resource #2856
Hi @VadimSafonov, sorry to hear about your issues. Can you please provide a minimal reproducible code so we can better investigate this?. For example, we would be able to see if happens by you providing a custom logfn, or if happens with the default logfn, which can be seen here. Our default implementation will use echo to display the value.
I notice the following:
1 with default debug block config I got error, but file has been downloaded
2 without debug block config NO error, file has been downloaded
-> Entering step init, name 'idempotency_auto_fill'
---------------------------------------------------
command was set to array(3) {
["instance"]=>
string(32) "000000001251b3390000000058fd7477"
["name"]=>
string(10) "HeadObject"
["params"]=>
array(4) {
["Bucket"]=>
string(12) "test-unvsoft"
["Key"]=>
string(50) "vadim/files/{37AEAC04-A6A7-D18A-71F0-124E6E71757A}"
["@http"]=>
array(1) {
["debug"]=>
resource(192) of type (stream)
}
["@context"]=>
array(0) {
}
}
}
request was set to array(0) {
}
-> Entering step init, name 's3.ssec'
-------------------------------------
no changes
-> Entering step init, name 's3.source_file'
--------------------------------------------
no changes
-> Entering step init, name 's3.save_as'
----------------------------------------
no changes
-> Entering step init, name 's3.location'
-----------------------------------------
no changes
-> Entering step init, name 's3.auto_encode'
--------------------------------------------
no changes
-> Entering step init, name 's3.head_object'
--------------------------------------------
command.params.@http.decode_content was set to
-> Entering step validate, name 'validation'
--------------------------------------------
no changes
-> Entering step validate, name 'input_validation_middleware'
-------------------------------------------------------------
no changes
-> Entering step build, name 'endpoint-resolution'
--------------------------------------------------
no changes
-> Entering step build, name 'builder'
--------------------------------------
request.instance was set to 000000001251b3c00000000058fd7477
request.method was set to HEAD
request.headers was set to array(2) {
["X-Amz-Security-Token"]=>
string(7) "[TOKEN]"
["Host"]=>
array(1) {
[0]=>
string(40) "test-unvsoft.s3-accelerate.amazonaws.com"
}
}
request.scheme was set to https
request.path was set to /vadim/files/%7B37AEAC04-A6A7-D18A-71F0-124E6E71757A%7D
-> Entering step build, name 's3.check_empty_path_with_query'
-------------------------------------------------------------
no changes
-> Entering step build, name 'ApiCallMonitoringMiddleware'
----------------------------------------------------------
no changes
-> Entering step build, name ''
-------------------------------
request.instance changed from 000000001251b3c00000000058fd7477 to 000000001251b0a80000000058fd7477
request.headers.X-Amz-User-Agent was set to array(1) {
[0]=>
string(53) "aws-sdk-php/3.293.10 OS/Darwin#21.6.0 lang/php#7.2.34"
}
request.headers.User-Agent was set to array(1) {
[0]=>
string(53) "aws-sdk-php/3.293.10 OS/Darwin#21.6.0 lang/php#7.2.34"
}
-> Entering step build, name 'endpoint_parameter'
-------------------------------------------------
no changes
-> Entering step build, name 'EndpointDiscoveryMiddleware'
----------------------------------------------------------
no changes
-> Entering step build, name 'request-compression'
--------------------------------------------------
no changes
-> Entering step build, name 'recursion-detection'
--------------------------------------------------
no changes
-> Entering step build, name 's3.checksum'
------------------------------------------
no changes
-> Entering step build, name 's3.content_type'
----------------------------------------------
no changes
-> Entering step build, name 's3.bucket_endpoint_arn'
-----------------------------------------------------
no changes
-> Entering step sign, name 'StreamRequestPayloadMiddleware'
------------------------------------------------------------
no changes
-> Entering step sign, name 'invocation-id'
-------------------------------------------
request.instance changed from 000000001251b0a80000000058fd7477 to 000000001251b0b30000000058fd7477
request.headers.aws-sdk-invocation-id was set to array(1) {
[0]=>
string(32) "0e7ea559daaecfcbed7828d95372660d"
}
-> Entering step sign, name 'retry'
-----------------------------------
request.instance changed from 000000001251b0b30000000058fd7477 to 000000001251b0a60000000058fd7477
request.headers.aws-sdk-retry was set to array(1) {
[0]=>
string(3) "0/0"
}
-> Entering step sign, name 'signer'
------------------------------------
request.instance changed from 000000001251b0a60000000058fd7477 to 000000001251b09d0000000058fd7477
request.headers.x-amz-content-sha256 was set to array(1) {
[0]=>
string(64) "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
request.headers.X-Amz-Date was set to array(1) {
[0]=>
string(16) "20231214T193542Z"
}
request.headers.Authorization was set to array(1) {
[0]=>
string(228) "AWS4-HMAC-SHA256 Credential=[KEY]/20231214/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-amz-user-agent, Signature=[SIGNATURE]
}
-> Entering step sign, name 's3.put_object_url'
-----------------------------------------------
no changes
-> Entering step sign, name 's3.permanent_redirect'
---------------------------------------------------
no changes
-> Entering step attempt, name 'ApiCallAttemptMonitoringMiddleware'
-------------------------------------------------------------------
no changes
* Host test-unvsoft.s3-accelerate.amazonaws.com:443 was resolved.
* IPv6: (none)
* IPv4: 18.165.125.87
* Trying 18.165.125.87:443...
* Connected to test-unvsoft.s3-accelerate.amazonaws.com (18.165.125.87) port 443
* ALPN: curl offers http/1.1
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256 / x25519 / RSASSA-PSS
* ALPN: server did not agree on a protocol. Uses default.
* Server certificate:
* subject: CN=*.s3-accelerate.amazonaws.com
* start date: Jul 17 00:00:00 2023 GMT
* expire date: Mar 17 23:59:59 2024 GMT
* subjectAltName: host "test-unvsoft.s3-accelerate.amazonaws.com" matched cert's "*.s3-accelerate.amazonaws.com"
* issuer: C=US; O=Amazon; CN=Amazon RSA 2048 M01
* SSL certificate verify ok.
* Certificate level 0: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption
* Certificate level 1: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption
* Certificate level 2: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption
* using HTTP/1.x
> HEAD /vadim/files/%7B37AEAC04-A6A7-D18A-71F0-124E6E71757A%7D HTTP/1.1
Host: test-unvsoft.s3-accelerate.amazonaws.com
X-Amz-User-Agent: aws-sdk-php/3.293.10 OS/Darwin#21.6.0 lang/php#7.2.34
aws-sdk-invocation-id: 0e7ea559daaecfcbed7828d95372660d
aws-sdk-retry: 0/0
x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20231214T193542Z
Authorization: AWS4-HMAC-SHA256 Credential=[KEY]/20231214/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-amz-user-agent, Signature=[SIGNATURE]
User-Agent: aws-sdk-php/3.293.10 OS/Darwin#21.6.0 lang/php#7.2.34 GuzzleHttp/6.5.5 curl/8.5.0 PHP/7.2.34
< HTTP/1.1 200 OK
< Content-Type: application/octet-stream
< Content-Length: 23501
< Connection: keep-alive
< x-amz-id-2: SBVRuVeb0LpXQYw3H56tvIXZmv6zCWHUMDWmYXp0KnQ1X7PdPDnRLlXYafsolu46R4MndrTPFxo=
< x-amz-request-id: GZRSYJA37Q20GCMP
< Date: Thu, 14 Dec 2023 19:35:43 GMT
< Last-Modified: Thu, 14 Dec 2023 18:14:07 GMT
< ETag: "660a5324d7f84bbecb25600021b4376f"
< x-amz-server-side-encryption: AES256
< Accept-Ranges: bytes
< Server: AmazonS3
< X-Cache: Miss from cloudfront
< Via: 1.1 235bf7a65ed49d73ef3ff61018265510.cloudfront.net (CloudFront)
< X-Amz-Cf-Pop: HEL51-P2
< X-Amz-Cf-Id: deWZWdQg7pFtWyGuDHf5_5d0UbtFjvf5IaokK50fSU3s9kQ18jdTug==
<
* Connection #0 to host test-unvsoft.s3-accelerate.amazonaws.com left intact
<- Leaving step attempt, name 'ApiCallAttemptMonitoringMiddleware'
------------------------------------------------------------------
result was set to array(2) {
["instance"]=>
string(32) "000000001251b0300000000058fd7477"
["data"]=>
array(35) {
["DeleteMarker"]=>
bool(false)
["AcceptRanges"]=>
string(5) "bytes"
["Expiration"]=>
string(0) ""
["Restore"]=>
string(0) ""
["ArchiveStatus"]=>
string(0) ""
["LastModified"]=>
object(Aws\Api\DateTimeResult)#681 (3) {
["date"]=>
string(26) "2023-12-14 18:14:07.000000"
["timezone_type"]=>
int(2)
["timezone"]=>
string(3) "GMT"
}
["ContentLength"]=>
int(23501)
["ChecksumCRC32"]=>
string(0) ""
["ChecksumCRC32C"]=>
string(0) ""
["ChecksumSHA1"]=>
string(0) ""
["ChecksumSHA256"]=>
string(0) ""
["ETag"]=>
string(34) ""660a5324d7f84bbecb25600021b4376f""
["MissingMeta"]=>
string(0) ""
["VersionId"]=>
string(0) ""
["CacheControl"]=>
string(0) ""
["ContentDisposition"]=>
string(0) ""
["ContentEncoding"]=>
string(0) ""
["ContentLanguage"]=>
string(0) ""
["ContentType"]=>
string(24) "application/octet-stream"
["Expires"]=>
object(Aws\Api\DateTimeResult)#682 (3) {
["date"]=>
string(26) "1970-01-01 00:00:00.000000"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
["WebsiteRedirectLocation"]=>
string(0) ""
["ServerSideEncryption"]=>
string(6) "AES256"
["Metadata"]=>
array(0) {
}
["SSECustomerAlgorithm"]=>
string(0) ""
["SSECustomerKeyMD5"]=>
string(0) ""
["SSEKMSKeyId"]=>
string(0) ""
["BucketKeyEnabled"]=>
bool(false)
["StorageClass"]=>
string(0) ""
["RequestCharged"]=>
string(0) ""
["ReplicationStatus"]=>
string(0) ""
["PartsCount"]=>
string(0) ""
["ObjectLockMode"]=>
string(0) ""
["ObjectLockRetainUntilDate"]=>
object(Aws\Api\DateTimeResult)#683 (3) {
["date"]=>
string(26) "1970-01-01 00:00:00.000000"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
["ObjectLockLegalHoldStatus"]=>
string(0) ""
["@metadata"]=>
array(4) {
["statusCode"]=>
int(200)
["effectiveUri"]=>
string(103) "https://test-unvsoft.s3-accelerate.amazonaws.com/vadim/files/%7B37AEAC04-A6A7-D18A-71F0-124E6E71757A%7D"
["headers"]=>
array(15) {
["content-type"]=>
string(24) "application/octet-stream"
["content-length"]=>
string(5) "23501"
["connection"]=>
string(10) "keep-alive"
["x-amz-id-2"]=>
string(76) "SBVRuVeb0LpXQYw3H56tvIXZmv6zCWHUMDWmYXp0KnQ1X7PdPDnRLlXYafsolu46R4MndrTPFxo="
["x-amz-request-id"]=>
string(16) "GZRSYJA37Q20GCMP"
["date"]=>
string(29) "Thu, 14 Dec 2023 19:35:43 GMT"
["last-modified"]=>
string(29) "Thu, 14 Dec 2023 18:14:07 GMT"
["etag"]=>
string(34) ""660a5324d7f84bbecb25600021b4376f""
["x-amz-server-side-encryption"]=>
string(6) "AES256"
["accept-ranges"]=>
string(5) "bytes"
["server"]=>
string(8) "AmazonS3"
["x-cache"]=>
string(20) "Miss from cloudfront"
["via"]=>
string(64) "1.1 235bf7a65ed49d73ef3ff61018265510.cloudfront.net (CloudFront)"
["x-amz-cf-pop"]=>
string(8) "HEL51-P2"
["x-amz-cf-id"]=>
string(56) "deWZWdQg7pFtWyGuDHf5_5d0UbtFjvf5IaokK50fSU3s9kQ18jdTug=="
}
["transferStats"]=>
array(0) {
}
}
}
}
Inclusive step time: 0.36006808280945
<- Leaving step sign, name 's3.permanent_redirect'
--------------------------------------------------
no changes
Inclusive step time: 0.36014318466187
<- Leaving step sign, name 's3.put_object_url'
----------------------------------------------
no changes
Inclusive step time: 0.36021995544434
<- Leaving step sign, name 'signer'
-----------------------------------
no changes
Inclusive step time: 0.3603298664093
<- Leaving step sign, name 'retry'
----------------------------------
no changes
Inclusive step time: 0.36181402206421
<- Leaving step sign, name 'invocation-id'
------------------------------------------
result.data.@metadata.transferStats.http was set to array(1) {
[0]=>
array(0) {
}
}
Inclusive step time: 0.36196994781494
<- Leaving step sign, name 'StreamRequestPayloadMiddleware'
-----------------------------------------------------------
no changes
Inclusive step time: 0.36204314231873
<- Leaving step build, name 's3.bucket_endpoint_arn'
----------------------------------------------------
no changes
Inclusive step time: 0.36211013793945
<- Leaving step build, name 's3.content_type'
---------------------------------------------
no changes
Inclusive step time: 0.36228084564209
<- Leaving step build, name 's3.checksum'
-----------------------------------------
no changes
Inclusive step time: 0.36233305931091
<- Leaving step build, name 'recursion-detection'
-------------------------------------------------
no changes
Inclusive step time: 0.36239504814148
<- Leaving step build, name 'request-compression'
-------------------------------------------------
no changes
Inclusive step time: 0.36244702339172
<- Leaving step build, name 'EndpointDiscoveryMiddleware'
---------------------------------------------------------
no changes
Inclusive step time: 0.36250686645508
<- Leaving step build, name 'endpoint_parameter'
------------------------------------------------
no changes
Inclusive step time: 0.36256790161133
<- Leaving step build, name ''
------------------------------
no changes
Inclusive step time: 0.36266493797302
<- Leaving step build, name 'ApiCallMonitoringMiddleware'
---------------------------------------------------------
no changes
Inclusive step time: 0.36277198791504
<- Leaving step build, name 's3.check_empty_path_with_query'
------------------------------------------------------------
no changes
Inclusive step time: 0.36313700675964
<- Leaving step build, name 'builder'
-------------------------------------
no changes
Inclusive step time: 0.36367917060852
<- Leaving step build, name 'endpoint-resolution'
-------------------------------------------------
no changes
Inclusive step time: 0.36487889289856
<- Leaving step validate, name 'input_validation_middleware'
------------------------------------------------------------
no changes
Inclusive step time: 0.36549687385559
<- Leaving step validate, name 'validation'
-------------------------------------------
no changes
Inclusive step time: 0.36555695533752
<- Leaving step init, name 's3.head_object'
-------------------------------------------
no changes
Inclusive step time: 0.36570000648499
<- Leaving step init, name 's3.auto_encode'
-------------------------------------------
no changes
Inclusive step time: 0.36574482917786
<- Leaving step init, name 's3.location'
----------------------------------------
no changes
Inclusive step time: 0.3657910823822
<- Leaving step init, name 's3.save_as'
---------------------------------------
no changes
Inclusive step time: 0.36583495140076
<- Leaving step init, name 's3.source_file'
-------------------------------------------
no changes
Inclusive step time: 0.36587905883789
<- Leaving step init, name 's3.ssec'
------------------------------------
no changes
Inclusive step time: 0.36594200134277
<- Leaving step init, name 'idempotency_auto_fill'
--------------------------------------------------
no changes
Inclusive step time: 0.36619901657104
-> Entering step init, name 'idempotency_auto_fill'
---------------------------------------------------
command was set to array(3) {
["instance"]=>
string(32) "000000001251b0300000000058fd7477"
["name"]=>
string(9) "GetObject"
["params"]=>
array(4) {
["Bucket"]=>
string(12) "test-unvsoft"
["Key"]=>
string(50) "vadim/files/{37AEAC04-A6A7-D18A-71F0-124E6E71757A}"
["@http"]=>
array(2) {
["stream"]=>
bool(true)
["debug"]=>
resource(227) of type (stream)
}
["@context"]=>
array(0) {
}
}
}
request was set to array(0) {
}
-> Entering step init, name 's3.ssec'
-------------------------------------
no changes
-> Entering step init, name 's3.source_file'
--------------------------------------------
no changes
-> Entering step init, name 's3.save_as'
----------------------------------------
no changes
-> Entering step init, name 's3.location'
-----------------------------------------
no changes
-> Entering step init, name 's3.auto_encode'
--------------------------------------------
no changes
-> Entering step init, name 's3.head_object'
--------------------------------------------
no changes
-> Entering step validate, name 'validation'
--------------------------------------------
no changes
-> Entering step validate, name 'input_validation_middleware'
-------------------------------------------------------------
no changes
-> Entering step build, name 'endpoint-resolution'
--------------------------------------------------
no changes
-> Entering step build, name 'builder'
--------------------------------------
request.instance was set to 000000001251b0b70000000058fd7477
request.method was set to GET
request.headers was set to array(2) {
["X-Amz-Security-Token"]=>
string(7) "[TOKEN]"
["Host"]=>
array(1) {
[0]=>
string(40) "test-unvsoft.s3-accelerate.amazonaws.com"
}
}
request.scheme was set to https
request.path was set to /vadim/files/%7B37AEAC04-A6A7-D18A-71F0-124E6E71757A%7D
-> Entering step build, name 's3.check_empty_path_with_query'
-------------------------------------------------------------
no changes
-> Entering step build, name 'ApiCallMonitoringMiddleware'
----------------------------------------------------------
no changes
-> Entering step build, name ''
-------------------------------
request.instance changed from 000000001251b0b70000000058fd7477 to 000000001251b0290000000058fd7477
request.headers.X-Amz-User-Agent was set to array(1) {
[0]=>
string(53) "aws-sdk-php/3.293.10 OS/Darwin#21.6.0 lang/php#7.2.34"
}
request.headers.User-Agent was set to array(1) {
[0]=>
string(53) "aws-sdk-php/3.293.10 OS/Darwin#21.6.0 lang/php#7.2.34"
}
-> Entering step build, name 'endpoint_parameter'
-------------------------------------------------
no changes
-> Entering step build, name 'EndpointDiscoveryMiddleware'
----------------------------------------------------------
no changes
-> Entering step build, name 'request-compression'
--------------------------------------------------
no changes
-> Entering step build, name 'recursion-detection'
--------------------------------------------------
no changes
-> Entering step build, name 's3.checksum'
------------------------------------------
no changes
-> Entering step build, name 's3.content_type'
----------------------------------------------
no changes
-> Entering step build, name 's3.bucket_endpoint_arn'
-----------------------------------------------------
no changes
-> Entering step sign, name 'StreamRequestPayloadMiddleware'
------------------------------------------------------------
no changes
-> Entering step sign, name 'invocation-id'
-------------------------------------------
request.instance changed from 000000001251b0290000000058fd7477 to 000000001251b02b0000000058fd7477
request.headers.aws-sdk-invocation-id was set to array(1) {
[0]=>
string(32) "028c02d8d6c8f3590c77806783299e75"
}
-> Entering step sign, name 'retry'
-----------------------------------
request.instance changed from 000000001251b02b0000000058fd7477 to 000000001251b0250000000058fd7477
request.headers.aws-sdk-retry was set to array(1) {
[0]=>
string(3) "0/0"
}
-> Entering step sign, name 'signer'
------------------------------------
request.instance changed from 000000001251b0250000000058fd7477 to 000000001251b34f0000000058fd7477
request.headers.x-amz-content-sha256 was set to array(1) {
[0]=>
string(64) "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
request.headers.X-Amz-Date was set to array(1) {
[0]=>
string(16) "20231214T193542Z"
}
request.headers.Authorization was set to array(1) {
[0]=>
string(228) "AWS4-HMAC-SHA256 Credential=[KEY]/20231214/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-amz-user-agent, Signature=[SIGNATURE]
}
-> Entering step sign, name 's3.put_object_url'
-----------------------------------------------
no changes
-> Entering step sign, name 's3.permanent_redirect'
---------------------------------------------------
no changes
-> Entering step attempt, name 'ApiCallAttemptMonitoringMiddleware'
-------------------------------------------------------------------
no changes
<GET https://test-unvsoft.s3-accelerate.amazonaws.com/vadim/files/%7B37AEAC04-A6A7-D18A-71F0-124E6E71757A%7D> [CONNECT]
<GET https://test-unvsoft.s3-accelerate.amazonaws.com/vadim/files/%7B37AEAC04-A6A7-D18A-71F0-124E6E71757A%7D> [MIME_TYPE_IS] message: "application/octet-stream"
<GET https://test-unvsoft.s3-accelerate.amazonaws.com/vadim/files/%7B37AEAC04-A6A7-D18A-71F0-124E6E71757A%7D> [FILE_SIZE_IS] message: "Content-Length: 23501" bytes_max: "23501"
<GET https://test-unvsoft.s3-accelerate.amazonaws.com/vadim/files/%7B37AEAC04-A6A7-D18A-71F0-124E6E71757A%7D> [PROGRESS] bytes_max: "23501"
<- Leaving step attempt, name 'ApiCallAttemptMonitoringMiddleware'
------------------------------------------------------------------
result was set to array(2) {
["instance"]=>
string(32) "000000001251b1b60000000058fd7477"
["data"]=>
array(37) {
["Body"]=>
object(GuzzleHttp\Psr7\Stream)#477 (7) {
["stream":"GuzzleHttp\Psr7\Stream":private]=>
resource(232) of type (stream)
["size":"GuzzleHttp\Psr7\Stream":private]=>
NULL
["seekable":"GuzzleHttp\Psr7\Stream":private]=>
bool(false)
["readable":"GuzzleHttp\Psr7\Stream":private]=>
bool(true)
["writable":"GuzzleHttp\Psr7\Stream":private]=>
bool(false)
["uri":"GuzzleHttp\Psr7\Stream":private]=>
string(103) "https://test-unvsoft.s3-accelerate.amazonaws.com/vadim/files/%7B37AEAC04-A6A7-D18A-71F0-124E6E71757A%7D"
["customMetadata":"GuzzleHttp\Psr7\Stream":private]=>
array(0) {
}
}
["DeleteMarker"]=>
bool(false)
["AcceptRanges"]=>
string(5) "bytes"
["Expiration"]=>
string(0) ""
["Restore"]=>
string(0) ""
["LastModified"]=>
object(Aws\Api\DateTimeResult)#807 (3) {
["date"]=>
string(26) "2023-12-14 18:14:07.000000"
["timezone_type"]=>
int(2)
["timezone"]=>
string(3) "GMT"
}
["ContentLength"]=>
int(23501)
["ETag"]=>
string(34) ""660a5324d7f84bbecb25600021b4376f""
["ChecksumCRC32"]=>
string(0) ""
["ChecksumCRC32C"]=>
string(0) ""
["ChecksumSHA1"]=>
string(0) ""
["ChecksumSHA256"]=>
string(0) ""
["MissingMeta"]=>
string(0) ""
["VersionId"]=>
string(0) ""
["CacheControl"]=>
string(0) ""
["ContentDisposition"]=>
string(0) ""
["ContentEncoding"]=>
string(0) ""
["ContentLanguage"]=>
string(0) ""
["ContentRange"]=>
string(0) ""
["ContentType"]=>
string(24) "application/octet-stream"
["Expires"]=>
object(Aws\Api\DateTimeResult)#808 (3) {
["date"]=>
string(26) "1970-01-01 00:00:00.000000"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
["WebsiteRedirectLocation"]=>
string(0) ""
["ServerSideEncryption"]=>
string(6) "AES256"
["Metadata"]=>
array(0) {
}
["SSECustomerAlgorithm"]=>
string(0) ""
["SSECustomerKeyMD5"]=>
string(0) ""
["SSEKMSKeyId"]=>
string(0) ""
["BucketKeyEnabled"]=>
bool(false)
["StorageClass"]=>
string(0) ""
["RequestCharged"]=>
string(0) ""
["ReplicationStatus"]=>
string(0) ""
["PartsCount"]=>
string(0) ""
["TagCount"]=>
string(0) ""
["ObjectLockMode"]=>
string(0) ""
["ObjectLockRetainUntilDate"]=>
object(Aws\Api\DateTimeResult)#809 (3) {
["date"]=>
string(26) "1970-01-01 00:00:00.000000"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
["ObjectLockLegalHoldStatus"]=>
string(0) ""
["@metadata"]=>
array(4) {
["statusCode"]=>
int(200)
["effectiveUri"]=>
string(103) "https://test-unvsoft.s3-accelerate.amazonaws.com/vadim/files/%7B37AEAC04-A6A7-D18A-71F0-124E6E71757A%7D"
["headers"]=>
array(15) {
["content-type"]=>
string(24) "application/octet-stream"
["content-length"]=>
string(5) "23501"
["connection"]=>
string(5) "close"
["x-amz-id-2"]=>
string(76) "OcnjBQ0nmzbQgRrr9K6mQ2Qi5KA/Z2q4sHexa+mhfAp/aziZ1PnMGxk4cctG5pfrVJ1CnY7/sL8="
["x-amz-request-id"]=>
string(16) "GZRGDMQXJ0HGG152"
["date"]=>
string(29) "Thu, 14 Dec 2023 19:35:43 GMT"
["last-modified"]=>
string(29) "Thu, 14 Dec 2023 18:14:07 GMT"
["etag"]=>
string(34) ""660a5324d7f84bbecb25600021b4376f""
["x-amz-server-side-encryption"]=>
string(6) "AES256"
["accept-ranges"]=>
string(5) "bytes"
["server"]=>
string(8) "AmazonS3"
["x-cache"]=>
string(20) "Miss from cloudfront"
["via"]=>
string(64) "1.1 314739a512b2afae40702e1a95e8f8de.cloudfront.net (CloudFront)"
["x-amz-cf-pop"]=>
string(8) "HEL51-P2"
["x-amz-cf-id"]=>
string(56) "49-oZFsPUr3qVAIE5k-SehL1szfyM6z0SCdJgjX-hhfV9crfzTJFKw=="
}
["transferStats"]=>
array(0) {
}
}
}
}
Inclusive step time: 0.32320094108582
<- Leaving step sign, name 's3.permanent_redirect'
--------------------------------------------------
no changes
Inclusive step time: 0.32329487800598
<- Leaving step sign, name 's3.put_object_url'
----------------------------------------------
no changes
Inclusive step time: 0.3233630657196
<- Leaving step sign, name 'signer'
-----------------------------------
no changes
Inclusive step time: 0.3234601020813
<- Leaving step sign, name 'retry'
----------------------------------
no changes
Inclusive step time: 0.32371497154236
<- Leaving step sign, name 'invocation-id'
------------------------------------------
result.data.@metadata.transferStats.http was set to array(1) {
[0]=>
array(0) {
}
}
Inclusive step time: 0.32388997077942
<- Leaving step sign, name 'StreamRequestPayloadMiddleware'
-----------------------------------------------------------
no changes
Inclusive step time: 0.32396006584167
<- Leaving step build, name 's3.bucket_endpoint_arn'
----------------------------------------------------
no changes
Inclusive step time: 0.32403206825256
<- Leaving step build, name 's3.content_type'
---------------------------------------------
no changes
Inclusive step time: 0.32411098480225
<- Leaving step build, name 's3.checksum'
-----------------------------------------
no changes
Inclusive step time: 0.32416701316833
<- Leaving step build, name 'recursion-detection'
-------------------------------------------------
no changes
Inclusive step time: 0.32423090934753
<- Leaving step build, name 'request-compression'
-------------------------------------------------
no changes
Inclusive step time: 0.32428598403931
<- Leaving step build, name 'EndpointDiscoveryMiddleware'
---------------------------------------------------------
no changes
Inclusive step time: 0.32434892654419
<- Leaving step build, name 'endpoint_parameter'
------------------------------------------------
no changes
Inclusive step time: 0.32441306114197
<- Leaving step build, name ''
------------------------------
no changes
Inclusive step time: 0.32450485229492
<- Leaving step build, name 'ApiCallMonitoringMiddleware'
---------------------------------------------------------
no changes
Inclusive step time: 0.32457208633423
<- Leaving step build, name 's3.check_empty_path_with_query'
------------------------------------------------------------
no changes
Inclusive step time: 0.32470202445984
<- Leaving step build, name 'builder'
-------------------------------------
no changes
Inclusive step time: 0.32480812072754
<- Leaving step build, name 'endpoint-resolution'
-------------------------------------------------
no changes
Inclusive step time: 0.32498002052307
<- Leaving step validate, name 'input_validation_middleware'
------------------------------------------------------------
no changes
Inclusive step time: 0.32508301734924
<- Leaving step validate, name 'validation'
-------------------------------------------
no changes
Inclusive step time: 0.32514905929565
<- Leaving step init, name 's3.head_object'
-------------------------------------------
no changes
Inclusive step time: 0.32527995109558
<- Leaving step init, name 's3.auto_encode'
-------------------------------------------
no changes
Inclusive step time: 0.32533717155457
<- Leaving step init, name 's3.location'
----------------------------------------
no changes
Inclusive step time: 0.32539081573486
<- Leaving step init, name 's3.save_as'
---------------------------------------
no changes
Inclusive step time: 0.32543802261353
<- Leaving step init, name 's3.source_file'
-------------------------------------------
no changes
Inclusive step time: 0.32548785209656
<- Leaving step init, name 's3.ssec'
------------------------------------
no changes
Inclusive step time: 0.32555103302002
<- Leaving step init, name 'idempotency_auto_fill'
--------------------------------------------------
no changes
Inclusive step time: 0.32564783096313
Warning: fprintf(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 514
Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 516
Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 516
Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 518
Warning: fprintf(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 514
Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 516
Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 516
Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 518
Warning: fprintf(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 514
Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 516
Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 516
Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 518
Warning: fprintf(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 514
Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 516
Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 516
Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 518
PHP Warning: fprintf(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 514
PHP Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 516
PHP Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 516
PHP Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 518
PHP Warning: fprintf(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 514
PHP Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 516
PHP Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 516
PHP Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 518
PHP Warning: fprintf(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 514
PHP Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 516
PHP Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 516
PHP Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 518
PHP Warning: fprintf(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 514
PHP Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 516
PHP Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 516
PHP Warning: fwrite(): supplied resource is not a valid stream resource in
/project/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 518
Process finished with exit code 0
Hi @VadimSafonov, I tried to reproduce the reported issue with the code that you have provided but I was not able to. Would you be able to please create a test project from scratch and see if the behavior occurs there?, just to discard any outdated implementation.
This issue has not recieved a response in 1 week. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.
Hi @RanVaknin
In your reproduce case you copy file from local to s3. This case works fine for me too
But when copy file from s3 to local there is an error
Stack trace:
#0 /Users/vadimsafonov/Documents/GitHub/aws-sdk-test/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php(591): fprintf(Resource id #214, '<%s> [%s] ', 'GET https://tes...', 'PROGRESS')
#1 [internal function]: GuzzleHttp\Handler\StreamHandler::GuzzleHttp\Handler\{closure}(7, 0, NULL, 0, 15756, 932438)
#2 /Users/vadimsafonov/Documents/GitHub/aws-sdk-test/vendor/guzzlehttp/psr7/src/Stream.php(234): fread(Resource id #219, 8192)
#3 /Users/vadimsafonov/Documents/GitHub/aws-sdk-test/vendor/aws/aws-sdk-php/src/S3/StreamWrapper.php(209): GuzzleHttp\Psr7\Stream->read(8192)
#4 [internal function]: Aws\S3\StreamWrapper->stream_read(8192)
#5 /Users/vadimsafonov/Documents/GitHub/aws-sdk-test/test.php(26): copy('s3://test-unvso...', '/Users/vadimsaf...')
#6 {main}
thrown in /Users/vadimsafonov/Documents/GitHub/aws-sdk-test/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 591
Darwin Kernel Version 23.5.0
php 8.3.10
aws sdk 3.320.8
I have the same issue, we also only see the issue when copying from S3 to local (never the other way around).
My guess is that the issue is because TraceMiddleware assumes that logfn will output content (using echo or similar), and when logfn doesn't output anything (we use a custom callback that writes the log messages to a file instead) this causes some issue with the output buffering handling that TraceMiddleware is doing. after more reading and testing I think this guess is wrong.
We found a workaround - we got rid of the fprintf exception by turning off the http option, but this caused another bug instead, I have sent a PR (#3206) to fix that bug, but I still haven't found a fix for this fprintf issue.
I would love for this bug to be fixed also so that we can have a custom log function and also have the http option enabled.
Hi everyone, I am currently investigating how to fix this issue. The problem is that we are closing the resource in a early stage while guzzle still tries to use it to log. @johanrosenson I saw your workaround but it somehow conflicts with our implementation. Please find below a workaround that does not require changing the code, which can be used in the meantime while I find the best way to fix this. Sorry for the inconveniences!
Workaround:
$s3Client = newS3Client([
'region' => 'us-east-2',
]);
// Append a middleware that prevents setting a resource and just either leave guzzle to handle it$s3Client->getHandlerList()->prependInit(function ($handler) {
returnstaticfunction (
CommandInterface$command,
RequestInterface$request = null
) use ($handler) {
// Please just pick one of the following statements$command['@http']['debug'] = false; // If you want not logging$command['@http']['debug'] = true; // If you want loggingreturn$handler($command, $request);
};
});
// Then register the wrapper$s3Client->registerStreamWrapper();
Activity
yenfryherrerafeliz commentedon Dec 14, 2023
Hi @VadimSafonov, sorry to hear about your issues. Can you please provide a minimal reproducible code so we can better investigate this?. For example, we would be able to see if happens by you providing a custom logfn, or if happens with the default logfn, which can be seen here. Our default implementation will use echo to display the value.
I look forward to your response.
Thanks!
VadimSafonov commentedon Dec 14, 2023
Hi @yenfryherrerafeliz
I notice the following:
1 with default debug block config I got error, but file has been downloaded
2 without debug block config NO error, file has been downloaded
**There is reproduce code**
and i got error and log
yenfryherrerafeliz commentedon Dec 19, 2023
Hi @VadimSafonov, I tried to reproduce the reported issue with the code that you have provided but I was not able to. Would you be able to please create a test project from scratch and see if the behavior occurs there?, just to discard any outdated implementation.
I look forward to your response.
Thanks!
VadimSafonov commentedon Dec 20, 2023
Hi @yenfryherrerafeliz I attach test project error is the same
aws-sdk-test.tar.gz
3 remaining items
github-actions commentedon Aug 24, 2024
This issue has not recieved a response in 1 week. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.
VadimSafonov commentedon Aug 27, 2024
Ok. I'll try to run the code on php 8.3
I need some time
VadimSafonov commentedon Aug 27, 2024
Hi @RanVaknin
In your reproduce case you copy file from local to s3. This case works fine for me too
But when copy file from s3 to local there is an error
Darwin Kernel Version 23.5.0
php 8.3.10
aws sdk 3.320.8
johanrosenson commentedon Nov 1, 2025
I have the same issue, we also only see the issue when copying from S3 to local (never the other way around).
My guess is that the issue is becauseafter more reading and testing I think this guess is wrong.TraceMiddlewareassumes thatlogfnwill output content (using echo or similar), and whenlogfndoesn't output anything (we use a custom callback that writes the log messages to a file instead) this causes some issue with the output buffering handling that TraceMiddleware is doing.We found a workaround - we got rid of the
fprintfexception by turning off the http option, but this caused another bug instead, I have sent a PR (#3206) to fix that bug, but I still haven't found a fix for this fprintf issue.I would love for this bug to be fixed also so that we can have a custom log function and also have the http option enabled.
yenfryherrerafeliz commentedon Dec 10, 2025
Hi everyone, I am currently investigating how to fix this issue. The problem is that we are closing the resource in a early stage while guzzle still tries to use it to log. @johanrosenson I saw your workaround but it somehow conflicts with our implementation. Please find below a workaround that does not require changing the code, which can be used in the meantime while I find the best way to fix this. Sorry for the inconveniences!
Workaround:
Thank you!