Ambiguous error message when connecting to Google Data Source

  • 1
  • Question
  • Updated 2 months ago
  • Answered
  • (Edited)
I received the following error when trying to connect to a Google Data Source:



1. Error retrieving metadata for Model(s) associated with Data Source 'GoogleDirectory'. Please check Models' properties to ensure they are set correctly.
Error connecting to REST Data Source at URL "https://www.googleapis.com/admin/directory/v1/users/*USERID*": [object Object]


What does this error message mean?
It looks like the error response wasn't stringified.
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb

Posted 2 months ago

  • 1
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb
The error was that the proper API Service wasn't enabled in my google project (In my case the Admin SDK).

I found that out by going to network calls on chrome developer console and looking at the response of the apex remote call.

The response looked like this:

[{"statusCode":200,"type":"rpc","tid":28,"ref":false,"action":"skuid.RemotingStubs","method":"proxy","result":"{\"statusCode\":403,\"status\":\"Forbidden\",\"setCookies\":null,\"headers\":{\"Content-Type\":\"application/json; charset=UTF-8\",\"X-XSS-Protection\":\"1; mode=block\",\"Expires\":\"Fri, 28 Sep 2018 11:22:53 GMT\",\"Vary\":\"Origin,Accept-Encoding;X-Origin\",\"Cache-Control\":\"private, max-age=0\",\"X-Frame-Options\":\"SAMEORIGIN\",\"Accept-Ranges\":\"none\",\"Date\":\"Fri, 28 Sep 2018 11:22:53 GMT\",\"X-Content-Type-Options\":\"nosniff\",\"Server\":\"GSE\",\"Alt-Svc\":\"quic=\\\":443\\\"; ma=2592000; v=\\\"44,43,39,35\\\"\",\"Transfer-Encoding\":\"chunked\"},\"error\":null,\"body\":\"{\\n \\\"error\\\": {\\n  \\\"errors\\\": [\\n   {\\n    \\\"domain\\\": \\\"usageLimits\\\",\\n    \\\"reason\\\": \\\"accessNotConfigured\\\",\\n    \\\"message\\\": \\\"Access Not Configured. Admin Directory API has not been used in project *CENSORED* before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/admin.googleapis.com/overview?project=*CENSORED* then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.\\\",\\n    \\\"extendedHelp\\\": \\\"https://console.developers.google.com/apis/api/admin.googleapis.com/overview?project=*CENSORED*\\\&q...   }\\n  ],\\n  \\\"code\\\": 403,\\n  \\\"message\\\": \\\"Access Not Configured. Admin Directory API has not been used in project *CENSORED* before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/admin.googleapis.com/overview?project=*CENSORED* then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.\\\"\\n }\\n}\\n\"}"}]
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Shmuel, thank you for closing the loop on this for the Community. Glad you were able to resolve the issue!