[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor problems #165

Closed
JFGHT opened this issue May 30, 2023 · 1 comment · Fixed by #168
Closed

Minor problems #165

JFGHT opened this issue May 30, 2023 · 1 comment · Fixed by #168

Comments

@JFGHT
Copy link
JFGHT commented May 30, 2023

Finally could make it work after 1.1.1 release but two problems appeared:

1.- Permission error from the schedule tasks. Pasting here the logs of the schedule directly:

jsonPayload: {
task: "projects/PROJECT_ID/locations/europe-west1/queues/ext-firestore-algolia-search-executeFullIndexOperation/tasks/7225784997855251119"
attemptResponseLog: {
scheduleTime: "2023-05-25T13:09:38.502813Z"
dispatchCount: "13"
maxAttempts: 0
retryTime: "2023-05-25T13:16:28.30752Z"
status: "PERMISSION_DENIED"
attemptDuration: "0.203163s"
targetAddress: "POST https://europe-west1-broc-bloqify-production.cloudfunctions.net/ext-firestore-algolia-search-executeFullIndexOperation"
responseCount: "13"
targetType: "HTTP"
}

I was able to fix it by:
gcloud projects add-iam-policy-binding PROJECT_ID --member=serviceAccount:ext-firestore-algolia-search@PROJECT_ID.iam.gserviceaccount.com --role=roles/cloudfunctions.invoker

2.- I created a new API in Algolia key as recommended in the docs with the following permissions: “addObject”, “deleteObject”, “listIndexes”, “deleteIndex”, “editSettings”, and “settings”.

CF logs:

"Error: Unhandled error
    at entryFromArgs (/workspace/node_modules/firebase-functions/lib/logger/index.js:130:19)
    at Object.error (/workspace/node_modules/firebase-functions/lib/logger/index.js:116:11)
    at /workspace/node_modules/firebase-functions/lib/common/providers/tasks.js:70:24
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)"
transporterStackTrace: [
0: {
host: {3}
request: {6}
response: {
content: "{"message":"Not enough rights to add an object near line:1 column:288","status":400}"
isTimedOut: false
status: 400
}
triesLeft: 3
}]}

Solution: had to add the Admin key.

@smomin
Copy link
Collaborator
smomin commented May 30, 2023

Hey @JFGHT I will look into this. The Admin key is powerful and should be used with caution. The scoped keys should have worked. Can you send me a screenshot of the scoped key details minus sensitive data for me to review.

@smomin smomin linked a pull request Jun 3, 2023 that will close this issue
@smomin smomin closed this as completed Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants