launchdarkly/php-server-sdk

Server totally down when "targets" is null

Joluma opened this issue · 2 comments

Hi, I just had a huge issue when using launchdarkly.

I created a flag on the dashboard, with some specific rules, my application was working correctly, then I deleted this flag. After that, my website totally crashed, I had 500 errors everywhere, I discovered on my log that this issue was caused by launchdarkly.

Here one part of the logs :

redis:6379> hgetall "ld:b2c:staging::features"
 1) "registration-disclaimer"
 2) "{\"key\":\"\",\"version\":2,\"on\":false,\"prerequisites\":null,\"salt\":\"\",\"sel\":\"\",\"targets\":null,\"rules\":null,\"fallthrough\":{},\"offVariation\":null,\"variations\":null,\"deleted\":true}"

and php error :

Argument 6 passed to LaunchDarkly\FeatureFlag::__construct() must be of the type array, null given, called in /src/vendor/launchdarkly/launchdarkly-php/src/LaunchDarkly/FeatureFlag.php on line 67

registration-disclaimer is the name of the flag I deleted. But apparently, it was still there, somewhere on the cache maybe.

Do you have any clue about why did it happened, should I delete the cache every time I delete a flag ?

@Joluma Thanks for reaching out! Will you please send us a note at support@launchdarkly.com with your issue?

Fix #75 for this issue released in version 2.1.1.