1

I'm trying to upload a file to Google Cloud Storage from Node.JS (using gcloud package) with Service Account credentials and I get "invalid_grant" error (probably authorization error).

When I try to do this from another computer - it work fine, the error only occurs on my PC.

var gcloud = require('gcloud')({
    projectId: 'xxxxxxxxxxxxxx31032015',
    keyFilename: './keyfile.json'
});

var storage = gcloud.storage();

var bucket = storage.bucket('test.testBucket.com');

bucket.upload('test.png', function (err, file) {
    console.log(err);
});
Eran Betzalel
  • 4,105
  • 3
  • 38
  • 66
ilia
  • 13
  • 2

1 Answers1

0

Some ideas:

  • Is the keyfile.json corresponding to a service account on your project?

  • Are you using the correct project id?

  • Is your system clock well-calibrated?

Good luck!

Nick
  • 3,581
  • 1
  • 14
  • 36
  • Hey, I'm glad to hear that. Yep, often cryptographic programs designed for real-time flows will fail if the system clocks aren't sufficiently sync'd. – Nick Jun 18 '15 at 16:36