Repository navigation
Closed
Labels
Description
[REQUIRED] Environment info
firebase-tools: 13.29.0
Platform: Linux 6.12.17-1-lts
[REQUIRED] Test case
[REQUIRED] Steps to reproduce
- Create a project with emulators for functions, extensions and firestore
- Add the Typesense Firestore adapter with the v2 API
- Try to start the emulators
- Get the
a namespace must be suppliederror, with no further explanation
[REQUIRED] Expected behavior
Get a better debug log to identify the issue in the extension
[REQUIRED] Actual behavior
Get this debug log:
[2025-03-31T09:05:39.533Z] [Extensions] Connecting Extensions emulator, this is a noop.
i functions: Watching "/home/fanis/.cache/firebase/extensions/typesense/[email protected]/functions" for Cloud Functions... {"metadata":{"emulator":{"name":"functions"},"message":"Watching \"/home/fanis/.cache/firebase/extensions/typesense/[email protected]/functions\" for Cloud Functions..."}}
✔ functions: Loaded functions definitions from source: indexOnWrite, backfill. {"metadata":{"emulator":{"name":"functions"},"message":"Loaded functions definitions from source: indexOnWrite, backfill."}}
[2025-03-31T09:05:39.535Z] Found a v2 firestore trigger.
[2025-03-31T09:05:39.537Z] Could not find VSCode notification endpoint: FetchError: request to http://localhost:40001/vscode/notify failed, reason: connect ECONNREFUSED ::1:40001. If you are not running the Firebase Data Connect VSCode extension, this is expected and not an issue.
i emulators: Shutting down emulators. {"metadata":{"emulator":{"name":"hub"},"message":"Shutting down emulators."}}
i ui: Stopping Emulator UI {"metadata":{"emulator":{"name":"ui"},"message":"Stopping Emulator UI"}}
i extensions: Stopping Extensions Emulator {"metadata":{"emulator":{"name":"extensions"},"message":"Stopping Extensions Emulator"}}
[2025-03-31T09:05:39.538Z] [Extensions] Stopping Extensions emulator, this is a noop.
i functions: Stopping Functions Emulator {"metadata":{"emulator":{"name":"functions"},"message":"Stopping Functions Emulator"}}
i firestore: Stopping Firestore Emulator {"metadata":{"emulator":{"name":"firestore"},"message":"Stopping Firestore Emulator"}}
[2025-03-31T09:05:39.540Z] *** shutting down gRPC server since JVM is shutting down
{"metadata":{"emulator":{"name":"firestore"},"message":"*** shutting down gRPC server since JVM is shutting down\n"}}
[2025-03-31T09:05:39.556Z] *** server shut down
{"metadata":{"emulator":{"name":"firestore"},"message":"*** server shut down\n"}}
i eventarc: Stopping Eventarc Emulator {"metadata":{"emulator":{"name":"eventarc"},"message":"Stopping Eventarc Emulator"}}
i tasks: Stopping Cloud Tasks Emulator {"metadata":{"emulator":{"name":"tasks"},"message":"Stopping Cloud Tasks Emulator"}}
i hub: Stopping emulator hub {"metadata":{"emulator":{"name":"hub"},"message":"Stopping emulator hub"}}
i logging: Stopping Logging Emulator {"metadata":{"emulator":{"name":"logging"},"message":"Stopping Logging Emulator"}}
[2025-03-31T09:05:39.896Z] Could not find VSCode notification endpoint: FetchError: request to http://localhost:40001/vscode/notify failed, reason: connect ECONNREFUSED ::1:40001. If you are not running the Firebase Data Connect VSCode extension, this is expected and not an issue.
Error: A namespace must be supplied.
Activity
tharropoulos commentedon Mar 31, 2025
The
extension.yamlof the Typesense extension:joehan commentedon Apr 1, 2025
Hey @tharropoulos, sorry to hear that you're running into this error. I took a look at https://github.com/tharropoulos/firebase-reprod, and it looks like there is no extensions/firestore-typesense-search.env file there. Could you upload that if you have it (remove any sensitive params first)? It will help us debug this issue.
Regardless of the root cause, this error message is very unclear and definitely something that we should at the very least clarify
tharropoulos commentedon Apr 1, 2025
@joehan Thanks for looking into it. I've updated the gitignore to track the env files.
joehan commentedon Apr 1, 2025
Thanks for the env files - I repro'd the issue locally. AFAICT, this is actually an error coming from the Typesense extension itself (see typesense/firestore-typesense-search#120). I'd recommend sharing this repro on that repo - that code is maintained by Typesense, so they should be able to help find/fix the root issue here.
tharropoulos commentedon Apr 1, 2025
Funnily enough, I'm part of the team and we're unable to find the root cause, that's why I opened this one up! Hahaha, are there any resources on what could be causing this namespace problem? It came up just after migrating to the V2 API
joehan commentedon Apr 1, 2025
Ahhh, my bad! Definitely can try to help with that. It looks like the code is hitting this error:
firebase-tools/src/emulator/functionsEmulator.ts
Line 1105 in 14b68b4
namespacefield to eventFilters on each Firestore triggered function in your resources.I don't immediately recall what that field looks like, but I'll try to find some docs that give an example and share them here.
On a separate note, this error is super unhelpful and should at the very least include the name of the function having issues - that's on us to fix.
tharropoulos commentedon Apr 1, 2025
No need to find the docs, pointing me in the right direction was enough. Thanks for being so quick on this. Would you prefer I close this issue or leave it open for you to track progress on the error handling logic?
joehan commentedon Apr 1, 2025
You can leave this open - as i'm digging more, it's pretty clear that the extensions emulator should have this value fall back to '(default)' if it is not provided (to match the behavior of firebase-functions). We can leave this open to track that work.