thaiphan / magento2-s3

Use Amazon S3 as the file storage solution for your Magento 2 application
MIT License
142 stars 95 forks source link

report.CRITICAL: Unable to unserialize value, string is corrupted. #50

Closed jobrandon closed 6 years ago

jobrandon commented 6 years ago

Hi,

I execute the bin/magento s3:storage:export and got this error. {"exception":"[object] (InvalidArgumentException(code: 0): Unable to unserialize value, string is corrupted. at /var/www/html/stg/vendor/magento/framework/Serialize/Serializer/Serialize.php:38)"} []

thaiphan commented 6 years ago

Hi @jobrandon, This might have been caused by an old bug that should be addressed by the latest version. Can you confirm what version you're using? Regards, Thai

jobrandon commented 6 years ago

Magento version 2.2.3. I found out that the problem is a unserializing the custom headers.

thaiphan commented 6 years ago

Have you resolved the problem or do you still need assistance?

jobrandon commented 6 years ago

My solution was a quick fix. I removed the custom header which actually not necessary for my use.

jobrandon commented 6 years ago

Then I got this message. Is this related to the fix?

`<?xml version=\"1.0\" encoding=\"UTF-8\"?>

AccessDeniedAccess Denied2EC08E0523DBAF47a/MrVnQgp2Yhm1jrl9AbXtcigMGSK8lbfswr4wEGQxln/G7Pb+lWrAbzLbGPGLrmu4Elvs3maZ0= at /var/www/html/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php:191, GuzzleHttp\\Exception\\ClientException(code: 403): Client error: `PUT https://s3.ap-southeast-1.amazonaws.com/images-app.testing.com/assets/external/images/icons/icons_48-browsing-white.png` resulted in a `403 Forbidden` response: AccessDeniedAccess Denied2EC08E (truncated...) at /var/www/html/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113)"} [] [2018-06-28 06:41:18] report.CRITICAL: Error executing "PutObject" on "https://s3.ap-southeast-1.amazonaws.com/images-app.testing.com/assets/external/images/icons/icons_48-browsing-white.png"; AWS HTTP error: Client error: `PUT https://s3.ap-southeast-1.amazonaws.com/images-app.testing.com/assets/external/images/icons/icons_48-browsing-white.png` resulted in a `403 Forbidden` response:`
thaiphan commented 6 years ago

That reads like your S3 credentials are incorrect. Can you review s3:config:list and see if everything is correct?

jobrandon commented 6 years ago

Thanks!, it works fine now. The only thing now is the custom header whenever necessary to use it.

thaiphan commented 6 years ago

Hey @jobrandon

Yeah, I'm planning on adding some new CLI tools for that as well eventually. Good to see everything is working now!

I'll be closing this ticket then.

Best of luck with your store.

Regards,

Thai

cybpoonam commented 6 years ago

Hi @jobrandon,

how you resoled this issue. i am also getting same issue.

report.CRITICAL: Unable to unserialize value, string is corrupted. {"exception":"[object] (InvalidArgumentException(code: 0): Unable to unserialize value, string is corrupted. at /spdata/specapps/vansdev4/vendor/magento/framework/Serialize/Serializer/Serialize.php:38)"} []

Thanks Poonam

cybpoonam commented 6 years ago

Hi @thaiphan ,

Can you please suggest, how i can fix this issue.

Thanks

vijaydcyb commented 6 years ago

Hi @jobrandom

Could you please let us know how you resolved that access denied issue

I have set $meta['ACL' =>'public-write']; in s3.php But still issue persist

@thai you please also suggest the solution

Thanks

jobrandon commented 6 years ago

Hi @vijaydcyb Try this one Thai\S3\Model\MediaStorage\File\Storage\S3

public function getMetadata()
{
    $meta = [];
    /*$headers = $this->helper->getCustomHeaders();
    if ($headers) {
        $unserializedHeaders = $this->serializer->unserialize($headers);
        foreach ($unserializedHeaders as $header) {
            $meta[$header['header']] = $header['value'];
        }
    }*/
    return $meta;
}
vijaydcyb commented 6 years ago

Hi @jobrandon

Hi already tried this. Commented the code but while adding images from admin it throws the access denied error

The credentials are correct ones

keyurbhagat80 commented 6 years ago

hi @jobrandon Thanks that worked for me.

thaiphan commented 6 years ago

Hi @jobrandon, @cybpoonam, @keyurbhagat80

Sorry for taking so long to get back to you!

As described in #55, I have pushed up v1.3.2 that should hopefully resolve this problem. Can you update to the latest version of the extension and tell me if it's working now?

Regards,

Thai

thaiphan commented 6 years ago

I'm closing this ticket. If problems persist, feel free to reply here or open a new ticket!