Typesense Key and Data Problems After Server Restart
TLDR 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.
Dec 03, 2021 (26 months ago)
Thanks to Typesense, our team’s development efficiency is very high and it helps us a lot. 😄
By the way, I have a question. Our team is using Typesense (Docker) with GCE. After restarting the instance, I get the error “Request failed with HTTP code 401 | Server said: Forbidden - a valid
x-typesense-api-keyheader must be sent. Why?
I’m looking forward to your reply.
Kishore Nallan03:00 AM
In any case, check that the API key you are sending is actually present by hitting the /keys endpoint.
Of course, I’m using v0.21.0.
If I restart the instance, do I need to reconfigure the API key as well?
Kishore Nallan03:48 AM
Kishore Nallan03:53 AM
Kishore Nallan03:53 AM
Is this normal behavior?
Since Typesense stores data in RAM, isn’t it possible that the data is erased after a reboot? When I reboot, the docker container is also exited.
Kishore Nallan04:03 AM
Kishore Nallan04:46 AM
Kishore Nallan04:54 AM
a) Only keys were missing but collection data was okay?
b) Do you run Typesense as a single node or as a cluster?
c) When was the last time did you restart the Typesense server?
d) When was the last time did you create/rotate API keys?
e) Can you share the Typesense logs on restart?
Dec 04, 2021 (25 months ago)
a) data was also lost
b) single node
c) yesterday (Technically speaking, I restarted the GCE instance and restarted the docker container.)
d) yesterday (Initial bootstrap key remained unchanged)
e) Could you please tell me how to get the logs?
Kishore Nallan09:16 AM
The docker logs command will print container logs on screen.
Dec 05, 2021 (25 months ago)
Indexed 3015 threads (79% resolved)
Troubleshooting Typesense Server Error on Docker
vikram was facing an error with Typesense Server Docker container and loss of data on restart. Kishore Nallan guided to avoid mounting tmp directory from localhost and explained stopping the Docker container.
Trouble with Typesense Memory Usage when Restarting Docker Container
Blend reports increased memory usage when restarting Docker with Typesense, information shared with Jason and Kishore Nallan. Potential data edge case identified as potential cause, although resolution undetermined.
Troubleshooting Local Authentication Issue in Typesense
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.
Debugging Typesense API Key Error
James is getting an error related to the `x-typesense-api-key` header in their Typesense project. Harrison suggests passing the API key in the HTTP header, and Jason advises checking the key via curl and possibly closing a duplicate Typesense server.
Deploying Typesense in GCP Cloud Run
Christian had difficulties obtaining an API key for deploying Typesense in GCP Cloud Run. Kishore Nallan guided on API key creation when setting up Typesense server and suggested checking the Typesense self-hosting guide. Christian decided to run the Typesense in Kubernetes instead of Cloud Run. Nasim thanked Christian for sharing findings.