firebase / extensions

Source code for official Firebase extensions
https://firebase.google.com/products/extensions
Apache License 2.0
892 stars 380 forks source link

🐛 [Stream Firestore to BigQuery] Unable to stream Firestore DB to a different project #2140

Open KristofSochan opened 2 months ago

KristofSochan commented 2 months ago

[READ] Step 1: Are you in the right place?

Yes, for Stream Firestore to BigQuery extension, error during setup.

[REQUIRED] Step 2: Describe your configuration

[REQUIRED] Step 3: Describe the problem

The extension is stuck in "Configuring BigQuery Sync" when I check "Runtime status" in the extension management page.

When I check the cloud functions that were triggered, I see this error on the function: syncBigQuery

ext-firestore-bigquery-export-users2-syncBigQueryqu3g9rrcqx5t Unhandled error ApiError: Access Denied: Dataset project-name:dataset-name: Permission bigquery.datasets.get denied on dataset project-name:dataset-name (or it may not exist). at new ApiError (/workspace/node_modules/@google-cloud/common/build/src/util.js:75:15) at Util.parseHttpRespBody (/workspace/node_modules/@google-cloud/common/build/src/util.js:210:38) at Util.handleResp (/workspace/node_modules/@google-cloud/common/build/src/util.js:151:117) at /workspace/node_modules/@google-cloud/common/build/src/util.js:534:22 at onResponse (/workspace/node_modules/@google-cloud/common/node_modules/retry-request/index.js:259:7) at /workspace/node_modules/teeny-request/build/src/index.js:226:13 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { code: 403, errors: [ { message: 'Access Denied: Dataset project-name:dataset-name: Permission bigquery.datasets.get denied on dataset project-name:dataset-name (or it may not exist).', domain: 'global', reason: 'accessDenied' } ],

Steps to reproduce:

Configure Big Query streaming from Firestore with the above configuration, BigQuery Project ID must be different than the Firestore source project.

I changed the dataset name to something else other than the default (which was firestore_export).

Expected result

Extension is properly initialized, i.e. Runtime status should say "Sync setup completed".

Actual result

Extension is not properly initialized due to permission errors across project, see above.

KristofSochan commented 2 months ago

The info for the "Dataset ID" field in the extension configuration says: "What ID would you like to use for your BigQuery dataset? This extension will create the dataset, if it doesn’t already exist."

Unsure how else to allow the extension to create a dataset in a different project.

joeframpton commented 2 months ago

I wonder if this is the same issue as I had?