Troubleshooting
This guide helps you diagnose and resolve common issues when using Beacon with your Laravel application.
Common Issues
Authentication and API Issues
Invalid API Token
Symptoms:
- 401 Unauthorized responses
- "Invalid API token" error messages
- Feature flags always return inactive
Solutions:
Verify your API token in the
.envfile:dotenvBEACON_ACCESS_TOKEN=your_actual_token_hereCheck that the token hasn't expired or been revoked in the Beacon dashboard
Ensure the token has the correct permissions for your application
Clear your configuration cache:
bashphp artisan config:clear
API Connection Issues
Symptoms:
- Timeout errors
- Connection refused errors
- Intermittent feature flag failures
Solutions:
Check your API URL configuration:
dotenvBEACON_API_URL=https://api.beaconhq.ioVerify network connectivity:
bashcurl -I https://api.beaconhq.io/upCheck firewall and proxy settings
Configuration Issues
Application or Environment Not Found
Symptoms:
- Feature flags not working in specific environments
- Inconsistent behavior across environments
Solutions:
Verify application name matches exactly:
dotenvAPP_NAME=my-exact-app-name # OR BEACON_APP_NAME=my-exact-app-nameCheck environment name:
dotenvAPP_ENV=production # OR BEACON_ENVIRONMENT=production
Cache Issues
Symptoms:
- Stale feature flag values
- Changes not reflecting immediately
- Inconsistent behavior
Solutions:
Clear application cache:
bashphp artisan cache:clearClear Beacon-specific cache:
bashphp artisan cache:forget beacon:*Adjust cache TTL for faster updates:
dotenvBEACON_CACHE_TTL=300 # 5 minutes instead of 30Disable caching temporarily for debugging:
dotenvBEACON_CACHE_TTL=0
Feature Flag Issues
Feature Flag Always Return Inactive
Symptoms:
- Feature flags never activate
Solutions:
- Check if the feature flag exists in Beacon dashboard
- Verify the feature flag is enabled for your environment
- Check policy configuration and targeting rules
- Test with a simple "always on" policy first
- Use Beacon's Code feature to create an API request to test with.
Inconsistent Feature Flag Behavior
Symptoms:
- Feature flags work sometimes but not others
- Different behavior for same user
- Random activation/deactivation
Solutions:
Verify policy logic and expressions
Check for caching issues (see Cache Issues section)
Review Rollout and Variants configuration
Performance Issues
Slow Feature Flag Evaluation
Symptoms:
- High response times
- Timeouts during feature flag checks
- Application performance degradation
Solutions:
- Enable and optimize caching:dotenv
BEACON_CACHE_TTL=1800 BEACON_CACHE_STORE=redis
High API Usage
Symptoms:
- Rate limiting errors (429 responses)
- High API costs
- Frequent cache misses
Solutions:
Increase cache TTL:
dotenvBEACON_CACHE_TTL=3600 # 1 hourReview and optimize policy complexity
Getting Help
Before Contacting Support
Check the Beacon Status Page for service issues
Review your configuration against this documentation
Test with a minimal reproduction case
Gather relevant logs and error messages
Information to Include
When contacting support, include:
- Laravel version
- Beacon Pennant driver version
- Complete error messages and stack traces
- Relevant configuration (without sensitive data)
- Steps to reproduce the issue
- Expected vs actual behavior
Monitoring and Alerting
Health Checks
To implement health checks for Beacon connectivity, first add a feature flag called health-check with an active status on all application environments, then verify it is active via Feature::active():
use Illuminate\Foundation\Events\DiagnosingHealth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Event;
use Laravel\Pennant\Feature;
Event::listen(DiagnosingHealth::class, function () {
Feature::define('health-check');
if (!Feature::active('health-check')) {
throw new \Exception('Feature flag check failed!');
}
});