I am using Cloud Functions with BigTable and seeing a perplexing error for HTTP triggered cloud functions that try to access the BigTable Admin API:
Cloud Bigtable Admin API has not been used in project r26584adb5f04cc0b before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/bigtableadmin.googleapis.com/overview?project=r26584adb5f04cc0b then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
My project is not using that id, and I have tried initializing the BigTable with a correct projectId and confirmed that GCLOUD_PROJECT matches as well.
Here is the code that's failing:
const client = bigtable({
zone: config.get('bigtable.zone'),
maxRetries: 6,
}).instance(config.get('bigtable.instance'));
async function _getTable() {
const table = client.table('events');
try {
const res = await table.get();
return res[0];
} catch (err) {
console.warn(`Failed to get table: ${err.message}`);
const res = await table.create({
families: [{
name: 'event',
rule: {
versions: 1,
},
}],
});
return res[0];
}
}
This same exact code works in a Pub/Sub triggered cloud function.
Any ideas? Is it possible that there is some global that is being used for RPCs that go out from the HTTP cloud functions?
I am using Cloud Functions with BigTable and seeing a perplexing error for HTTP triggered cloud functions that try to access the BigTable Admin API:
My project is not using that id, and I have tried initializing the BigTable with a correct
projectIdand confirmed thatGCLOUD_PROJECTmatches as well.Here is the code that's failing:
This same exact code works in a Pub/Sub triggered cloud function.
Any ideas? Is it possible that there is some global that is being used for RPCs that go out from the HTTP cloud functions?