This document provides solutions to common issues that may arise when working with the Neuron AI + Symfony Company Research Application.
- Installation Issues
- Configuration Problems
- Runtime Errors
- Database Issues
- Neuron AI Integration Problems
- Deployment Challenges
- Performance Optimization
- Common Error Messages
Problem: Error messages about missing PHP extensions during installation or runtime.
Solution:
-
Check which extensions are required in the SETUP.md document
-
Install missing extensions using your package manager:
# Ubuntu sudo apt install php8.3-intl php8.3-curl php8.3-mbstring php8.3-xml php8.3-zip # macOS brew install php-intl php-curl php-mbstring php-xml php-zip
-
Verify extensions are properly installed:
php -m | grep extension_name
Problem: Dependency conflicts or version constraints preventing installation.
Solution:
-
Make sure you have the latest Composer version:
composer self-update
-
Clear Composer cache:
composer clear-cache
-
Try running with higher memory limit:
php -d memory_limit=-1 /usr/local/bin/composer install
-
Update dependencies if possible:
composer update
Problem: Permission denied errors when writing to var/cache, var/log, etc.
Solution:
-
Set proper permissions for Symfony directories:
# Development permissions (not for production) sudo chmod -R 777 var/cache var/log # Better approach sudo setfacl -R -m u:www-data:rwX -m u:$(whoami):rwX var/cache var/log sudo setfacl -dR -m u:www-data:rwX -m u:$(whoami):rwX var/cache var/log
-
Check file ownership:
sudo chown -R $(whoami):www-data .
Problem: Application cannot find environment variables.
Solution:
-
Check if your
.env.localfile exists and has proper permissions -
Ensure syntax is correct with no spaces around
=signs:VARIABLE_NAME=value -
Make sure you're not overriding variables in other .env files
-
For shell environments, check if variables are exported properly:
export GENAI_API_KEY=your_key_here
Problem: Application running in wrong environment (prod vs. dev).
Solution:
-
Check APP_ENV setting in your .env file:
APP_ENV=dev -
For production deployment, ensure it's set to:
APP_ENV=prod APP_DEBUG=0 -
Clear cache after changing environments:
php bin/console cache:clear
Problem: Application returns 500 error with no specific error message in browser.
Solution:
-
Check logs for detailed error messages:
tail -f var/log/dev.log # or for production tail -f var/log/prod.log -
Temporarily enable more verbose errors by setting in index.php:
ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);
-
Check for server configuration issues in Apache/Nginx logs
Problem: URLs that should be valid return 404 Not Found errors.
Solution:
-
Check route definitions in controllers and config/routes.yaml
-
Verify route cache is updated:
php bin/console cache:clear php bin/console router:match /your/path
-
Check for typos in route names or path parameters
-
Ensure annotations/attributes are processed correctly
Problem: Form submission fails or doesn't process correctly.
Solution:
- Check CSRF protection (ensure token is present and valid)
- Verify form field names match entity properties
- Validate form constraints in code
- Check browser console for JavaScript errors
- Clear browser cache and cookies
Problem: Database migrations fail to execute.
Solution:
-
Check database connection parameters in .env.local
-
Ensure database exists and user has proper permissions
-
Run migrations in verbose mode to see detailed errors:
php bin/console doctrine:migrations:migrate -v
-
Check for SQL syntax errors in migration files
-
For fresh start (development only), drop schema and recreate:
php bin/console doctrine:schema:drop --force php bin/console doctrine:schema:create
Problem: Doctrine cannot map entities to database tables.
Solution:
-
Validate entity mappings:
php bin/console doctrine:schema:validate
-
Check for inconsistencies between entity definitions and actual database
-
Update getter/setter methods to match property names
-
Ensure relationship mappings are correct (OneToMany, ManyToOne, etc.)
Problem: Database queries are slow, especially with larger datasets.
Solution:
-
Check for missing indexes on frequently queried fields:
#[ORM\Index(columns: ["ticker_symbol"])]
-
Review repository methods for inefficient queries
-
Use Symfony Profiler to identify slow queries
-
Consider implementing pagination for large result sets
-
Add database-specific optimizations (MySQL, PostgreSQL, etc.)
Problem: Cannot authenticate with the LLM service.
Solution:
-
Verify API key is correct and not expired
-
Check if key has proper permissions for required operations
-
Ensure environment variables are properly loaded:
php bin/console debug:container --env-vars
-
Try regenerating API key from the provider's dashboard
Problem: AI responses are incomplete, malformed, or not usable.
Solution:
- Check prompt engineering in NeuronAiService
- Ensure API response parsing handles errors gracefully
- Implement retry logic with exponential backoff
- Adjust parameters like temperature or max_tokens
- Verify model compatibility with your prompts
Problem: Hitting rate limits from the LLM service.
Solution:
- Implement request throttling in the NeuronAiService
- Add caching for common or repetitive queries
- Use bulk operations where possible instead of many small requests
- Consider upgrading to a higher tier service plan
- Add fallback mechanisms for when rate limits are reached
Problem: Application fails to deploy to Cloud Foundry.
Solution:
-
Check manifest.yml for correct settings
-
Verify buildpack compatibility with PHP version
-
Look at staging logs for detailed error messages:
cf logs company-research --recent
-
Ensure application size doesn't exceed platform limits
-
Check memory allocation and increase if necessary:
cf scale company-research -m 1G
Problem: Cannot bind or use bound services in Cloud Foundry.
Solution:
-
Verify service instance exists and is available:
cf services
-
Check service binding status:
cf service company-research-llm
-
Ensure application code correctly accesses VCAP_SERVICES environment variables
-
Restart/restage application after binding services:
cf restage company-research
-
Check service-specific documentation for binding requirements
Problem: Web pages load slowly, especially with complex data.
Solution:
-
Implement HTTP caching where appropriate:
$response->setPublic(); $response->setMaxAge(3600);
-
Use Symfony's cache component for expensive operations
-
Optimize database queries (add indexes, join optimization)
-
Implement pagination for large result sets
-
Consider using AJAX for loading data asynchronously
Problem: Application consumes excessive memory, especially during AI operations.
Solution:
- Optimize Doctrine entity manager (clear after batch operations)
- Break large operations into smaller chunks
- Implement garbage collection for long-running processes
- Use streaming responses for large datasets
- Increase memory allocation if necessary, but address root causes
Problem: AI-related features take too long to respond.
Solution:
- Implement background processing for non-interactive AI tasks
- Use Symfony Messenger for asynchronous operations
- Cache common AI responses where appropriate
- Optimize prompt length and complexity
- Consider implementing progress indicators for long-running operations
Possible causes:
- Incorrect database credentials
- Database server not running
- Network connectivity issues
- Firewall blocking connection
Solutions:
-
Verify database credentials in .env.local
-
Check database server status
-
Test connection using command-line tools:
mysql -u username -p -h hostname
-
Check for network/firewall issues
Possible causes:
- Namespace issues
- Autoloading problems
- Typos in class names or file paths
Solutions:
- Check namespace declaration matches directory structure
- Verify PSR-4 autoloading configuration in composer.json
- Run composer dump-autoload
- Check for case sensitivity issues in filenames
Possible causes:
- Route doesn't exist
- Missing required parameters
- Typo in route name
Solutions:
-
List all available routes:
php bin/console debug:router
-
Check route definition in controller annotations/attributes
-
Verify all required parameters are provided
-
Clear router cache:
php bin/console cache:clear
Possible causes:
- AI service connectivity issues
- Invalid API key
- Rate limiting
- Incompatible API formats
Solutions:
- Check API connectivity and credentials
- Look for more specific error messages in logs
- Implement better error handling in the NeuronAiService
- Add proper fallback mechanisms for AI service failures
If you encounter an issue not covered in this document, please:
- Check the application logs in var/log/
- Review Symfony's error pages for detailed information
- Search for similar issues in our issue tracker
- Report the issue with detailed reproduction steps