I'm trying to deploy OSS airbyte on a GCP VM, and ...
# replication-ask-ai
s
I'm trying to deploy OSS airbyte on a GCP VM, and can't seem to use the SECRET_STORE_GCP_CREDENTIALS environment variable in order to use the secret store to write secrets I have 1. added SECRET_PERSISTENCE, SECRET_STORE_GCP_PROJECT_ID, SECRET_STORE_GCP_CREDENTIALS to the .env file a. SECRET_STORE_GCP_PROJECT_ID=test b. SECRET_PERSISTENCE=GOOGLE_SECRET_MANAGER c.
'{\"type\":\"service_account\",\"project_id\":\"project\", \"private_key\":\"-----BEGIN PRIVATE KEY-----\nYXYXXY}'
2. added those variables to the docker-compose.yaml in the server and worker containers 3. when I set those and try to enter a secret (for example the twilio source), this error appears a.
Internal Server Error: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 3 path $.
k
A message from kapa.ai
@Sayon Bhattacharjee That's a great question, but unfortunately it is too long. Can you ask me again but make it shorter? I'm here to help!
s
I'm trying to deploy OSS airbyte on a GCP VM, and can't seem to use the SECRET_STORE_GCP_CREDENTIALS environment variable in order to use the secret store to write secrets I have 1. added SECRET_PERSISTENCE, SECRET_STORE_GCP_PROJECT_ID, SECRET_STORE_GCP_CREDENTIALS to the .env file a. SECRET_STORE_GCP_PROJECT_ID=test b. SECRET_PERSISTENCE=GOOGLE_SECRET_MANAGER c.
'{\"type\":\"service_account\",\"project_id\":\"project\", \"private_key\":\"-----BEGIN PRIVATE KEY-----\nYXYXXY}'
2. added those variables to the docker-compose.yaml in the server and worker containers 3. when I set those and try to enter a secret (for example the twilio source), this error appears a.
Internal Server Error: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 3 path $.
w
I've been struggling with the exact same error message. Did you find a solution @Sayon Bhattacharjee?
Success! This is how I solved it: 1. export the variables. Best is to use the google secret manage to store the service account key. This can be done in a script as follows. Make sure that the .env file does not override the variables
Copy code
export SECRET_STORE_GCP_PROJECT_ID=my-project-id
export SECRET_STORE_GCP_CREDENTIALS=$(gcloud secrets versions access 1 --secret airbyte_runner_service_account_key)
Of course, the service account key needs the role
roles/secretmanager.admin
. Beware that Airbyte wants to store secrets in the
global
region. I did not find a way to limit it to EU etc. :( 1. add the following variables to docker-compose.yaml to the environment for the services
server
and `worker`:
Copy code
- SECRET_STORE_GCP_PROJECT_ID=${SECRET_STORE_GCP_PROJECT_ID}
- SECRET_STORE_GCP_CREDENTIALS=${SECRET_STORE_GCP_CREDENTIALS}
2. the service account has to be WITHOUT the single quotes quotes shown in 1.c up. The newlines can be kept and the quotes should NOT be escaped. Thus, it has to look like this:
Copy code
{
  "type": "service_account",
  "project_id": "my-project-id",
  "private_key_id": "123abc",
  "private_key": "-----BEGIN PRIVATE KEY-----\n123\n456\n=\n-----END PRIVATE KEY-----\n",
  "client_email": "airbyte-runner@my-project-id.iam.gserviceaccount.com",
  "client_id": "987",
  "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/robot/v1/metadata/x509/airbyte-runner%40my-project-id.iam.gserviceaccount.com>",
  "universe_domain": "googleapis.com"
}
Possible error messages: • if the variables SECRET_STORE_GCP_PROJECT_ID and SECRET_STORE_GCP_CREDENTIALS are NOT set then the error message upon creating a source or destination will be in Airbyte 0.50.31:
Internal Server Error: no JSON input found
• if the variables SECRET_STORE_GCP_PROJECT_ID and SECRET_STORE_GCP_CREDENTIALS are set, but the json secret is malformatted the error will be as described above
Internal Server Error: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 3 path $.
k
hello, this solution works ! thanks @Willi be careful not to define the environment variable
SECRET_STORE_GCP_CREDENTIALS
in the
.env
natively used by the
docker compose
otherwise the command string
$(gcloud secrets versions access 1 --secret airbyte_runner_service_account_key)
would be passed to the container instead of the evaluation of the command šŸ˜•
w
absolutely, the
export
statements need to reside in a separate script. Thanks for highlighting this!
šŸ™ 1