Could not load creadentials from dhis-google-auth.json

I have had several weeks if not months battling with this particular error connecting to google earth engine in dhis2 version 2.35.

I need assistance if someone has been successful implementing it.
I followed the process from the documentation and these are the steps:

  1. Registered for google cloud account
  2. created service account with api credentials and downloaded the json file
  3. authenticated the account.
  4. activated google earth engine api
  5. uploaded the json file to the home of dhis2 …/config/dhis-google-auth.json
  6. Restarted the service and still could not access the google earth service with the console error : Could not load credentials from dhis-google-auth.json

Below are the screens.

google auth

Thank you for reaching out @fosuhene ! I am sure the @dhis2-analytics team will be able to support you with this. Was it this tutorial that you followed Signup for a Google Earth Engine account - DHIS2 Documentation?

Good morning Addin,

I hope you are doing well.

Yes, I have followed this tutorial.

Thank you.

1 Like

@fosuhene the line after the warning you circled is the important one here - it appears the JSON file has an error :
“Illegal unquoted character”

I believe this is the \n newlines in your private key – you should replace them with \\n instead.

1 Like

Thank Austin,
I would want to try but the replacement is same as the error to correct, do I have to use forward slash (/n) instead, you mean?

Sorry @fosuhene I would like to understand, did you try two backward slashes and it didn’t work?

No, I have not tried it.

I have tried both now, still same error code.

Please see these instructions in this image. I hope it helps. I understand from @austin’s answer is that the issue is with typing in the private key and the image proves it because I think the linting should make the key look purple:

1 Like

Thank you Addin, I am trying it now. I will communicate the outcome.


Yes, I believe @Gassim is correct - there should be no newline characters within a quoted string literal. If this is the case, you should revert to \n, I believe

1 Like

Morning Community,

There is no error response on the connection, however after restart and accessing the Maps App, attempt to access any of the google earth engine service gives the attached response from the screenshot below.

any idea of what is happening?

Thank you in advance for all the support.

Grateful for the support from the community. My google earth engine works now.

1 Like

2 posts were merged into an existing topic: Version 2.36 Maps Not working

6 posts were merged into an existing topic: Version 2.36 Maps Not working