Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

S3 Module 'Failed to connect to S3: Region does not seem to be available for aws module boto.s3.' #3447

Closed
filipenf opened this issue Apr 15, 2016 · 15 comments

Comments

@filipenf
Copy link

ISSUE TYPE
  • Bug Report
COMPONENT NAME
  • s3
ANSIBLE VERSION
2.1.0 - devel
OS / ENVIRONMENT
  • CentOS 7.2 / MacOS X 10.11.4
  • Boto 2.39.0
SUMMARY

Since commit 0dd58e932680af5d3544a045c5ea0bd0c9eadeb0 (Use connect_to_aws where possible) this error started to happen.

Testing with one commit before: 344cf5fc0e2c8637fe9513206b2c843ca60264cf it is working fine.

STEPS TO REPRODUCE
ansible -i localhost, -c local -m s3 -a 'bucket=<somebucket> object=<some_object> dest=/tmp/file mode=get' localhost
localhost | FAILED! => {
    "changed": false,
    "failed": true,
    "msg": "Failed to connect to S3: Region  does not seem to be available for aws module boto.s3. If the region definitely exists, you may need to upgrade boto or extend with endpoints_path"
}
EXPECTED RESULTS
localhost | SUCCESS => {
    "changed": true,
    "msg": "GET operation complete"
}
@filipenf
Copy link
Author

#3347 seems to fix this!

@gunzy83
Copy link

gunzy83 commented Jun 9, 2016

We ran into this and explicitly setting the region in the task seemed to fix it for us.

@dmrsol
Copy link

dmrsol commented Jun 22, 2016

The same problem. "Failed to connect to S3: Region eu-central-1 does not seem to be available for aws module boto.s3. If the region definitely exists, you may need to upgrade boto or extend with endpoints_path".
Ansible 2.1.0.0, boto3 1.3.1

@fideloper
Copy link

The docs are unclear: Do I need to set AWS_REGION and the credentials on the machine Ansible SSH's into, or just on the machine Running Ansible?

I'm guessing it needs them for the server be connected to. The weird part is I receive the region error (no region set, note the extra space between "Region does": Region does not seem to be available for aws module boto.s3) even when I specify the region within the task.

@ansibot
Copy link

ansibot commented Jul 31, 2016

@ansible, ping. This issue is still waiting on your response.
click here for bot help

@mmoleksf
Copy link

mmoleksf commented Aug 8, 2016

Any update on this issue?

@jasonab
Copy link

jasonab commented Aug 12, 2016

This bug appears to be fixed in 2.1.1.0

@mmoleksf
Copy link

mmoleksf commented Aug 15, 2016

I tryed this morning and it seems that the previous issue is gone but now I somehow cannot get it to connect to bucket. It always says that the bucket cannot be found. Here is the debug output from the run:

fatal: [hstreaming04]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_args": {"aws_access_key": "<my_key_is_present_here>", "aws_secret_key": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "bucket": "my_bucket_name", "dest": "/tmp/somescript.sh", "ec2_url": null, "encrypt": true, "expiry": 600, "headers": null, "marker": null, "max_keys": 1000, "metadata": null, "mode": "get", "object": "/somescript.sh", "overwrite": "always", "permission": ["private"], "prefix": null, "profile": null, "region": null, "retries": 0, "s3_url": null, "security_token": null, "src": null, "validate_certs": true, "version": null}, "module_name": "s3"}, "msg": "Source bucket cannot be found"}

ansible code:

- name: Deploy the script to server
  s3: bucket=my_bucket_name  object=/somescript.sh  dest=/tmp/somescript.sh mode=get aws_access_key='<my_key>' aws_secret_key='<my_secret>'
  become: yes
  tags:
    - s3

Am I doing something wrong?

@ansibot
Copy link

ansibot commented Sep 8, 2016

@ansible, ping. This issue is still waiting on your response.
click here for bot help

@julienvey
Copy link
Contributor

I confirm that the issue is fixed in 2.1.1.0

@mmoleksf for your issue, does the bucket you are trying to access is the same region as the env var AWS_REGION ?

@ansibot
Copy link

ansibot commented Sep 30, 2016

@ansible, ping. This issue is still waiting on your response.
click here for bot help

3 similar comments
@ansibot
Copy link

ansibot commented Oct 16, 2016

@ansible, ping. This issue is still waiting on your response.
click here for bot help

@ansibot
Copy link

ansibot commented Oct 31, 2016

@ansible, ping. This issue is still waiting on your response.
click here for bot help

@ansibot
Copy link

ansibot commented Nov 15, 2016

@ansible, ping. This issue is still waiting on your response.
click here for bot help

@ansibot
Copy link

ansibot commented Dec 7, 2016

This repository has been locked. All new issues and pull requests should be filed in https://github.com/ansible/ansible

Please read through the repomerge page in the dev guide. The guide contains links to tools which automatically move your issue or pull request to the ansible/ansible repo.

@ansibot ansibot closed this as completed Sep 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants