Hello everyone, i keeo getting this error "Error: ...
# community-help
j
Hello everyone, i keeo getting this error "Error: Request failed with HTTP code 401 | Server said: Forbidden - a valid
x-typesense-api-key
header must be sent" anyone got any idea on how to fix it?
h
Are you passing the
x-typesense-api-key
header with your api key?
j
how do you mean?
1
h
when you send a request
you need to pass a HTTP header which contains the API key that you start typesense with
j
this is my first time with typesense so a little more info or example will help out please
h
j
So the thing is that I am using typensese to search my db but whenever i try to run the code I get this error
j
Could you make an API call to the metrics endpoint using curl and your API key to double check that it works fine: https://typesense.org/docs/0.22.1/api/cluster-operations.html#cluster-metrics
Also how did you create your API key?
j
export TYPESENSE_API_KEY=xyz mkdir /tmp/typesense-data ./typesense-server --data-dir=/tmp/typesense-data --api-key=$TYPESENSE_API_KEY --enable-cors and this is the output
j
It looks like you already have another Typesense server listening on 8108
If you do
ps aux | grep typesense
it will show you the process ID
And then you want to kill it with
kill <process id>