I have gcloud set up in my application and I seem to be successfully authenticated. I can run the following without any problem:
GoogleCloud = require('gcloud')({ /* my credentials */ });
GoogleCloud.storage().createBucket('myBucket', function (err, res) {});
I can also do the following to retrieve my bucket and file without any problem:
var bucket = GoogleCloud.storage().bucket('myBucket');
var file = bucket.file('myFileName.ext');
And when I file.getMetadata()
, I see the empty object convert to the expected information.
However, when I attempt to download the file, I get problems.
var pathToFileName = 'public/test.pdf';
file.download({ destination: pathToFileName }, function (err) { console.log(err); });
{ [Error: ENOENT, open '/public/test.pdf'] errno: 34, code: 'ENOENT', path: '/public/test.pdf' }
I have tried prepending the pathToFileName
with /
, ./
, and ../
with no success. This is the same error that I have have gotten in the past with my configuration was not authorized or the file name was incorrect (although I was then unable to create buckets and get metadata). But is there still possibly an issue with acl
or some other permission that I'm not aware of?