typesense / firestore-typesense-search

Firebase Extension to automatically push Firestore documents to Typesense for full-text search with typo tolerance, faceting, and more
https://extensions.dev/extensions/typesense/firestore-typesense-search
Apache License 2.0
150 stars 27 forks source link

Resource_Error #36

Open mibto opened 1 year ago

mibto commented 1 year ago

Hi Typesense Team

i get the following message when i try to install this extension with the console and cli

RESOURCE_ERROR at /deployments/firebase-ext-firestore-typesense-search/resources/backfillToTypesenseFromFirestore: {"ResourceType":"gcp-types/cloudfunctions-v1:projects.locations.functions","ResourceErrorCode":"400","ResourceErrorMessage":"Build failed: {\"metrics\":{},\"error\":{\"buildpackId\":\"\",\"buildpackVersion\":\"\",\"errorType\":\"OK\",\"canonicalCode\":\"OK\",\"errorId\":\"\",\"errorMessage\":\"\"},\"stats\":[{\"buildpackId\":\"google.nodejs.runtime\",\"buildpackVersion\":\"1.0.0\",\"totalDurationMs\":1496,\"userDurationMs\":0},{\"buildpackId\":\"google.utils.archive-source\",\"buildpackVersion\":\"0.0.1\",\"totalDurationMs\":45,\"userDurationMs\":44},{\"buildpackId\":\"google.nodejs.npm\",\"buildpackVersion\":\"1.0.0\",\"totalDurationMs\":6428,\"userDurationMs\":6185},{\"buildpackId\":\"google.nodejs.functions-framework\",\"buildpackVersion\":\"0.9.4\",\"totalDurationMs\":3756,\"userDurationMs\":3541},{\"buildpackId\":\"google.config.entrypoint\",\"buildpackVersion\":\"0.9.0\",\"totalDurationMs\":0,\"userDurationMs\":0},{\"buildpackId\":\"google.utils.label\",\"buildpackVersion\":\"0.0.2\",\"totalDurationMs\":0,\"userDurationMs\":0}],\"warnings\":null,\"customImage\":false}"}; RESOURCE_ERROR at /deployments/firebase-ext-firestore-typesense-search/resources/indexToTypesenseOnFirestoreWrite: {"ResourceType":"gcp-types/cloudfunctions-v1:projects.locations.functions","ResourceErrorCode":"400","ResourceErrorMessage":"Build failed: {\"metrics\":{},\"error\":{\"buildpackId\":\"\",\"buildpackVersion\":\"\",\"errorType\":\"OK\",\"canonicalCode\":\"OK\",\"errorId\":\"\",\"errorMessage\":\"\"},\"stats\":[{\"buildpackId\":\"google.nodejs.runtime\",\"buildpackVersion\":\"1.0.0\",\"totalDurationMs\":1485,\"userDurationMs\":0},{\"buildpackId\":\"google.utils.archive-source\",\"buildpackVersion\":\"0.0.1\",\"totalDurationMs\":59,\"userDurationMs\":59},{\"buildpackId\":\"google.nodejs.npm\",\"buildpackVersion\":\"1.0.0\",\"totalDurationMs\":6677,\"userDurationMs\":6425},{\"buildpackId\":\"google.nodejs.functions-framework\",\"buildpackVersion\":\"0.9.4\",\"totalDurationMs\":3689,\"userDurationMs\":3477},{\"buildpackId\":\"google.config.entrypoint\",\"buildpackVersion\":\"0.9.0\",\"totalDurationMs\":0,\"userDurationMs\":0},{\"buildpackId\":\"google.utils.label\",\"buildpackVersion\":\"0.0.2\",\"totalDurationMs\":0,\"userDurationMs\":0}],\"warnings\":null,\"customImage\":false}"}

when i look at the cloud functions there is a warning that the functions could not be built - log message from the function:

Build failed: {"metrics":{},"error":{"buildpackId":"","buildpackVersion":"","errorType":"OK","canonicalCode":"OK","errorId":"","errorMessage":""},"stats":[{"buildpackId":"google.nodejs.runtime","buildpackVersion":"1.0.0","totalDurationMs":1437,"userDurationMs":0},{"buildpackId":"google.utils.archive-source","buildpackVersion":"0.0.1","totalDurationMs":42,"userDurationMs":42},{"buildpackId":"google.nodejs.npm","buildpackVersion":"1.0.0","totalDurationMs":6883,"userDurationMs":6640},{"buildpackId":"google.nodejs.functions-framework","buildpackVersion":"0.9.4","totalDurationMs":3529,"userDurationMs":3323},{"buildpackId":"google.config.entrypoint","buildpackVersion":"0.9.0","totalDurationMs":0,"userDurationMs":0},{"buildpackId":"google.utils.label","buildpackVersion":"0.0.2","totalDurationMs":0,"userDurationMs":0}],"warnings":null,"customImage":false}

Thanks Michael

mibto commented 1 year ago
  "environmentVariables": {
    "DATABASE_INSTANCE": "",
    "DATABASE_URL": "",
    "EXT_INSTANCE_ID": "firestore-typesense-search-p78z",
    "FIREBASE_CONFIG": "{\"projectId\":\"workid-d9387\",\"databaseURL\":\"\",\"storageBucket\":\"workid-d9387.appspot.com\"}",
    "FIRESTORE_COLLECTION_PATH": "occupations",

this looks a bit suspicious to me empty database_url / instance

i14h commented 1 year ago

@mibto Firebaser here. I took a look around and saw nothing suspicious happening in Cloud Build or Cloud Functions. We've escalated this internally to the Cloud Build team to check your account and its permissions. I suggest creating a ticket with Cloud Support to keep track of the updates from our side.

mibto commented 1 year ago

Hi @i14h I found the issue, it's because i redirected the traffic from container registry to artefact registry. i have reproduced it with a new project. unfortunately i already finalized the redirect, which can not be undone :(

any idea how i can get it working with he artefact registry?

thanks! Michael

i14h commented 1 year ago

thanks for the information. let me dig a bit and see what I can find

mibto commented 1 year ago

I just found the "solution"

--> go to https://console.cloud.google.com/functions -> edit the functions -> expand "Runtime, build, connections and security settings", select "SECURITY AND IMAGE REPO", under "Image repository", select "Google managed Artifact Registry".

would be nice if the extension could detect if you are using the container registry or artefact registry and deploy the functions accordingly

mibto commented 1 year ago

@jasonbosco why is this closed? did you change something?

jasonbosco commented 1 year ago

I read your last comment and thought you had found a solution... Happy to re-open it.

From what I can tell though, this sounds like it's outside the realm of what extensions can do in general @i14h?