Closed ipranjal closed 3 years ago
Hey ipranjal, you're not providing enough information for me to action against. can you provide complete details so I can try to recreate the issue.
Hi @smomin - I am also facing the same issue. Earlier on Firestore extensions I configured some indices with algolia with firestore extension v0.3.0
and it was getting sync to Algolia smoothly.
Yesterday I configured some more collections from firestore to be synced to Algolia which is created by Extension v0.4.1
and they are not getting synced to Algolia.
So seems its issue with updated version of Firebase Algolia Extension.
is this the import process or the real time indexing issue? can you provide me the configuration without the apiKey?
hello, i have tested this out on my local and as well on my Cloud Firestore. I was able to import to a clean Algolia Index. I was able to make changes to data in my firestore collection and see the updates come through fine. Am I missing anything here?
@smomin sorry for late reply let me run the query and let you know exactly by EOD
@ipranjal if you can create a video of the issue, it will help me get this recreated and quickly get it fixed.
Please provide the collectionPath and fields configuration.
Step 1
Command I typed :
LOCATION=asia-south1\
ALGOLIA_APP_ID=Q********W\
ALGOLIA_API_KEY=718****************************70\
ALGOLIA_INDEX_NAME=shops\
COLLECTION_PATH=shops\
GOOGLE_APPLICATION_CREDENTIALS=*****/Downloads/firebase-adminsdk.json
npx firestore-algolia-search
Output I got :
{"severity":"WARNING","message":"Warning, FIREBASE_CONFIG and GCLOUD_PROJECT environment variables are missing. Initializing firebase-admin will fail"}
{"algoliaAPIKey":"********","severity":"INFO","message":"Initializing extension with configuration"}
Step 2
WARNING: The back fill process will index your entire collection which will impact your Search Operation Quota. Please visit https://www.algolia.com/doc/faq/accounts-billing/how-algolia-count-records-and-operation/ for more details. Do you want to continue?
Answer : yes
Output:
{"severity":"ERROR","message":"Error when performing Algolia index Error: Value for argument \"collectionPath\" is not a valid resource path. Path must be a non-empty string.\n at Object.validateResourcePath (/Users/physcocode/.npm/_npx/0ca4ecfa9810ae5b/node_modules/@google-cloud/firestore/build/src/path.js:414:15)\n at Firestore.collection (/Users/physcocode/.npm/_npx/0ca4ecfa9810ae5b/node_modules/@google-cloud/firestore/build/src/index.js:561:16)\n at retrieveDataFromFirestore (/Users/physcocode/.npm/_npx/0ca4ecfa9810ae5b/node_modules/firestore-algolia-search/lib/import/index.js:45:42)\n at /Users/physcocode/.npm/_npx/0ca4ecfa9810ae5b/node_modules/firestore-algolia-search/lib/import/index.js:75:9\n at Interface._onLine (readline.js:335:5)\n at Interface._line (readline.js:666:8)\n at Interface._ttyWrite (readline.js:1010:14)\n at ReadStream.onkeypress (readline.js:213:10)\n at ReadStream.emit (events.js:315:20)\n at emitKeys (internal/readline/utils.js:345:14)"}
Snapshot of collection In firestore
Firestore Secutity rule:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if
request.time < timestamp.date(2021, 7, 14);
}
}
}
@smomin let me know if I am missing any information you require :)
Just incase , here is my api key generation with all appropriate permissions
@smomin I also noticed this looks somewhat similar to #42 I am not sure though that we are facing the same problem
Note : Both firebase project and Algolia project are freshly made on the day I reported this issue
Hey @ipranjal, thanks for sending all this information. Now looking at everything. I see the issue. The error you are getting is the Collection Path is not set. From your CLI command, you are missing \
at the end of the GOOGLE_APPLICATION_CREDENTIALS
location string. Here is the correct command:
LOCATION=asia-south1\
ALGOLIA_APP_ID=Q********W\
ALGOLIA_API_KEY=718****************************70\
ALGOLIA_INDEX_NAME=shops\
COLLECTION_PATH=shops\
GOOGLE_APPLICATION_CREDENTIALS=*****/Downloads/firebase-adminsdk.json\
npx firestore-algolia-search
Please let me know if this resolve the issue. Thanks.
@ipranjal is this is fixed, can we close this issue.
@smomin I tried it but still the same issue :'(
Hey @ipranjal, lets try the below single line command:
LOCATION=asia-south1 ALGOLIA_APP_ID=Q********W ALGOLIA_API_KEY=718****************************70 ALGOLIA_INDEX_NAME=shops COLLECTION_PATH=shops FIELDS= GOOGLE_APPLICATION_CREDENTIALS=*****/Downloads/firebase-adminsdk.json npx firestore-algolia-search@0.4.1
@smomin weird, it worked out as single line command , am closing this issue for now, here are my spec where I was running the command
OS : MacOS Big Sur Terminal: zsh
I used the "import existing documents" section from firebase extension and it gives the following error