I am getting an error initializing after what seems like a successful service authentication when it comes to initializing the API. Our group is running on a react framework.
Here is the log of the error being thrown:
Server listening on port 8080...
Authentication server-side EE API calls via private key...
Authentication succeeded!
Error: Permission denied.
at module$contents$ee$apiclient_Call.callback (/Users/Gibbedboy/EPIIC/EPIIC-Project/node_modules/@google/earthengine/build/main.js:21281:62)
at /Users/Gibbedboy/EPIIC/EPIIC-Project/node_modules/@google/earthengine/build/main.js:14985:62
at processTicksAndRejections (internal/process/task_queues.js:97:5)
Initialization failed.
I'm using almost the same script as shown on Google's examples in github to test authentication and initialization:
ee.data.authenticateViaPrivateKey(
PRIVATE_KEY, () => {
console.log('Authentication succeeded!');
// Attempt to initialize Earth Engine.
ee.initialize(
null, null,
// On a successful initialize
() => {
console.log('Successfully initialized the EE client library.');
app.listen(PORT);
console.log(`Listening on port ${PORT}`);
res.send("Authenticated and initialized!\n");
},
// On a failure to initialize
(err) => {
console.log(err);
console.log(`Initialization failed.`);
}
);
},
// When the authentication failed.
(err) => {
console.log(err);
console.log('Authentication failed');
I suspected that the authentication didn't actually succeed, so I double checked my credentials, and they're correct. I'm not sure what could be causing the issue after some more investigation into other things I thought might be wrong. I still suspect it's a configuration issue, but me and my group are very new to Earth Engine and haven't been able to test things outside of the code editor because of this. It's very possible we may have overlooked something obvious.
I'd greatly appreciate any input or guidance on how to proceed.