flagsmith-nodejs-client icon indicating copy to clipboard operation
flagsmith-nodejs-client copied to clipboard

Fixing flagsmith api from a failed state does not fix the consuming applications

Open nishant-shah-social opened this issue 1 year ago • 1 comments

Hello, We have been observing this weird behaviour quite a few times now with our services leveraging flagsmith nodejs client SDK. Following is the sequence of events that occur, which lead to the issue:- Note - Everything is running on Kubernetes. Flagsmith is self-hosted

  • Flagsmith api pod crashes due to some reason
  • While the flagsmith pod is in crashed state, the pods of the application services consuming flagsmith also restart due to some reason(e.g. a new deployment)
  • Now, we fix flagsmith api issue and bring it back. Everything is green on flagsmith side
  • However, the application service pod consuming flagsmith still keeps on giving error while calling getIdentityFlags

This is the stacktrace:-

stack: "Error: Invalid request made to Flagsmith API. Response status code: 404
    at new FlagsmithAPIError (/app/node_modules/flagsmith-nodejs/build/sdk/errors.js:30:42)
    at Flagsmith.<anonymous> (/app/node_modules/flagsmith-nodejs/build/sdk/index.js:414:35)
    at step (/app/node_modules/flagsmith-nodejs/build/sdk/index.js:33:23)
    at Object.next (/app/node_modules/flagsmith-nodejs/build/sdk/index.js:14:53)
    at fulfilled (/app/node_modules/flagsmith-nodejs/build/sdk/index.js:5:58

One more point. We also leverage flagsmith Go SDK for one of our applications, and there we dont observe this problem.

Any help around this would be highly appreciated.

Regards, Nishant Shah

nishant-shah-social avatar Sep 09 '24 20:09 nishant-shah-social