https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
c

creamy-doctor-6871

05/19/2022, 9:05 AM
Hey there! We’re having issues using the auto-discovery feature for GCP that was recently introduced on our self-hosted GrowthBook instance. We have created a Service Account in our GCP project ‘wanted-weasel’ but want to read from BigQuery tables in a GCP project called ‘learning-honeybee’. Afair, service accounts can be used across GCP projects so I’m wondering why we’re getting this error. Why does it still ask for ‘wanted-weasel’ when I’ve configured ‘learning-honeybee’ as default project?
f

fresh-football-47124

05/19/2022, 9:09 AM
Hi Julian
are you on the cloud version?
c

creamy-doctor-6871

05/19/2022, 9:24 AM
this is a self-hosted version 🙂 (will add it to the question)
we are passing in a key as environment variable with the name ‘GOOGLE_CLOUD_CREDENTIALS’
f

future-teacher-7046

05/19/2022, 9:28 AM
I think I know what the issue is. We are not specifying a project id when connecting with auto discovery. https://github.com/growthbook/growthbook/blob/main/packages/back-end/src/integrations/BigQuery.ts#L19
c

creamy-doctor-6871

05/19/2022, 9:33 AM
is there sth we can do from our side to help resolve this?
f

future-teacher-7046

05/19/2022, 9:44 AM
Using a JSON key file instead of auto discovery would work until we fix that bug. I need to do some more reading to make sure I fully understand BigQuery project ids and how they are used. We have both
projectId
and
defaultProjectId
currently, but I'm not 100% sure we need both.
c

creamy-doctor-6871

05/19/2022, 10:25 AM
Actually, the same problem occurs when using the JSON key file. I think the issue is the same for both auto-discovery and JSON key file.
f

future-teacher-7046

05/19/2022, 1:36 PM
It looks like the JSON key file was created for the
wanted-weasel
project. Is it possible to create one for the
learning-honeybee
project instead?
a

abundant-australia-3600

05/19/2022, 2:31 PM
hi Jeremy, the idea here is that we’d like to make SA’s from project B doing things in project A
looks like we made it working by providing GOOGLE_CLOUD_PROJECT env var
f

future-teacher-7046

05/19/2022, 2:40 PM
Ok, cool. I suspect the key file would also work if you manually edited the project id field
a

abundant-australia-3600

05/19/2022, 2:47 PM
well, in our case it is not the best solution, as we create resources by declaring them in code and then if edit something manually, that can be overwritten at any moment by another terraform apply
we don’t even deal with this key manually, everything gets created/copied/mounted automatically via specific declarations in the code
7 Views