Hey there! We’re having issues using the auto-disc...
# ask-questions
c
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
Hi Julian
are you on the cloud version?
c
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
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
is there sth we can do from our side to help resolve this?
f
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
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
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
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
Ok, cool. I suspect the key file would also work if you manually edited the project id field
a
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