1

I literally just signed up for an S3 account, installed boto and would now like to try uploading a file. I'm using this as a reference - http://aws.amazon.com/articles/3998

I was surprised you needed to store your credentials as clear text in a file, but that's what I'm trying to do, though for a start I'm NOT putting in my password and expect to get an error.

So I did the following in python as instructed:

import boto

s3 = boto.connect_s3()

s3

S3Connection:s3.amazonaws.com

and the command succeeded, though I expected an error since my credentials are bad, but perhaps this is only a connection object and the real error should occur when I create the bucket. so then I tried this:

bucket = s3.create_bucket('1234567mjs7654321')

and command has been hanging for over 10 minutes.

I've got to believe there is something really basic I'm doing wrong but don't know what it might be.

here's the result of enabling debugging:

s3.create_bucket('1234567mjs7654321')
2013-01-11 17:58:17,765 foo [DEBUG]:path=/
2013-01-11 17:58:17,766 foo [DEBUG]:auth_path=/1234567mjs7654321/
2013-01-11 17:58:17,766 foo [DEBUG]:Method: PUT
2013-01-11 17:58:17,766 foo [DEBUG]:Path: /
2013-01-11 17:58:17,766 foo [DEBUG]:Data:
2013-01-11 17:58:17,766 foo [DEBUG]:Headers: {}
2013-01-11 17:58:17,766 foo [DEBUG]:Host: 1234567mjs7654321.s3.amazonaws.com
2013-01-11 17:58:17,766 foo [DEBUG]:establishing HTTPS connection:              host=1234567mjs7654321.s3.amazonaws.com, kwargs={}
2013-01-11 17:58:17,766 foo [DEBUG]:Token: None
2013-01-11 17:58:17,766 foo [DEBUG]:StringToSign:
PUT
4

2 回答 2

0

解决了!!!我的机器上存在访问问题,虽然我还不确定是什么,但它确实可以从不同的系统工作。我只是很失望它没有提前告诉我。

于 2013-01-11T19:44:18.367 回答
0

我无法想象它为什么会挂起。我建议尝试将完整的调试日志记录到控制台,如下所示:

import boto
boto.set_stream_logger('foo')
s3 = boto.connect_s3(debug=2)
s3.create_bucket('1234567mjs7654321')

您应该会看到大量信息被转储到控制台,也许这将包含有关正在发生的事情的线索。

于 2013-01-11T16:37:09.160 回答