UnleashProxy no longer works with GitLab feature flags
## Summary With version 6 of the unleash client, the [instanceId](https://github.com/Unleash/unleash-client-node/commit/5b9da4edba4839e4b2300c5708b42c2cae8ac021#L100-L100) field has been removed and is now automatically generated. Since [version 1.4.1](https://github.com/Unleash/unleash-proxy/commit/a6492ce832bef4775029eca8de8b8935b81f3eca), the Unleash proxy has no longer worked with GitLab, leading to an error. ``` Error: Unleash Repository error: https://gitlab.com/api/v4/feature_flags/unleash/{PROJECT_ID}/client/features responded 401 which means your API key is not allowed to connect. Stopping refresh of toggles ``` ## Steps to reproduce Start the latest version of the unleash-proxy server ``` docker run \ -e UNLEASH_PROXY_CLIENT_KEYS=123 \ -e UNLEASH_URL=https://gitlab.com/api/v4/feature_flags/unleash/{PROJECT_ID}\ -e UNLEASH_INSTANCE_ID={INSTANCE_ID}\ -e UNLEASH_API_TOKEN=token1234 \ -e UNLEASH_APP_NAME=test\ -e LOG_LEVEL="debug" \ -p 3000:3000 \ --rm unleashorg/unleash-proxy ``` ## What is the current _bug_ behavior? The started container will be unhealthy, and the proxy won't work. ## What is the expected _correct_ behavior? The unleash proxy server can connect to GitLab and fetch the feature flag configuration. Currently, GitLab requires a match with the header `UNLEASH-INSTANCEID` ``` curl --header "UNLEASH-INSTANCEID: {INSTANCE_ID}" "https://gitlab.com/api/v4/feature_flags/unleash/{PROJECT_ID}" ``` However, since [version 6.0.0](https://github.com/Unleash/unleash-client-node/commit/5b9da4edba4839e4b2300c5708b42c2cae8ac021#L100-L100) of the `unleash-client`, the `instanceId` is automatically generated and cannot be specified as an env variable. ## Immediate Workaround The fastest fix for the one having the same error is to use the unleash-proxy version 1.4.0 ``` dodocker run \ -e UNLEASH_PROXY_CLIENT_KEYS=123 \ -e UNLEASH_URL=https://gitlab.com/api/v4/feature_flags/unleash/{PROJECT_ID}\ -e UNLEASH_INSTANCE_ID={INSTANCE_ID}\ -e UNLEASH_API_TOKEN=212 \ -e UNLEASH_APP_NAME=test\ -p 3000:3000 \ --rm unleashorg/unleash-proxy:1.4.0 ``` GitLab feature flag documentation should be updated accordingly.
issue