Date of slack thread: 8/13/24
Anonymous: This message was deleted.
Statbot: It sounds like the Statsig Server SDK is not properly initialized, which is why you’re seeing the “Uninitialized” reason. This can happen if the SDK initialization process is interrupted or if the SDK is not correctly configured to fetch the latest configuration values. Here are a few steps you can take to troubleshoot this issue:
Ensure Proper Initialization: Make sure that the SDK is initialized correctly with the server SDK key and that the initialization process completes successfully. For example, in PHP, you would initialize the SDK like this:
require_once __DIR__ . '/vendor/autoload.php'; // path to installation folder
use Statsig\StatsigServer;
use Statsig\StatsigOptions;
use Statsig\Adapters\LocalFileDataAdapter;
use Statsig\Adapters\LocalFileLoggingAdapter;
$config_adapter = new LocalFileDataAdapter();
$logging_adapter = new LocalFileLoggingAdapter();
$options = new StatsigOptions($config_adapter, $logging_adapter);
$this->statsig = new StatsigServer("server-sdk-key", $options);
Check for Cron Job Configuration: If you are using SDK version 3.0 or above, ensure that you have configured a cron job to fetch the latest config values. Without this, the SDK will use stale values.
// Ensure you have a cron job set up to fetch the latest config values
Inspect SDK Logs: Check the SDK logs for any errors or warnings that might indicate why the initialization is failing. This can provide clues about what might be going wrong.
Client SDK Debugger: Use the Client SDK Debugger to inspect the current values that the SDK is using internally. This tool can help you see the current User object the SDK is using as well as the gate/config values associated with it. source
If the issue persists, please share the link to the specific gate or experiment in the Statsig console so that an employee can assist further.