Troubleshooting Local Authentication Issue in Typesense
TLDR Todd reported consistent issues with local authentication, leading to requests failing. Kishore Nallan suggested checking the server logs. This revealed Todd was using an incorrect API key. The issue resolved by itself, although somewhat mysteriously.
1
Oct 05, 2023 (1 month ago)
Todd
10:03 PMRequestUnauthorized: Request failed with HTTP code 401 | Server said: Forbidden - a valid `x-typesense-api-key` header must be sent.
I’m confused, I’m on the latest stable docker image 0.25.1, and the latest version of the nodejs client 1.7.1. I’ve tried pruning my docker images and recreating my data volume. Nothing seems to help however. I’m setting the bootstrap api key via the TYPESENSE_API_KEY environment variable and just using that.
Anyone else having this issue, or anyone got any tips for further troubleshooting?
Oct 06, 2023 (1 month ago)
Kishore Nallan
12:06 AMTodd
12:40 AMScoped API keys can only be used for searches.
However, I’m confused. I’m not manually creating API keys anywhere locally, and I’m just using the bootstrap API key, which I supply to the docker container as the TYPESENSE_API_KEY environment variable
Todd
12:41 AMKishore Nallan
12:59 AMTodd
02:48 AM1
Typesense
Indexed 3011 threads (79% resolved)
Similar Threads
Typesense Key and Data Problems After Server Restart
Masahiro experienced an issue with Typesense (Docker) on GCE, as the API key and data were lost after server restart. Kishore Nallan and Jason suggested that the issue might be with the Docker container or GCE instance not using a persistent volume, leading to data loss on restart.
Issues with Generating Scope API Keys in Python
Danny had issues generating a valid scope API key in a Python GraphQL server. Jason suggested encoding changes and confirmed that the key length varies. Issue unresolved with Python, although JS library worked.
Invalid API Key Error with Typesense Docker Image
Cooper faced an invalid API key error with the Typesense Docker image. Jason explained that scoped API keys only work with parent keys created via the /keys API endpoint.