Troubleshooting
Common issues and solutions for the Laravel SDK.
Errors Not Appearing in Dashboard
Check Nadi is Enabled
Verify Nadi is enabled in your environment:
php artisan tinker
>>> config('nadi.enabled')
=> trueIf disabled, enable it:
NADI_ENABLED=trueVerify API Credentials
Test your credentials:
php artisan nadi:testIf credentials are invalid:
- Log in to nadi.pro
- Verify your API Key in Settings → API Tokens
- Verify your App Key in the application settings
- Update your
.envfile
Check Log File Creation
Verify logs are being written:
ls -la /var/log/nadi/If the directory doesn't exist or is empty:
# Create the directory
sudo mkdir -p /var/log/nadi
# Set permissions
sudo chown www-data:www-data /var/log/nadi
sudo chmod 755 /var/log/nadiCheck Shipper is Running
Verify Shipper is processing logs:
# Check Shipper status
shipper --status
# Check Shipper logs
tail -f /var/log/shipper.logCheck Sampling Rate
Verify you're not sampling too aggressively:
php artisan tinker
>>> config('nadi.sampling.config.sampling_rate')
=> 1.0 # Should be > 0Set to 100% for testing:
NADI_SAMPLING_STRATEGY=fixed_rate
NADI_SAMPLING_RATE=1.0Permission Errors
Log Directory Permissions
# Error: Unable to write to log file
# Solution:
sudo chown -R www-data:www-data /var/log/nadi
sudo chmod -R 755 /var/log/nadiSELinux (CentOS/RHEL)
If using SELinux:
# Allow Apache/Nginx to write to log directory
sudo semanage fcontext -a -t httpd_log_t "/var/log/nadi(/.*)?"
sudo restorecon -Rv /var/log/nadiConfiguration Issues
Config File Not Found
If changes aren't taking effect:
# Clear config cache
php artisan config:clear
# Republish config
php artisan vendor:publish --tag=nadi-config --forceEnvironment Variables Not Loading
Check .env file is being read:
php artisan tinker
>>> env('NADI_API_KEY')
=> "your-key" # Should show your keyIf null, verify:
.envfile exists in project root- No syntax errors in
.env - Clear config cache:
php artisan config:clear
Exception Handler Issues
Exceptions Not Being Reported
Verify the exception handler is registered. For Laravel 11+:
// bootstrap/app.php
return Application::configure(basePath: dirname(__DIR__))
->withExceptions(function (Exceptions $exceptions) {
// Nadi should be auto-registered
})
->create();For Laravel 9-10, check app/Exceptions/Handler.php:
public function register()
{
$this->reportable(function (Throwable $e) {
if (app()->bound('nadi')) {
app('nadi')->captureException($e);
}
});
}Exception in Don't Report List
Check if your exception type is being ignored:
// config/nadi.php
'dont_report' => [
// Your exception might be listed here
],Queue Job Issues
Queue Exceptions Not Captured
Ensure queue exception capture is enabled:
// config/nadi.php
'capture_queue_exceptions' => true,Context Lost in Jobs
Context set before dispatch isn't available in jobs. Set context within the job:
class ProcessOrder implements ShouldQueue
{
public function handle()
{
Nadi::setTag('job', 'process_order');
// ... job logic
}
}Memory Issues
High Memory Usage
If Nadi is using too much memory:
- Reduce breadcrumb limit:
// config/nadi.php
'breadcrumbs' => [
'max_breadcrumbs' => 50, // Default is 100
],- Limit stack trace depth:
'max_stack_frames' => 30, // Default is 50- Disable request body capture:
'capture_request_body' => false,Network Issues
Timeout Errors (HTTP Transporter)
If using HTTP transporter directly:
// config/nadi.php
'http' => [
'timeout' => 10, // Increase timeout
],SSL/TLS Errors
Verify SSL certificates:
curl -v https://nadi.pro/api/healthIf certificate issues, ensure CA certificates are up to date:
# Ubuntu/Debian
sudo apt-get update && sudo apt-get install ca-certificates
# CentOS/RHEL
sudo yum update ca-certificatesCommon Error Messages
"Invalid API Key"
- Verify the API key is correct
- Check for whitespace in
.env - Ensure the key hasn't been regenerated
"Application Not Found"
- Verify the App Key is correct
- Check the application hasn't been deleted
- Ensure you're using the right environment's key
"Rate Limit Exceeded"
- Implement sampling to reduce volume
- Check for error loops
- Contact support for rate limit increase
"Storage Path Not Writable"
# Fix permissions
sudo chown www-data:www-data /var/log/nadi
sudo chmod 755 /var/log/nadiDebugging Steps
1. Enable Debug Mode
// config/nadi.php
'debug' => true,2. Check Laravel Logs
tail -f storage/logs/laravel.log | grep -i nadi3. Verify Installation
composer show nadi-pro/nadi-laravel4. Test Manually
// In tinker or a route
use Nadi\Laravel\Facades\Nadi;
Nadi::captureMessage('Debug test');
// Check log file
$log = file_get_contents('/var/log/nadi/nadi-' . date('Y-m-d') . '.log');
dump($log);5. Verify Event Format
$event = json_decode(file_get_contents('/var/log/nadi/nadi-' . date('Y-m-d') . '.log'), true);
dump($event);Getting Help
If you're still having issues:
- Check documentation: Review the relevant section
- Search issues: GitHub Issues
- Contact support: [email protected]
When contacting support, include:
- Laravel version
- PHP version
- Nadi package version
- Error messages
- Steps to reproduce
- Relevant configuration (redact API keys)