Server Startup Issues
Server fails to start - Database connection error
Server fails to start - Database connection error
Symptoms:
- Server crashes during startup
- Error: “Cannot connect to database”
- Connection timeout errors
- Verify database is running:
- Check database credentials in
dist/game/config/Database.ini:
- Test database connection:
- Verify database exists:
- Check firewall rules:
OutOfMemoryError during startup
OutOfMemoryError during startup
Symptoms:
java.lang.OutOfMemoryError: Java heap space- Server crashes while loading data
- Increase JVM heap size:
- For larger servers, allocate more memory:
- Monitor memory usage:
- Check for memory leaks:
- Review
dist/game/log/error.log - Look for repetitive object creation
- Consider profiling with VisualVM
Port already in use
Port already in use
Symptoms:
java.net.BindException: Address already in use- Cannot bind to port 7777 or 9014
- Check what’s using the port:
- Kill the process:
- Change server ports in
dist/game/config/Network.ini:
- Wait for port to be released:
Admin Command Issues
Admin commands not working
Admin commands not working
Symptoms:Source: See Access Levels
- Commands return “You don’t have the access rights to use this command”
- Commands not recognized
- Verify access level:
- Set access level in database:
- Reload character or relog
-
Check
dist/game/config/AccessLevels.xml:
- Verify command exists in
dist/game/config/AdminCommands.xml:
- Check admin command handler is loaded:
Reload command warnings
Reload command warnings
Symptoms:
- “WARNING: There are several known issues regarding this feature”
- Server instability after reload
- Memory leaks
- Inconsistent game state
- Player disconnections
- Cache corruption
//reload html- Generally safe//reload config- Use with caution//reload quest <id>- Safe for single quest
//reload npc- Can cause spawn issues//reload skill- May break active buffs//reload item- Can corrupt inventories
handlers/admincommandhandlers/AdminReload.java:260Player Connection Issues
Players cannot connect to server
Players cannot connect to server
Symptoms:
- “Server is currently unavailable”
- Timeout during connection
- Connection refused errors
- Verify server is running:
- Check firewall rules:
- Verify external IP configuration:
dist/game/config/Network.ini:- Test port accessibility:
- Check NAT/port forwarding:
- Forward port 7777 (game server)
- Forward port 9014 (login server)
- Review connection logs:
Players getting kicked frequently
Players getting kicked frequently
Symptoms:
- Random disconnections
- “Connection lost” errors
- Timeout messages
- Check flood protector settings in
dist/game/config/FloodProtector.ini:
- Increase client timeout in
dist/game/config/Network.ini:
- Monitor server performance:
- Check for network issues:
- Review error logs:
Performance Issues
Server lag and poor performance
Server lag and poor performance
Symptoms:Solutions:
- High latency
- Delayed commands
- Slow NPC responses
- Check server metrics:
- Monitor memory usage:
- Used memory > 80% of max: Increase heap
- Frequent GC: Optimize or add memory
- Check thread count:
-
1000 threads: Possible thread leak
- Investigate recent changes
- Review CPU usage:
- Optimize JVM settings:
- Reduce geodata precision in
dist/game/config/GeoEngine.ini:
- Limit active spawns:
- Review spawn density
- Disable unnecessary NPCs
- Database optimization:
- Enable database connection pooling in
dist/game/config/Database.ini:
Memory leaks
Memory leaks
Symptoms:
- Memory usage continuously increasing
- Server crashes after extended runtime
OutOfMemoryErrorin logs
- Monitor memory over time:
- Take heap dump:
- Analyze with VisualVM or Eclipse MAT
- Improper use of
//reloadcommands - Custom scripts not cleaning up
- Event handlers not deregistered
- Static collections growing unbounded
- Restart server regularly:
- Avoid runtime reloads on production
- Review custom scripts for cleanup
- Increase heap if memory is legitimately needed
Data and Database Issues
Character data corruption
Character data corruption
Symptoms:
- Character cannot login
- Missing items or skills
- Stuck at invalid coordinates
- Use repair command:
- Reset character position:
- Restore from backup:
- Clear invalid items:
Quest not working
Quest not working
Symptoms:
- Quest won’t start
- NPCs not responding
- Quest progression blocked
- Reload specific quest:
- Check quest state:
- Reset quest for player:
- Verify quest script exists:
- Check script errors in logs:
Spawn and NPC Issues
NPCs not spawning
NPCs not spawning
Symptoms:
- Missing NPCs in world
- Empty towns or hunting grounds
- Respawn all NPCs:
- Check spawn data loaded:
- Manually spawn NPC:
- Verify NPC template exists:
- Check spawn tables:
Raid boss not respawning
Raid boss not respawning
Symptoms:
- Raid boss killed but not respawning
- Incorrect respawn time
- Check raid boss status:
- Reset respawn timer:
- Force respawn:
- Reload boss manager:
Olympiad and Siege Issues
Olympiad stuck or not cycling
Olympiad stuck or not cycling
Symptoms:
- Olympiad period not ending
- Heroes not being selected
- Check Olympiad status:
- Manually save Olympiad:
- Force end period and select heroes:
- Check Olympiad configuration in
dist/game/config/Olympiad.ini:
Logging and Debugging
Enable Debug Logging
For development troubleshooting, enable verbose logging:- Locate logging configuration (typically in startup scripts)
- Enable debug mode:
- Review logs:
Common Log Locations
Emergency Procedures
Getting Help
Server Logs
Always include relevant log excerpts when requesting help
L2J Forums
Official community support
GitHub Issues
Report bugs and issues
Discord Community
Real-time community assistance
Prevention Best Practices
- Regular Backups: Automate daily database backups
- Staging Environment: Test changes before production
- Monitor Resources: Set up alerting for memory/CPU
- Update Regularly: Keep server updated with patches
- Document Changes: Maintain changelog of modifications
- Limit Access: Restrict admin permissions appropriately
Related Documentation
Admin Commands
Command reference
Security
Access control
Monitoring
Performance monitoring