Unleash / unleash-client-node

Unleash client SDK for Node.js
https://docs.getunleash.io
Apache License 2.0
209 stars 71 forks source link

Network Timeout Error in Unleash Client #624

Open achraf-workspace opened 2 months ago

achraf-workspace commented 2 months ago

Describe the bug

While initializing the feature flags using the unleash-client in our Node.js application, we occasionally encounter a FetchError: network timeout. The timeout error happens when attempting to register with the unleash server as shown by this URL: https://gitlab.com/api/v4/feature_flags/unleash//client/register

This error disrupts the normal initialization flow of our application's feature flag mechanism.

This error is thrown occasionally but not always. An investigation into possible networking issues, unleash server load or other possible causes would greatly help us to resolve the issue.

Steps to reproduce the bug

No response

Expected behavior

The expected behavior is that unleash-client should successfully register with the unleash server and initialize without throwing any network timeout errors.

Logs, error output, etc.

FetchError: network timeout at: https://gitlab.com/api/v4/feature_flags/unleash/<PROJECT_ID>/client/register
    at Timeout.<anonymous> (/app/node_modules/minipass-fetch/lib/index.js:108:18)
    at listOnTimeout (node:internal/timers:573:17)
    at processTimers (node:internal/timers:514:7) {
  code: 'FETCH_ERROR',
  errno: 'FETCH_ERROR',
  type: 'request-timeout'
}

Screenshots

No response

Additional context

No response

Unleash version

4.1.0

Subscription type

None

Hosting type

None

SDK information (language and version)

No response

chriswk commented 2 months ago

Hi. Since you're using gitlab as your feature flag provider, we have no insight into their load or availability metrics. Reach out to Gitlab if you want help with seeing their availability

giladkoch commented 1 month ago

Hey, Is there any update on this issue? We encounter this issue when using the node unleash client

gastonfournier commented 5 days ago

Hi @giladkoch that endpoint call client/register is a call that the SDK makes when you have metrics enabled and Gitlab does not support that protocol. So to get rid of that error you should disable metrics in Unleash SDK.