Closed jsancho closed 5 months ago
here's the full stack trace in case this helps
Could you make sure that you're using your Typesense Admin API key (and not your search-only api key) when configuring the extension?
You can verify your API keys' permissions by going to the API Keys section in your Typesense Cloud cluster dashboard (on the right side pane at the bottom).
Could you make sure that you're using your Typesense Admin API key (and not your search-only api key) when configuring the extension?
You can verify your API keys' permissions by going to the API Keys section in your Typesense Cloud cluster dashboard (on the right side pane at the bottom).
Yes, the key is one with access to all actions but a restricted set of collections.
I have actually used that key to populate the collections initially from a local node project, so it should be fine.
Looks like the collections
permission is configured incorrectly in Typesense Cloud.
It either has to be a full verbatim match, or a regex. So if you intend for that API key to allow access to all collections that start with jsancho_
you want to set it up as jsanco_.*
in the API key collections
key
It either has to be a full verbatim match, or a regex. So if you intend for that API key to allow access to all collections that start with
jsancho_
you want to set it up asjsanco_.*
in the API keycollections
key
Yikes! that was pretty daft of me.
I'll create some new keys and reconfigure the function. I would have sworn that's the key I used to initially populate the collection, but I must have used on of the auto-generated ones at the beginning.
thanks! 🙏🏻
Happy to help!
Description
I have just set up a new cluster in Typesense cloud and configured the plugin for a firestore collection. The process has gone without any issues, it's actually been surprisingly simple.
However, documents are failing to sync due to an authorization issue. It seems that the GCF is not setting the header, as the TypeSense host rejects the upsert with the following message
RequestUnauthorized: Request failed with HTTP code 401 | Server said: Forbidden - a valid
x-typesense-api-keyheader must be sent
The secret with the API key has been created during the setup, as it can be seen on the GCF variables tab.
I have reviewed the function source and watched for typos for anything related to the
typesenseAPIKey
, that is configured on the client. It all seems fine to me. I was wondering if there might be a little extra to be done when reading secrets fromprocess.env
. But if that were the case this would have failed for many others as well.Do you have any ideas on why this might be failing?
Steps to reproduce
Expected Behavior
I would expect the document to sync to Typesense.
Actual Behavior
The upsert is rejected with a 401 indicated that the
x-typesense-api-key
has not been provided.Metadata
Typesense Version: 0.25.2
OS: cloud