Mac Users Unable to Connect to Typesense Health Check through BE
TLDR KARTHICK is unable to connect to Typesense health check through backend on a new Mac setup, despite configurations working on older Mac. Jason suggests checking possible issues in backend routing and environment file processing.
May 19, 2023 (7 months ago)
KARTHICK
12:58 PMbrew install typesense/tap/[email protected]
• And i have started the service using
brew services start [email protected]
• I started to hit this API
<http://localhost:8108/health>
• I got the status { ok: true }
• But when i try to hit the Typesense health check from my BE it's showing the below error This is happening in now before its working fine in another Mac.
Kishore Nallan
01:04 PMSergio
04:10 PM127.0.0.1
as address instead of localhost
or your LAN IP. It could be related to the BE running in an isolated network (like docker)May 21, 2023 (6 months ago)
KARTHICK
05:01 PMKARTHICK
05:03 PMKARTHICK
05:06 PM• I have installed this using homebrew and started the typesense server.
• From the above health check i'm getting {ok : true}.
• When i try to connect from my BE its throwing error.
• In my older Mac its working fine i have followed the same setup procedure i'm getting error now.
Jason
06:04 PMMay 22, 2023 (6 months ago)
KARTHICK
04:29 AMJason
05:31 PMMay 23, 2023 (6 months ago)
KARTHICK
05:35 AMconst configTypesense: any =
process.env.NODE_ENV === 'development'
? {
host: typesenseHost,
port: Number(typesensePort),
protocol: typesenseProtocol,
}
:
{
host: typesenseHost,
protocol: typesenseProtocol,
};
const client = new Typesense.Client({
nodes: [configTypesense],
apiKey:typesenseApiKey,
connectionTimeoutSeconds: 60,
});
• This is the env:
### TYPESENSE
TYPESENSE_HOST=localhost
TYPESENSE_PORT=8108
TYPESENSE_PROTOCOL=http
TYPESENSE_APIKEY=xyz
KARTHICK
05:38 AMtypesenseRouter.get('/health/check', healthCheck);
• This is the controller:
export const healthCheck = async (
_req: Request,
res: Response,
next: NextFunction
): Promise<void> => {
try {
const checkStatus = await typesenseHealthCheck();
res.status(200).json({
response: 'success',
message: 'typesense server running successfully',
data: checkStatus,
});
} catch (error) {
next(BadRequest('Failed to run the typesense', error));
}
};
• This is the services :
export const typesenseHealthCheck = async (): Promise<HealthResponse> => {
const health = await client.health.retrieve();
return health;
};
May 24, 2023 (6 months ago)
KARTHICK
01:17 PMJason
05:52 PMJason
05:53 PMcurl <http://localhost:8108/health>
and that is successful, and you’re running your backend on your local computer, then it could be an issue with how external network calls get routed in your backendJason
05:54 PMJason
05:54 PMTypesense
Indexed 3015 threads (79% resolved)
Similar Threads
Typesense Error in Unit Testing for Python
Mehdi was encountering errors while running unit tests for Typesense functionalities in Python. Through discussion with Kishore Nallan, they recognized resource constraints might be causing the issue during JSONL file import. As suggested by Kishore Nallan, adding a short sleep after the import resolved the problem.
Connection Refused Issue with Typesense and Nginx Reverse Proxy
Karthik experiences a connection refused problem with Typesense and Nginx reverse proxy. Jason helps troubleshoot, but the issue remains unresolved.
Resolving Issues with Infix and Prefix in Query Searches
Daren struggled with searches missing values in production. Jason and Kishore Nallan offered insights and created new features to help solve the problem, which was then tested and deployed by Daren.
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.
Typescript Support and Import Issues with Typesense
Ahmad faced trouble with Typesense support for Typescript. Jason assisted by suggesting checks and solutions. Phil suggested modifying the import statement. Ultimately, the issue was resolved with a change from Jason in version `v1.1.2`.