google-api-go-client

172 views
Skip to first unread message

Graham Miller

unread,
Dec 13, 2013, 9:23:46 AM12/13/13
to golang-nuts, Brad Fitzpatrick
Brad and go-nuts:

I've been using the google-api-go-client library to access google storage for a long time (probably since the library first was created).  Generally I've had no problems.  This morning though, nothing is working.  

googleapi: got HTTP response code 404 and error reading body: invalid character '<' looking for beginning of value: error uploading file

So I guess my first question is, is there any way to get the library to show me what the error message is?  Not seeing an obvious way to do that, I dug into the internals and did a req.Write(os.Stdout), and I get this:

<?xml version='1.0' encoding='UTF-8'?><Error><Code>NoSuchBucket</Code><Message>The specified bucket does not exist.</Message></Error>

I know the bucket still exists, I can see it in my cloud console, and AFAIK I haven't changed anything since yesterday.  Any idea what's going on here?

graham

Graham Miller

unread,
Dec 13, 2013, 9:26:11 AM12/13/13
to golang-nuts, Brad Fitzpatrick
And I guess for context, the code that causes the error might be helpful:

        service, err := storage.New(c)
        if err != nil {
                return err
        }

        obj := &storage.Object{
                ContentEncoding: "application/zip",
                Name:            filename,
        }

        _, err = service.Objects.Insert(bucket, obj).Media(f).Do()
        return err


Brad Fitzpatrick

unread,
Dec 13, 2013, 9:34:47 AM12/13/13
to Graham Miller, golang-nuts

This makes me sad. I hope Google didn't change the API.

You really didn't change any code or update to a new version of the Go client?

Graham Miller

unread,
Dec 13, 2013, 9:38:21 AM12/13/13
to Brad Fitzpatrick, golang-nuts
No, I was using the same binaries as yesterday.  No rebuild in the last few weeks.

graham

Graham Miller

unread,
Dec 13, 2013, 9:46:19 AM12/13/13
to Brad Fitzpatrick, golang-nuts
I just realized that I also get errors manually uploading, so that seems to imply the problem is elsewhere.  I'll go in through the support front door to see if I can get more info.  But regarding my first question, can the API give me more info on an error when it comes through?  Thanks.

graham

Brad Fitzpatrick

unread,
Dec 13, 2013, 9:47:22 AM12/13/13
to Graham Miller, golang-nuts
Yeah, file a bug against the google-api-go-client project.

Graham Miller

unread,
Dec 13, 2013, 9:49:06 AM12/13/13
to Brad Fitzpatrick, golang-nuts
K, thanks.

graham

Rick Tait

unread,
Dec 13, 2013, 5:51:50 PM12/13/13
to golan...@googlegroups.com, Brad Fitzpatrick
related datapoint: google-api-go-client/analytics/v3 is working just fine (via service account, cert+JWT+OAuth2). i just tested.

FYI i promised a blog-y type post about HOW-TO query the core reporting api using Go + a headless service account. i'm ~95% done, but i'll have it finished over this weekend and post the url to the list when its nice and polished.

RMT
Reply all
Reply to author
Forward
0 new messages