AWS S3 has to load before I execute commands on the command line

0 votes

I have a django project integrated with s3, and everytime I want to execute something on the command line, e.g. python manage.py migrate, the terminal has to load this first:

BEGIN REQUEST++++++++++++++++++++++++++++++++++++
Request URL = https://ec2.amazonaws.com?Action=DescribeRegions&Version=2013-10-15

RESPONSE++++++++++++++++++++++++++++++++++++
Response code: 200

and this creates a few seconds delay for my command to execute. Is there any way I can prevent this from happening as it's causing delays in development.

settings.py

from draft1.aws.conf import *
from draft1.aws.conf import S3_URL, AWS_STORAGE_BUCKET_NAME
STATIC_URL = S3_URL + 'static/'
MEDIA_URL = '//%s.s3.amazonaws.com/media/' % AWS_STORAGE_BUCKET_NAME
MEDIA_ROOT = MEDIA_URL
ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'

Nov 15, 2018 in AWS by Jino
• 5,820 points
1,018 views
<?xml version="1.0" encoding="UTF-8"?>
<DescribeRegionsResponse xmlns="http://ec2.amazonaws.com/doc/2013-10-15/">
    <requestId>936a670c-3q31-33kc-8713-1d0gbe6ad222</requestId>
    <regionInfo>
        <item>
            <regionName>ap-south-1</regionName>
            <regionEndpoint>ec2.ap-south-1.amazonaws.com</regionEndpoint>
        </item>
        <item>
            <regionName>eu-west-3</regionName>
            <regionEndpoint>ec2.eu-west-3.amazonaws.com</regionEndpoint>
        </item>
        <item>
            <regionName>eu-west-2</regionName>
            <regionEndpoint>ec2.eu-west-2.amazonaws.com</regionEndpoint>
        </item>
        <item>
            <regionName>eu-west-1</regionName>
            <regionEndpoint>ec2.eu-west-1.amazonaws.com</regionEndpoint>
        </item>
        <item>
            <regionName>ap-northeast-2</regionName>
            <regionEndpoint>ec2.ap-northeast-2.amazonaws.com</regionEndpoint>
        </item>
        <item>
            <regionName>ap-northeast-1</regionName>
            <regionEndpoint>ec2.ap-northeast-1.amazonaws.com</regionEndpoint>
        </item>
        <item>
            <regionName>sa-east-1</regionName>
            <regionEndpoint>ec2.sa-east-1.amazonaws.com</regionEndpoint>
        </item>
        <item>
            <regionName>ca-central-1</regionName>
            <regionEndpoint>ec2.ca-central-1.amazonaws.com</regionEndpoint>
        </item>
        <item>
            <regionName>ap-southeast-1</regionName>
            <regionEndpoint>ec2.ap-southeast-1.amazonaws.com</regionEndpoint>
        </item>
        <item>
            <regionName>ap-southeast-2</regionName>
            <regionEndpoint>ec2.ap-southeast-2.amazonaws.com</regionEndpoint>
        </item>
        <item>
            <regionName>eu-central-1</regionName>
            <regionEndpoint>ec2.eu-central-1.amazonaws.com</regionEndpoint>
        </item>
        <item>
            <regionName>us-east-1</regionName>
            <regionEndpoint>ec2.us-east-1.amazonaws.com</regionEndpoint>
        </item>
        <item>
            <regionName>us-east-2</regionName>
            <regionEndpoint>ec2.us-east-2.amazonaws.com</regionEndpoint>
        </item>
        <item>
            <regionName>us-west-1</regionName>
            <regionEndpoint>ec2.us-west-1.amazonaws.com</regionEndpoint>
        </item>
        <item>
            <regionName>us-west-2</regionName>
            <regionEndpoint>ec2.us-west-2.amazonaws.com</regionEndpoint>
        </item>
    </regionInfo>
</DescribeRegionsResponse>

1 answer to this question.

0 votes

Grep your project for boto or boto3 if you're using AWS python sdk. Move the contents of the ~/.awsfolder to some other folder or temporarily remove the aws credentials from your project (if it's your local development environment) which will make the function call to raise an exception.

answered Nov 15, 2018 by findingbugs
• 3,260 points

Related Questions In AWS

0 votes
2 answers

How to display just the name of files using aws s3 ls command?

aws s3 ls s3://<your_bucket_name>/ | awk '{print ...READ MORE

answered Mar 17, 2019 in AWS by anonymous
22,305 views
0 votes
1 answer
0 votes
1 answer

How to catch boto3 Errors

You've summarized the situation well. The old boto had ...READ MORE

answered Sep 28, 2018 in AWS by Priyaj
• 58,020 points
21,653 views
0 votes
1 answer

AWS S3 uploading hidden files by default

versioning is enabled in your bucket. docs.aws.amazon.com/AmazonS3/latest/user-guide/….... the ...READ MORE

answered Oct 4, 2018 in AWS by Priyaj
• 58,020 points
6,006 views
–1 vote
1 answer

How to decrypt the encrypted S3 file using aws-encryption-cli --decrypt

Use command : aws s3 presign s3://mybucket/abc_count.png you get ...READ MORE

answered Oct 22, 2018 in AWS by Priyaj
• 58,020 points
5,231 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP