Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetObject() command @http stream issue #2910

Closed
RafficMohammed opened this issue Apr 17, 2024 · 3 comments
Closed

GetObject() command @http stream issue #2910

RafficMohammed opened this issue Apr 17, 2024 · 3 comments
Assignees
Labels
closed-for-staleness guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@RafficMohammed
Copy link

Describe the bug

In StreamWrapper.php

Screenshot from 2024-04-17 14-27-31

Because of this line => $command['@http']['stream'] = true;
I'm getting bellow error

Screenshot from 2024-04-17 14-28-02

If I set stream as true or remove the line, it's working as expected.

Expected Behavior

I need @http.stream to be true. Because our file can have large data.

Current Behavior

@http.stream => true is not working

Reproduction Steps

Create S3 Private Bucket and try this operation

Possible Solution

No response

Additional Information/Context

No response

SDK version used

3.29

Environment details (Version of PHP (php -v)? OS name and version, etc.)

Ubuntu 22, Php => 8.1

@RafficMohammed RafficMohammed added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 17, 2024
@RafficMohammed RafficMohammed changed the title fopen() throws Error executing "GetObject" GetObject() command @http stream issue Apr 17, 2024
@yenfryherrerafeliz yenfryherrerafeliz self-assigned this Apr 17, 2024
@yenfryherrerafeliz yenfryherrerafeliz added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Apr 26, 2024
@yenfryherrerafeliz
Copy link
Contributor

Hi @RafficMohammed, sorry to hear about your issue. The only issue I can I see here is that you are using an old version of the SDK. Would you be able to update to a most recent version?, and then see if the issue persists there?. If after updating the issue persists then, could you please try with my code example below, and provide the results here?.

By running the code below and using the latest version I had not issues:

<?php
require '../vendor/autoload.php';

use Aws\S3\S3Client;


$s3Client = new S3Client([
    'region' => 'us-east-2',
    'debug' => true
]);
$result = $s3Client->getObject([
    'Bucket' => getenv('TEST_BUCKET'),
    'Key' => getenv('TEST_KEY'),
    '@http' => [
        'stream' => true
    ]
]);

Result:

Array
(
    [statusCode] => 200
    [effectiveUri] => https://herrergy-sample-bucket.s3.us-east-2.amazonaws.com/herrergy-sample-key.txt
    [headers] => Array
        (
            redacted
        )
)
This is a test file for getObject!

Note: In the scenario that the issue persists after updating to a most recent version of the SDK, please make sure you redact any sensitive information in any new information provided and please make sure you replace the values given to Bucket and Key in my code with your own bucket and key values.

I hope this helps!

Thanks!

@yenfryherrerafeliz yenfryherrerafeliz added guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed bug This issue is a bug. investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-triage This issue or PR still needs to be triaged. labels Apr 29, 2024
@RafficMohammed
Copy link
Author

@yenfryherrerafeliz I will try and get back to you soon

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label May 8, 2024
@yenfryherrerafeliz yenfryherrerafeliz added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label May 8, 2024
Copy link

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.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-for-staleness guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants