extensions icon indicating copy to clipboard operation
extensions copied to clipboard

🐛 [Stream Firestore to BigQuery] Update cloud function extension to gen 2

Open leslie-zi-pan opened this issue 1 year ago • 4 comments

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

Issues filed here should be about bugs for a specific extension in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:

  • For general technical questions, post a question on StackOverflow with the firebase tag.
  • For general Firebase discussion, use the firebase-talk google group.
  • To file a bug against the Firebase Extensions platform, or for an issue affecting multiple extensions, please reach out to Firebase support directly.

[REQUIRED] Step 2: Describe your configuration

  • Extension name: Stream Firestore to BigQuery
  • Extension version: 0.1.49

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

Failed extension deployment - specifically the firestore component of this extension. The extension allows database targetting (other than the default DB). However, deployment of this extension is still in 1st Gen Cloud function which limits the trigger to default database. This is contradictory to what the extension feature allows as there is a field to specify database ID. Please update to Gen 2. Thank you.

leslie-zi-pan avatar Apr 22 '24 12:04 leslie-zi-pan

Hi!

Do we have a time frame for when the extensions will be upgraded to use the 2nd Gen Cloud Functions?

We are currently in the process of regionalising our Firestore databases (i.e. eur, us, shared) and we currently rely on the 'Stream Firestore to BigQuery' extension to get our data into BigQuery. Ideally, each database would be mapped to an equivalent (localised) dataset in BigQuery.

I have found the following behaviour for firebase/[email protected]:

  • If I don't set the DATABASE_ID .env variable then the Cloud Function automatically defaults to 1st gen and DATABASE_ID = (default) see screenshot below.
  • If I do try and set DATABASE_ID = <location> in the .env then I get the following error message during deployment: ResourceErrorCode":"400","ResourceErrorMessage":"Cannot create Firestore trigger for .../databases/us-west2. Triggers must be created with a \"(default)\" Firestore Native database. See https://firebase.google.com/docs/firestore/extend-with-functions#limitations.

We also rely on npx firebaseextensions/fs-bq-import-collection for manual backfilling of existing Firestore data. Can you also confirm that this will be updated so that we can pass the database_id as an argument?

This is urgent from our side as our database migration is planned to go ahead early June and therefore any information on expected timeframes for this to be upgraded would be greatly appreciated otherwise unfortunately we will be forced to look for an alternative.

Thank you!

image

mikeymace avatar May 08 '24 10:05 mikeymace

@mikeymace I'd suggest looking for an alternative, e.g. copy the code and deploy it directly (aka not as Firebase Extension). This will take some time until it's fixed ...

IchordeDionysos avatar May 10 '24 16:05 IchordeDionysos

Hello everyone, tagging this as a feature request.

Unfortunately, it's not possible now to upgrade any extension to v2 Firestore triggers since extensions don't yet support them, once it does we will update the triggers.

For the contradiction between the params and actual functionality, I'm tracking this as an issue here #2090.

pr-Mais avatar May 10 '24 19:05 pr-Mais

+1

general note: would be great if all (official) Firebase extensions also moving towards gen 2

basvandorst avatar Jun 25 '24 13:06 basvandorst

Hello everyone, tagging this as a feature request.

Unfortunately, it's not possible now to upgrade any extension to v2 Firestore triggers since extensions don't yet support them, once it does we will update the triggers.

For the contradiction between the params and actual functionality, I'm tracking this as an issue here #2090.

I think somehow Algolia has implemented something similar on their Extension. Maybe, it is possible to do this here?

Default configuration is hardcoded here and even if this fails due to taskQueues implementation, the approach could be changed to match Algolia's sync approach. What do you think @pr-Mais ?

adonistseriotis avatar Nov 08 '24 12:11 adonistseriotis

Default configuration is hardcoded here and even if this fails due to taskQueues implementation, the approach could be changed to match Algolia's sync approach. What do you think @pr-Mais ?

+1 from me

tlloydukdev avatar Nov 19 '24 15:11 tlloydukdev

+1 from me

rummanext avatar Dec 04 '24 07:12 rummanext

I will escalate this to the firebase team, but from what I understand when we tried to do this with a similar approach to Algolia, we ran into the issue -

https://github.com/firebase/extensions/issues/2090#issuecomment-2172994954

If anyone has tested that Algolia extension with a non-default firestore instance, please let me know

cabljac avatar Dec 04 '24 11:12 cabljac

I keep getting notices about migrating v1 Cloud Functions to Cloud Run functions and migrating to Artifact Registry, but the only v1 Cloud Functions I have are the ones from this extension.

My understanding is that these functions will continue to work, but it seems that there is no solution to upgrade, even if we want to right now. Is that correct?

ih84ds avatar Jan 30 '25 17:01 ih84ds

👍 I am also getting notfications for this and it's due to this extension

millnut avatar Feb 06 '25 12:02 millnut

+1, in the process of updating everything to v2, this extension is kind of a roadblock

Silvan-M avatar Feb 12 '25 22:02 Silvan-M

when will we have extension work for non-default database?

shravya-ujire avatar Feb 25 '25 07:02 shravya-ujire

Hi all, I raised this with the team and did some experiments, and it turns out v2 triggers are supported and the official docs are out of date.

This is now being prioritised, I will keep you updated.

cabljac avatar Mar 24 '25 15:03 cabljac

great news @cabljac , looking forward to hearing more

tlloydukdev avatar Mar 24 '25 17:03 tlloydukdev

Moved to v2 firestore triggers in https://github.com/firebase/extensions/pull/2361 - Release out soon!

cabljac avatar Apr 17 '25 14:04 cabljac