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)
Masahiro
02:56 AMThanks 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-key
header must be sent. Why?I’m looking forward to your reply.
Regards
Kishore Nallan
03:00 AMIn any case, check that the API key you are sending is actually present by hitting the /keys endpoint.
Masahiro
03:45 AMOf course, I’m using v0.21.0.
If I restart the instance, do I need to reconfigure the API key as well?
Kishore Nallan
03:48 AMMasahiro
03:51 AMKishore Nallan
03:53 AMKishore Nallan
03:53 AMMasahiro
03:59 AMIs 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.
Masahiro
04:00 AMMasahiro
04:01 AMKishore Nallan
04:03 AMKishore Nallan
04:46 AMKishore Nallan
04:54 AMa) 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)
Masahiro
12:18 AMa) 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 Nallan
09:16 AMThe docker logs command will print container logs on screen.
Dec 05, 2021 (25 months ago)
Jason
09:02 PMTypesense
Indexed 3015 threads (79% resolved)
Similar Threads
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.