Assets (in assets folder) failing to load locally [Craft 2] I'm trying to get my Craft 2 site running locally again (it worked at one point but now does not).
I have gotten all the db related issues (seemingly) done and dusted and the admin loads fine, but it seems that anything linked to Amazon S3 (or perhaps the {{ craft.config.rootUrl }}?) seems to be failing.
The devtools console has a lot of :
Failed to load resource: the server responded with a status of 404 (Not Found)
The local set up is using docker inside a virtual machine and is brought up using vagrant. I have all the code locally tied to lvh.me (on a specific port) and when the site loads, some external services (such as Imager) are still working – just nothing relating to aws / S3 for some reason.
Has anyone encountered this before? Have I forgotten to set something up re: Multi Environment variables or perhaps did Google change a policy that requires me to add permissions to the IAM user to allow for local access?
Thanks in advance for any steers.
Really at an impasse here. Can anyone help?
edit:
After helpful comments, I am getting the impression that since the path to the root of the Assets folder is something that is controlled by the general.php file and the files that aren't loading seem to be directly inside there (and local, as opposed to on S3), that maybe this isn't an S3 issue (yet). It seems that the local path to the Assets folder is least part of the problem.
Here's what my set up in general.php looks like:
// $protocol = isset($_SERVER['CRAFT_PROTOCOL']) ? $_SERVER['CRAFT_PROTOCOL'] : 'https';
$protocol = $_ENV['CRAFT_PROTOCOL'];
// force http on local environment
if ($_SERVER['REMOTE_ADDR'] == '127.0.0.1' ) {
    $protocol = 'http';
}

return array(
    '*' =&gt; array(
        'devMode' =&gt; false,
        'omitScriptNameInUrls' =&gt; true,
        'preserveImageColorProfiles' =&gt; true,
        'backupDbOnUpdate' =&gt; false,
        'generateTransformsBeforePageLoad' =&gt; true,
        'maxUploadFileSize' =&gt; 33554432,
        'environmentVariables' =&gt; array(
            'baseUrl' =&gt; $protocol.'://'.$_ENV['SITE_URL'].'/',
            'basePath' =&gt; $_ENV['DOCUMENT_ROOT'].'/',
            'assetsUrl' =&gt; $protocol.'://'.$_ENV['SITE_URL'].'/'
        ),
        'rootUrl' =&gt; $protocol.'://'.$_ENV['SITE_URL'],
        'siteUrl' =&gt; array(
            'en_gb' =&gt; $protocol.'://'.$_ENV['HTTP_HOST'].'/',
            'ja_jp' =&gt; $protocol.'://'.$_ENV['HTTP_HOST'].'/'
        ),
    ),
);

Anything look out of place to anyone? The assets that won't load locally, via lvh.me, are in the *public &gt; assets &gt; folder (e.g. public&gt; assets &gt; js &gt; app.js). They load fine in the staging environment, but just not locally.  It feels like either a Docker / CI issue relating to the Sandbox or just a config issue with the settings above.
The error is a 404 not found and that URL is reading:
http://lvh.me/assets/js/app.js?v=14
What do you think?
My guess is that your bucket doesn't have the right permissions. Try adding this permission to your bucket (use with caution since this will make the S3 100% public):
{
    &quot;Version&quot;: &quot;2012-10-17&quot;,
    &quot;Statement&quot;: [
        {
            &quot;Sid&quot;: &quot;PublicReadGetObject&quot;,
            &quot;Effect&quot;: &quot;Allow&quot;,
            &quot;Principal&quot;: &quot;*&quot;,
            &quot;Action&quot;: &quot;s3:GetObject&quot;,
            &quot;Resource&quot;: &quot;arn:aws:s3:::bucketname/*&quot;
        }
    ]
}

Replace bucketname with your actual bucket name. You can add this policy via the AWS UI console. In S3 &gt; YourBucket &gt; Permissions &gt; Bucket Policy.
If by doing this you actually manage to get URLs that resolve, then your problem are permissions. I would still delete this bucket policy and set the correct permissions for your use case.