Aws\S3\Exception\S3Exception: Error executing "PutObject" on "https://bucket-name.s3.us-east-2.amazonaws.com/data/avatars/o/0/3.jpg"; AWS HTTP error: Client error: `PUT https://bucket-name.s3.us-east-2.amazonaws.com/data/avatars/o/0/3.jpg` resulted in a `403 Forbidden` response: <?xml version="1.0" encoding="UTF-8"?> <Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>F5164F (truncated...) AccessDenied (client): Access Denied - <?xml version="1.0" encoding="UTF-8"?> <Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>Some-Numbers-Here</RequestId><HostId>Some-More-Numbers-Here=</HostId></Error> src/addons/XFAws/_vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php:191
#0 src/addons/XFAws/_vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php(100): Aws\WrappedHttpHandler->parseError(Array, Object(GuzzleHttp\Psr7\Request), Object(Aws\Command), Array)
#1 src/vendor/guzzlehttp/promises/src/Promise.php(203): Aws\WrappedHttpHandler->Aws\{closure}(Array)
#2 src/vendor/guzzlehttp/promises/src/Promise.php(174): GuzzleHttp\Promise\Promise::callHandler(2, Array, Array)
#3 src/vendor/guzzlehttp/promises/src/RejectedPromise.php(40): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}(Array)
#4 src/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\Promise\RejectedPromise::GuzzleHttp\Promise\{closure}()
#5 src/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(98): GuzzleHttp\Promise\TaskQueue->run()
#6 src/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(125): GuzzleHttp\Handler\CurlMultiHandler->tick()
#7 src/vendor/guzzlehttp/promises/src/Promise.php(246): GuzzleHttp\Handler\CurlMultiHandler->execute(true)
#8 src/vendor/guzzlehttp/promises/src/Promise.php(223): GuzzleHttp\Promise\Promise->invokeWaitFn()
#9 src/vendor/guzzlehttp/promises/src/Promise.php(267): GuzzleHttp\Promise\Promise->waitIfPending()
#10 src/vendor/guzzlehttp/promises/src/Promise.php(225): GuzzleHttp\Promise\Promise->invokeWaitList()
#11 src/vendor/guzzlehttp/promises/src/Promise.php(267): GuzzleHttp\Promise\Promise->waitIfPending()
#12 src/vendor/guzzlehttp/promises/src/Promise.php(225): GuzzleHttp\Promise\Promise->invokeWaitList()
#13 src/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#14 src/addons/XFAws/_vendor/aws/aws-sdk-php/src/S3/S3ClientTrait.php(34): GuzzleHttp\Promise\Promise->wait()
#15 src/addons/XFAws/_vendor/league/flysystem-aws-s3-v3/src/AwsS3Adapter.php(596): Aws\S3\S3Client->upload('bucket-name', 'data/avatars/o/...', Resource id #11, 'public-read', Array)
#16 src/addons/XFAws/_vendor/league/flysystem-aws-s3-v3/src/AwsS3Adapter.php(380): League\Flysystem\AwsS3v3\AwsS3Adapter->upload('avatars/o/0/3.j...', Resource id #11, Object(League\Flysystem\Config))
#17 src/vendor/league/flysystem/src/Filesystem.php(122): League\Flysystem\AwsS3v3\AwsS3Adapter->writeStream('avatars/o/0/3.j...', Resource id #11, Object(League\Flysystem\Config))
#18 [internal function]: League\Flysystem\Filesystem->putStream('avatars/o/0/3.j...', Resource id #11, Object(League\Flysystem\Config))
#19 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(431): call_user_func_array('parent::putStre...', Array)
#20 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(395): League\Flysystem\EventableFilesystem\EventableFilesystem->callFilesystemMethod('putStream', Array)
#21 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(71): League\Flysystem\EventableFilesystem\EventableFilesystem->delegateMethodCall('putStream', Array)
#22 src/vendor/league/flysystem/src/MountManager.php(613): League\Flysystem\EventableFilesystem\EventableFilesystem->putStream('avatars/o/0/3.j...', Resource id #11, Array)
#23 src/XF/Util/File.php(185): League\Flysystem\MountManager->putStream('avatars/o/0/3.j...', Resource id #11, Array)
#24 src/XF/Service/User/Avatar.php(269): XF\Util\File::copyFileToAbstractedPath('/tmp/phpG4NluK', 'data://avatars/...')
#25 src/XF/Pub/Controller/Account.php(466): XF\Service\User\Avatar->updateAvatar()
#26 src/XF/Mvc/Dispatcher.php(321): XF\Pub\Controller\Account->actionAvatar(Object(XF\Mvc\ParameterBag))
#27 src/XF/Mvc/Dispatcher.php(248): XF\Mvc\Dispatcher->dispatchClass('XF:Account', 'Avatar', Object(XF\Mvc\RouteMatch), Object(ThemeHouse\UIX\XF\Pub\Controller\Account), NULL)
#28 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(ThemeHouse\UIX\XF\Pub\Controller\Account), NULL)
#29 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#30 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()
#31 src/XF.php(390): XF\App->run()
#32 index.php(20): XF::runApp('XF\\Pub\\App')
#33 {main}
-------------
Previous GuzzleHttp\Exception\ClientException: Client error: `PUT https://bucket-name.s3.us-east-2.amazonaws.com/data/avatars/o/0/3.jpg` resulted in a `403 Forbidden` response:
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>F5164F (truncated...)
- src/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
#0 src/vendor/guzzlehttp/guzzle/src/Middleware.php(66): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 src/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 src/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), Array)
#3 src/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()
#4 src/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(98): GuzzleHttp\Promise\TaskQueue->run()
#5 src/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(125): GuzzleHttp\Handler\CurlMultiHandler->tick()
#6 src/vendor/guzzlehttp/promises/src/Promise.php(246): GuzzleHttp\Handler\CurlMultiHandler->execute(true)
#7 src/vendor/guzzlehttp/promises/src/Promise.php(223): GuzzleHttp\Promise\Promise->invokeWaitFn()
#8 src/vendor/guzzlehttp/promises/src/Promise.php(267): GuzzleHttp\Promise\Promise->waitIfPending()
#9 src/vendor/guzzlehttp/promises/src/Promise.php(225): GuzzleHttp\Promise\Promise->invokeWaitList()
#10 src/vendor/guzzlehttp/promises/src/Promise.php(267): GuzzleHttp\Promise\Promise->waitIfPending()
#11 src/vendor/guzzlehttp/promises/src/Promise.php(225): GuzzleHttp\Promise\Promise->invokeWaitList()
#12 src/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#13 src/addons/XFAws/_vendor/aws/aws-sdk-php/src/S3/S3ClientTrait.php(34): GuzzleHttp\Promise\Promise->wait()
#14 src/addons/XFAws/_vendor/league/flysystem-aws-s3-v3/src/AwsS3Adapter.php(596): Aws\S3\S3Client->upload('bucket-name', 'data/avatars/o/...', Resource id #11, 'public-read', Array)
#15 src/addons/XFAws/_vendor/league/flysystem-aws-s3-v3/src/AwsS3Adapter.php(380): League\Flysystem\AwsS3v3\AwsS3Adapter->upload('avatars/o/0/3.j...', Resource id #11, Object(League\Flysystem\Config))
#16 src/vendor/league/flysystem/src/Filesystem.php(122): League\Flysystem\AwsS3v3\AwsS3Adapter->writeStream('avatars/o/0/3.j...', Resource id #11, Object(League\Flysystem\Config))
#17 [internal function]: League\Flysystem\Filesystem->putStream('avatars/o/0/3.j...', Resource id #11, Object(League\Flysystem\Config))
#18 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(431): call_user_func_array('parent::putStre...', Array)
#19 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(395): League\Flysystem\EventableFilesystem\EventableFilesystem->callFilesystemMethod('putStream', Array)
#20 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(71): League\Flysystem\EventableFilesystem\EventableFilesystem->delegateMethodCall('putStream', Array)
#21 src/vendor/league/flysystem/src/MountManager.php(613): League\Flysystem\EventableFilesystem\EventableFilesystem->putStream('avatars/o/0/3.j...', Resource id #11, Array)
#22 src/XF/Util/File.php(185): League\Flysystem\MountManager->putStream('avatars/o/0/3.j...', Resource id #11, Array)
#23 src/XF/Service/User/Avatar.php(269): XF\Util\File::copyFileToAbstractedPath('/tmp/phpG4NluK', 'data://avatars/...')
#24 src/XF/Pub/Controller/Account.php(466): XF\Service\User\Avatar->updateAvatar()
#25 src/XF/Mvc/Dispatcher.php(321): XF\Pub\Controller\Account->actionAvatar(Object(XF\Mvc\ParameterBag))
#26 src/XF/Mvc/Dispatcher.php(248): XF\Mvc\Dispatcher->dispatchClass('XF:Account', 'Avatar', Object(XF\Mvc\RouteMatch), Object(ThemeHouse\UIX\XF\Pub\Controller\Account), NULL)
#27 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(ThemeHouse\UIX\XF\Pub\Controller\Account), NULL)
#28 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#29 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()
#30 src/XF.php(390): XF\App->run()
#31 index.php(20): XF::runApp('XF\\Pub\\App')
#32 {main}
Code:Aws\S3\Exception\S3Exception: Error executing "PutObject" on "https://bucket-name.s3.us-east-2.amazonaws.com/data/avatars/o/0/3.jpg"; AWS HTTP error: Client error: [ICODE]PUT https://bucket-name.s3.us-east-2.amazonaws.com/data/avatars/o/0/3.jpg[/ICODE] resulted in a [ICODE]403 Forbidden[/ICODE] response: <?xml version="1.0" encoding="UTF-8"?> <Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>F5164F (truncated...) AccessDenied (client): Access Denied - <?xml version="1.0" encoding="UTF-8"?> <Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>Some-Numbers-Here</RequestId><HostId>Some-More-Numbers-Here=</HostId></Error> src/addons/XFAws/_vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php:191 I think I've followed everything from the guide but I get this error when trying to upload an avatar. I haven't touched permissions or anything besides what was mentioned for the IAM user. [/QUOTE] I am getting nearly the same error. I tried resolving the issue by adding "AmazonS3FullAccess" policy to my user but same error. (So I removed that policy).
PUT http://mehello.s3.us-east-1.amazonaws.com/internal_data/attachments/0/57-efc0883104f65080302d5b89d2c726d9.data
resulted in a 403 Forbidden
response: <?xml version="1.0" encoding="UTF-8"?> <Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>EC975C (truncated...) AccessDenied (client): Access Denied - <?xml version="1.0" encoding="UTF-8"?> <Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>EC975C2012290993</RequestId><HostId>YaXKTcmqTUrR9RnlPvG93AB+iFSfGGI36DDxWaJ2Slgme4pO7p0vEt80E5UhbCS6lkvyAIc0ITU=</HostId></Error> in src/addons/XFAws/_vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php at line 191{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:ReplicateObject",
"s3:PutObject",
"s3:GetObjectAcl",
"s3:GetObject",
"s3:ListBucket",
"s3:DeleteObject",
"s3:PutObjectAcl"
],
"Resource": [
"arn:aws:s3:::BUCKETNAME",
"arn:aws:s3:::BUCKETNAME/*"
],
"Condition": {
"IpAddress": {
"aws:SourceIp": "PUBLIC_IP_ADDRESS_OF_XENFORO_SERVER"
}
}
}
]
}
Finally got this working in its entirety with the help of unruly1 and others. This is a great resource considering the bulk of running a forum is ensuring there is enough storage space, an having a cost-effective way of offloading images. However, the problem using this add-on is when you delete an image off the forum it remains in the S3 bucket... This essentially means you are paying for images that are no longer utilized on the forum. Not Good! Penny Wise… Dollar Foolish.
As I can see, if you want to delete an image from a thread and make it also delete in S3/DO space, it would need more complicated step to do, which.. i think more codingFinally got this working in its entirety with the help of unruly1 and others. This is a great resource considering the bulk of running a forum is ensuring there is enough storage space, an having a cost-effective way of offloading images. However, the problem using this add-on is when you delete an image off the forum it remains in the S3 bucket... This essentially means you are paying for images that are no longer utilized on the forum. Not Good! Penny Wise… Dollar Foolish.
Can you comment here @Chris D ?Yes. performs the same way for Digital Ocean Spaces unfortunately...
Attachment files are not deleted immediately, whether they are stored locally or remotely.
They are deleted by cron job. For attachments you have just uploaded and deleted the files will remain on the server for up to 24 hours. For older attachments you have just deleted the files will remain on the server for up to 1 hour.
Did it work?I stand corrected... That is Good news!!!! I will test this out. Thanks
We use essential cookies to make this site work, and optional cookies to enhance your experience.