Hi all, I am adding my Google Credential JSON as an environment variable for my Render app under the “Environment Variables” section. However I keep receiving the following error, even after escaping all the \n:
File "/opt/render/project/src/.venv/lib/python3.11/site-packages/google/oauth2/service_account.py", line 242, in from_service_account_info
Sep 5 09:50:34 AM signer = _service_account_info.from_dict(
Sep 5 09:50:34 AM ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sep 5 09:50:34 AM File "/opt/render/project/src/.venv/lib/python3.11/site-packages/google/auth/_service_account_info.py", line 47, in from_dict
Sep 5 09:50:34 AM missing = keys_needed.difference(data.keys())
Sep 5 09:50:34 AM ^^^^^^^^^
Sep 5 09:50:34 AMAttributeError: 'str' object has no attribute 'keys'
my KEY: GOOGLE_CREDS_JSON
my VALUE (the JSON file):
{
"type": "service_account",
"project_id": "automations-xxx",
"private_key_id": "xxx",
"private_key": "-----BEGIN PRIVATE KEY-----\\nxxx-----END PRIVATE KEY-----\\n",
"client_email": "xxx@xxx.iam.gserviceaccount.com",
"client_id": "xxx",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/xxx",
"universe_domain": "googleapis.com"
}
Does anyone know how I can fix this?