python数据读取失败无法启动应用_无法读取实例数据,从而放弃python boto中的错误...

I am trying to access amazon s3 using boto library to access common crawl data availble in amazon 'aws-publicdatasets'.

i created access config file in ~/.boto

[Credentials]

aws_access_key_id = "my key"

aws_secret_access_key = "my_secret"

and while creating connection with amazon s3 i see below error in logs.

2014-01-23 16:28:16,318 boto [DEBUG]:Retrieving credentials from metadata server.

2014-01-23 16:28:17,321 boto [ERROR]:Caught exception reading instance data

Traceback (most recent call last):

File "/usr/lib/python2.6/site-packages/boto-2.13.3-py2.6.egg/boto/utils.py", line 211, in retry_url

r = opener.open(req)

File "/usr/lib64/python2.6/urllib2.py", line 391, in open

response = self._open(req, data)

File "/usr/lib64/python2.6/urllib2.py", line 409, in _open

'_open', req)

File "/usr/lib64/python2.6/urllib2.py", line 369, in _call_chain

result = func(*args)

File "/usr/lib64/python2.6/urllib2.py", line 1190, in http_open

return self.do_open(httplib.HTTPConnection, req)

File "/usr/lib64/python2.6/urllib2.py", line 1165, in do_open

raise URLError(err)

URLError:

2014-01-23 16:28:17,323 boto [ERROR]:Unable to read instance data, giving up

In other way I tried to give credentials while creating connection object also as shown below

from boto.s3.connection import S3Connection

from boto.s3.bucket import Bucket

boto.set_stream_logger('boto')

connection = S3Connection('______','__________')

bucket = Bucket(connection.get_bucket('aws-publicdatasets'))

Still i am seeing the same error in logs

解决方案

I had the same error when using a .boto file in the same folder as the script. It has to be on the base of the home folder.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值