Hello Google Storage Example

232 views
Skip to first unread message

James Kim

unread,
May 12, 2011, 8:57:01 PM5/12/11
to gs-dis...@googlegroups.com
Hi,

I'm stuck in the first app - after creating the configuration file (.boto) with "gsutil config", when I run "gsutil mb gs://cats gs://dogs", it tries to back up the exising .boto file to .boto.bak and creates a new .boto file. Even after creating the new file, it still fails to execute.

I get -
You have no boto config file. CommandException: Cannot back up existing config file 'C:\Users\xxx\.boto': backup file exists ('C:\Users\xxx\.boto.bak').

Any help would be appreciated.
James

Ruben Montelongo

unread,
May 13, 2011, 2:00:06 PM5/13/11
to gs-dis...@googlegroups.com
I had the same issue and solved it by adding the BOTO_CONFIG system environment variable with the value C:\Users\xxx\.boto

--
You received this message because you are subscribed to the Google Groups "Google Storage for Developers" group.
To post to this group, send email to gs-dis...@googlegroups.com.
To unsubscribe from this group, send email to gs-discussio...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gs-discussion?hl=en.

Mike Schwartz (Google Storage Team)

unread,
May 13, 2011, 2:32:10 PM5/13/11
to gs-dis...@googlegroups.com
Ruben and James,

Setting the BOTO_CONFIG environment variable as you suggested works, but the boto config handling code should make that unnecessary for the common case of a boto config file in the file ".boto" under your home directory. Can one of you please try running the following python code, and send us the output? I'm specifically wondering whether the value that gets printed is different than the value that you suggested setting in the BOTO_CONFIG environment variable.

import os
print os.path.expanduser('~/.boto')

(You can just save the above script in a file and then do 'python file' to run it.)

Thanks

Mike

rubenmch

unread,
May 13, 2011, 3:01:37 PM5/13/11
to Google Storage for Developers
When I run:

import os
print os.path.expanduser('~/.boto')

I get the following output:

C:\Users\R/.boto

The value set in BOTO_CONFIG is:

C:\Users\R\.boto

I'm running gsutil in Windows 7 x64 with Python 2.7.1 x64

On May 13, 1:32 pm, "Mike Schwartz (Google Storage Team)" <gs-
t...@google.com> wrote:
> Ruben and James,
>
> Setting the BOTO_CONFIG environment variable as you suggested works, but
> the boto config handling code should make that unnecessary for the common
> case of a boto config file in the file ".boto" under your home directory.
> Can one of you please try running the following python code, and send us the
> output? I'm specifically wondering whether the value that gets printed is
> different than the value that you suggested setting in the BOTO_CONFIG
> environment variable.
>
> import os
> print os.path.expanduser('~/.boto')
>
> (You can just save the above script in a file and then do 'python file' to
> run it.)
>
> Thanks
>
> Mike
>
> On Fri, May 13, 2011 at 11:00 AM, Ruben Montelongo <ruben...@gmail.com>wrote:
>
>
>
>
>
>
>
> > I had the same issue and solved it by adding the *BOTO_CONFIG *system
> > environment variable with the value *C:\Users\xxx\.boto*

Mike Schwartz (Google Storage Team)

unread,
May 13, 2011, 3:53:22 PM5/13/11
to gs-dis...@googlegroups.com
Thanks Ruben. I found and fixed a bug in the boto config file loading code, concerning Windows pathname separator handling. There's a new version of gsutil available now with this fix - and with it you should no longer need to set your BOTO_CONFIG environment variable for the common case of a boto config file in the file ".boto" under your home directory.

Mike

James Kim

unread,
May 14, 2011, 5:05:43 AM5/14/11
to Google Storage for Developers
Hi Ruben,

Thanks for your help. It works but now I'm getting this -

Creating gs://cats/...
Failure: GSCreateError: 409 Conflict
<?xml version='1.0' encoding='UTF-8'?
><Error><Code>BucketNameUnavailable</Code><
Message>The requested bucket name is not available. The bucket
namespace is shar
ed by all users of the system. Please select a different name and try
again.</Me
ssage></Error>.

Any idea?
James


On May 13, 2:00 pm, Ruben Montelongo <ruben...@gmail.com> wrote:
> I had the same issue and solved it by adding the *BOTO_CONFIG *system

Peter Pavlovic

unread,
May 14, 2011, 12:17:32 PM5/14/11
to gs-dis...@googlegroups.com
James,
cats and dogs are already taken
the bucket names are a shared single global namespace
try creating a bucket name that (chances are) is unique...

what about cityhunter007

that should be free (at a guess)


Regards,

-----
Peter Pavlovic
e: pe...@pavlovic.us
w: http://pavlovic.us
-----

James Kim

unread,
May 14, 2011, 12:45:56 PM5/14/11
to Google Storage for Developers
Hi Mike/Ruben,

I downloaded the new version and removed the BOTO_CONFIG variable but
still getting the same error in my original posting.

I'm in the exact same environment as Ruben (win7x64/python2.7.1 x64).

James

Mike Schwartz (Google Storage Team)

unread,
May 14, 2011, 7:41:59 PM5/14/11
to gs-dis...@googlegroups.com
James,

Can you please send me the output of running this command:

gsutil -D mb gs://jameskim

When you do please remove the Authorization: header before sending.

If you'd feel more comfortable sending just to the Google Storage team (rather than posting on gs-discussion) you can send it to gs-...@google.com

Thanks

Mike

James Kim

unread,
May 17, 2011, 8:48:45 PM5/17/11
to Google Storage for Developers, Mike Schwartz (Google Storage Team)
Hi Mike,

Sorry for the late reply - I get this:

C:\gsutil>python gsutil -D mb gs://jameskim
You have no boto config file.
CommandException: Cannot back up existing config file 'C:\Users\jkim
\.boto': bac
kup file exists ('C:\Users\jkim\.boto.bak').

Basically back to my initial posting - Does this help?
James

On May 14, 7:41 pm, "Mike Schwartz (Google Storage Team)" <gs-

Mike Schwartz (Google Storage Team)

unread,
May 19, 2011, 5:37:04 PM5/19/11
to gs-dis...@googlegroups.com
Hi,

I fixed the Windows config path problem. It's available in the latest version of gsutil (gsutil version 2011-05-19 13:45:46-07:00)

Mike


On Sat, May 14, 2011 at 9:45 AM, James Kim <cityhu...@gmail.com> wrote:

James Kim

unread,
May 20, 2011, 6:36:18 AM5/20/11
to Google Storage for Developers
Thanks Mike - it's fixed.

I wonder how/why it worked for other people...?


On May 19, 5:37 pm, "Mike Schwartz (Google Storage Team)" <gs-
Reply all
Reply to author
Forward
0 new messages