简体   繁体   English

使用Toil连接到AWS Cloud中的S3存储桶时禁止使用403

[英]403 Forbidden when connecting to S3 bucket in AWS Cloud using Toil

I am a newbie in Toil and AWS trying to run HelloWorld.py example in the Toil Document. 我是Toil和AWS的新手,试图在Toil文档中运行HelloWorld.py示例。 I have already successfully installed toil and related python packages on my local mac laptop and have setup my account at AWS. 我已经在本地Mac笔记本电脑上成功安装了toil和相关的python软件包,并在AWS上设置了我的帐户。 I have created a small leader/worker cluster 我创建了一个小型领导者/工人集群

$ cgcloud create-cluster toil -s 2 -t m3.large 
and started it:
$ cgcloud ssh toil-leader 

This changed my screen prompt to: 这将我的屏幕提示更改为:

mesosbox@ip-172-31-25-135:~$

Then from an other window on my mac, I started the Toil HellowWorld example with with command: 然后从Mac上的另一个窗口,使用以下命令启动Toil HellowWorld示例:

$ python2.7 HelloWorld.py --batchSystem=mesos --mesosMaster=mesos-master:5050 aws:us-west-2:my-aws-jobstore

And I got the following output: 我得到以下输出:

Apples-Air 2017-06-02 19:30:53,524 MainThread INFO toil.lib.bioio: Root logger is at level 'INFO', 'toil' logger at level 'INFO'.
    Apples-Air 2017-06-02 19:30:53,524 MainThread INFO toil.lib.bioio: Root logger is at level 'INFO', 'toil' logger at level 'INFO'.
    Apples-Air 2017-06-02 19:30:54,852 MainThread WARNING toil.jobStores.aws.jobStore: Exception during panic
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/site-packages/toil/jobStores/aws/jobStore.py", line 209, in initialize
        self.destroy()
      File "/usr/local/lib/python2.7/site-packages/toil/jobStores/aws/jobStore.py", line 1334, in destroy
        self._bind(create=False, block=False)
      File "/usr/local/lib/python2.7/site-packages/toil/jobStores/aws/jobStore.py", line 241, in _bind
        versioning=True)
      File "/usr/local/lib/python2.7/site-packages/toil/jobStores/aws/jobStore.py", line 721, in _bindBucket
        bucket = self.s3.get_bucket(bucket_name, validate=True)
      File "/usr/local/lib/python2.7/site-packages/boto/s3/connection.py", line 502, in get_bucket
        return self.head_bucket(bucket_name, headers=headers)
      File "/usr/local/lib/python2.7/site-packages/boto/s3/connection.py", line 535, in head_bucket
        raise err
    S3ResponseError: S3ResponseError: 403 Forbidden

    Traceback (most recent call last):
      File "helloWorld.py", line 22, in <module>
        print(Job.Runner.startToil(j, options)) #Prints Hello, world!, ….
      File "/usr/local/lib/python2.7/site-packages/toil/job.py", line 740, in startToil
        with Toil(options) as toil:
      File "/usr/local/lib/python2.7/site-packages/toil/common.py", line 614, in __enter__
        jobStore.initialize(config)
      File "/usr/local/lib/python2.7/site-packages/toil/jobStores/aws/jobStore.py", line 209, in initialize
        self.destroy()
      File "/usr/local/lib/python2.7/site-packages/toil/jobStores/aws/jobStore.py", line 206, in initialize
        self._bind(create=True)
      File "/usr/local/lib/python2.7/site-packages/toil/jobStores/aws/jobStore.py", line 241, in _bind
        versioning=True)
      File "/usr/local/lib/python2.7/site-packages/toil/jobStores/aws/jobStore.py", line 721, in _bindBucket
        bucket = self.s3.get_bucket(bucket_name, validate=True)
      File "/usr/local/lib/python2.7/site-packages/boto/s3/connection.py", line 502, in get_bucket
        return self.head_bucket(bucket_name, headers=headers)
      File "/usr/local/lib/python2.7/site-packages/boto/s3/connection.py", line 535, in head_bucket
        raise err
    boto.exception.S3ResponseError: S3ResponseError: 403 Forbidden

Please help. 请帮忙。
Thanks. 谢谢。
---John - -约翰

I realize that this answer is a little late. 我知道这个答案有点晚了。 One problem I notice is with the mesosMaster argument. 我注意到的一个问题是mesosMaster参数。

Instead, your command should have look like 相反,您的命令应该看起来像

python2.7 HelloWorld.py --batchSystem=mesos --mesosMaster=172.31.25.135:5050 aws:us-west-2:my-aws-jobstore

Notice that I replaces mesos-master with the actual IP address from 请注意,我将mesos-master替换mesos-master来自的实际IP地址

mesosbox@ip-172-31-25-135:~$

Hopefully in the future, one will not need to pass this argument at all, however this is not yet implemented as of 26 July 2017. 希望将来不再需要通过这一论点,但是自2017年7月26日起尚未实施。

Also for further problems with Toil you will probably have better luck posting a new issue to the Toil Github page. 另外,对于Toil的其他问题,您可能会比较幸运,可以在Toil Github页面上发布新期刊

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 boto3 从 AWS S3 Bucket 下载文件会导致 ClientError: An error occurred (403): Forbidden - Downloading files from AWS S3 Bucket with boto3 results in ClientError: An error occurred (403): Forbidden 使用 boto 和 python 为 s3 存储桶配置生命周期时出现错误 403 Forbidden - Error 403 Forbidden when configure lifecycle for s3 bucket with boto and python Python:Amazon S3 无法获取存储桶:说 403 Forbidden - Python: Amazon S3 cannot get the bucket: says 403 Forbidden (403) 调用 HeadObject 操作时:在 python 中从 AWS Batch 访问 S3 时禁止 - (403) when calling the HeadObject operation: Forbidden when accessing S3 from AWS Batch in python Django static 文件到 AWS S3 返回 403 禁止 - Django static files to AWS S3 return 403 forbidden AWS S3-403禁止读取文件-Boto Python - AWS S3 - 403 forbidden reading file - Boto Python 无法查看 aws s3 上的文件(403 Forbidden) - Unable to view files on aws s3 (403 Forbidden) 将 AWS S3 存储桶与 Django 一起使用时出现 TypeError - TypeError when using AWS S3 Bucket with Django 使用 Lambda 和 S3 将数据插入存储桶时出现 AWS ClientError - AWS ClientError when using Lambda and S3 to insert data to bucket 无法通过 boto3 下载 S3 存储桶对象。 错误 403 HeadObject:禁止 - Trouble downloading S3 bucket objects through boto3. Error 403 HeadObject: Forbidden
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM