{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/118","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/118/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/118/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/118/events","html_url":"https://github.com/GoogleCloudPlatform/gcloud-golang/issues/118","id":60960086,"number":118,"title":"Unable to create write data into bucket , not an app engine context ","user":{"login":"Karthic-Hackintosh","id":2609511,"avatar_url":"https://avatars.githubusercontent.com/u/2609511?v=3","gravatar_id":"","url":"https://api.github.com/users/Karthic-Hackintosh","html_url":"https://github.com/Karthic-Hackintosh","followers_url":"https://api.github.com/users/Karthic-Hackintosh/followers","following_url":"https://api.github.com/users/Karthic-Hackintosh/following{/other_user}","gists_url":"https://api.github.com/users/Karthic-Hackintosh/gists{/gist_id}","starred_url":"https://api.github.com/users/Karthic-Hackintosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Karthic-Hackintosh/subscriptions","organizations_url":"https://api.github.com/users/Karthic-Hackintosh/orgs","repos_url":"https://api.github.com/users/Karthic-Hackintosh/repos","events_url":"https://api.github.com/users/Karthic-Hackintosh/events{/privacy}","received_events_url":"https://api.github.com/users/Karthic-Hackintosh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":34,"created_at":"2015-03-13T02:06:13Z","updated_at":"2015-12-09T13:00:07Z","closed_at":"2015-03-20T13:42:00Z","body":"Initially when tried running the storage app-engine example code i ran into this following issue which is being discussed in this stackoverflow thread http://stackoverflow.com/questions/29010718/google-cloud-storage-client-app-error-using-go-runtime-google-app-engine . \r\nThe discussion enabled me to fix the issue with sample code  and get it compiled https://github.com/GoogleCloudPlatform/gcloud-golang/blob/master/examples/storage/appengine/app.go.\r\n\r\nBut now i have deployed this code on Go runtime on app engine , and i get this following error when i check it on the Log monitoring facility in the developers console **createFile: unable to write data to bucket \"xxxx-87609.appspot.com\", file \"demo-testfile-go\": Post https://www.googleapis.com/upload/storage/v1/b/xxxx-xxxx-87609.appspot.com/o?alt‌​=json&projection=full&uploadType=multipart: not an App Engine context** \r\n\r\nIt would have been great if the example code would have run gracefully without the need to fix it . \r\nHere is how im initializing the context ( as suggested in the stackoverflow answer) \r\n\r\n    c := appengine.NewContext(r)\r\n    hc := &http.Client{}\r\n    ctx := cloud.NewContext(appengine.AppID(c), hc)\r\n    hc.Transport = &oauth2.Transport{\r\n        Source: google.AppEngineTokenSource(ctx, storage.ScopeFullControl),\r\n        Base:   &urlfetch.Transport{Context: c},\r\n    }\r\n    ctx = cloud.NewContext(appengine.AppID(c), hc)\r\n\tw.Header().Set(\"Content-Type\", \"text/plain; charset=utf-8\")\r\n\tfmt.Fprintf(w, \"Demo GCS Application running from Version: %v\\n\", appengine.VersionID(c))\r\n\tfmt.Fprintf(w, \"Using bucket name: %v\\n\\n\", bucket)\r\n\r\n\td := &demo{\r\n\t\tc:   c,\r\n\t\tw:   w,\r\n\t\tctx: ctx,\r\n\t}\r\n\r\n\tn := \"demo-testfile-go\"\r\n\td.createFile(n)\r\n\td.readFile(n)"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/comments/163222084","html_url":"https://github.com/GoogleCloudPlatform/gcloud-golang/issues/118#issuecomment-163222084","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/118","id":163222084,"user":{"login":"patrickToca","id":2913677,"avatar_url":"https://avatars.githubusercontent.com/u/2913677?v=3","gravatar_id":"","url":"https://api.github.com/users/patrickToca","html_url":"https://github.com/patrickToca","followers_url":"https://api.github.com/users/patrickToca/followers","following_url":"https://api.github.com/users/patrickToca/following{/other_user}","gists_url":"https://api.github.com/users/patrickToca/gists{/gist_id}","starred_url":"https://api.github.com/users/patrickToca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrickToca/subscriptions","organizations_url":"https://api.github.com/users/patrickToca/orgs","repos_url":"https://api.github.com/users/patrickToca/repos","events_url":"https://api.github.com/users/patrickToca/events{/privacy}","received_events_url":"https://api.github.com/users/patrickToca/received_events","type":"User","site_admin":false},"created_at":"2015-12-09T13:00:06Z","updated_at":"2015-12-09T13:00:06Z","body":"@ernestoalejo Thanks. Is there a complete example that simply works (with useful comments 'how to')?"}}