title: Request had invalid authentication credentials. on the compute engine vm
body: <p>I have a default n1 instance on the GCloud with preinstalled java and latest google sdk. When I run code locally within appengine:devserver which connects to the real pubsub subscription, it works correct. If I do the same on the Instance I get an authentication error:</p>
  
  <pre><code>[INFO] SEVERE: 401 OK
  [INFO] {
  [INFO]   "code" : 401,
  [INFO]   "errors" : [ {
  [INFO]     "domain" : "global",
  [INFO]     "message" : "Request had invalid authentication credentials.",
  [INFO]     "reason" : "unauthorized"
  [INFO]   } ],
  [INFO]   "message" : "Request had invalid authentication credentials.",
  [INFO]   "status" : "UNAUTHENTICATED"
  [INFO] }
  </code></pre>
  
  <p>All permissions are full or read/write/enabled for this instance. I absolutely have no idea why error happens? </p>
  
  <p>I did <code>gcloud init</code> with the same credentials locally and on the instance.</p>
  
  <p>upd: I also tested pulling: <code>gcloud beta pubsub subscriptions pull mysubscription-tag</code> - ok</p>