Anyone familiar with this gcloud exception:
ApiError: Not Found at new util.ApiError (/site/node_modules/gcloud/lib/common/util.js:128:10) at Object.parseHttpRespBody (/site/node_modules/gcloud/lib/common/util.js:206:30) at Object.handleResp (/site/node_modules/gcloud/lib/common/util.js:146:18) at /site/node_modules/gcloud/lib/common/util.js:447:12 at Request.onResponse [as _callback] (/site/node_modules/gcloud/node_modules/retry-request/index.js:120:7) at Request.self.callback (/site/node_modules/request/request.js:187:22) at Request.emit (events.js:98:17) at Request. (/site/node_modules/request/request.js:1044:10) at Request.emit (events.js:95:17) at IncomingMessage. (/site/node_modules/request/request.js:965:12) at IncomingMessage.emit (events.js:117:20) at _stream_readable.js:944:16 at process._tickDomainCallback (node.js:492:13)
It appears only in production (of course) and currently consistently. It used to appear periodically and the assumption was that it is a glitch @ gCloud since locally it could not be reproduced. It is related to the part of the code which uses the simplest gCloud lib method bucket.upload
with no parameters other than the file ... Here is the current function which does it:
function uploadToGoogleCloud(filePath, makePublic) {
var gstorage = gcloud.storage({
projectId: EXAMPLE_projectId,
credentials: EXAMPLE_credentials,
});
var spBucket = Promise.promisifyAll(gstorage.bucket(EXAMPLE_bucket));
return spBucket.uploadAsync(filePath).then(function(file) {
if (makePublic) {
var fileAsync = Promise.promisifyAll(file);
return fileAsync.makePublicAsync().then(function() {
return file;
});
}
return file;
});
}
Any feedback is greatly appreciated.