Skip to main content
This guide covers common issues administrators encounter and provides step-by-step solutions for troubleshooting L2J Mobius Chronicle 4 servers.

Server Startup Issues

Symptoms:
  • Server crashes during startup
  • Error: “Cannot connect to database”
  • Connection timeout errors
Solutions:
  1. Verify database is running:
systemctl status mysql
# or
systemctl status mariadb
  1. Check database credentials in dist/game/config/Database.ini:
Driver = com.mysql.jdbc.Driver
URL = jdbc:mysql://localhost/l2jmobius
Login = root
Password = your_password
  1. Test database connection:
mysql -u root -p -e "SHOW DATABASES;"
  1. Verify database exists:
SHOW DATABASES LIKE 'l2jmobius';
  1. Check firewall rules:
sudo ufw allow 3306/tcp
Ensure database user has proper permissions on the L2J database.
Symptoms:
  • java.lang.OutOfMemoryError: Java heap space
  • Server crashes while loading data
Solutions:
  1. Increase JVM heap size:
java -Xms2G -Xmx4G -jar L2J_Mobius_C4_ScionsOfDestiny.jar
  1. For larger servers, allocate more memory:
java -Xms4G -Xmx8G -XX:+UseG1GC -jar L2J_Mobius_C4_ScionsOfDestiny.jar
  1. Monitor memory usage:
//serverinfo
  1. Check for memory leaks:
  • Review dist/game/log/error.log
  • Look for repetitive object creation
  • Consider profiling with VisualVM
Symptoms:
  • java.net.BindException: Address already in use
  • Cannot bind to port 7777 or 9014
Solutions:
  1. Check what’s using the port:
sudo netstat -tulpn | grep :7777
sudo lsof -i :7777
  1. Kill the process:
sudo kill -9 <PID>
  1. Change server ports in dist/game/config/Network.ini:
GameServerPort = 7777
LoginServerPort = 9014
  1. Wait for port to be released:
# Ports may remain in TIME_WAIT state for up to 2 minutes
watch -n 1 'netstat -an | grep :7777'

Admin Command Issues

Symptoms:
  • Commands return “You don’t have the access rights to use this command”
  • Commands not recognized
Solutions:
  1. Verify access level:
SELECT char_name, accesslevel FROM characters WHERE char_name = 'YourGMName';
  1. Set access level in database:
UPDATE characters SET accesslevel = 70 WHERE char_name = 'YourGMName';
  1. Reload character or relog
  2. Check dist/game/config/AccessLevels.xml:
<access level="70" name="Admin" isGM="true" .../>
  1. Verify command exists in dist/game/config/AdminCommands.xml:
<command name="admin_teleport" accessLevel="30" />
  1. Check admin command handler is loaded:
//reload handler
Source: See Access Levels
Symptoms:
  • “WARNING: There are several known issues regarding this feature”
  • Server instability after reload
Understanding the Issue:Reloading server data at runtime can cause:
  • Memory leaks
  • Inconsistent game state
  • Player disconnections
  • Cache corruption
Best Practices:
Never use //reload commands on live production servers.
Safe reload operations (development only):
  • //reload html - Generally safe
  • //reload config - Use with caution
  • //reload quest <id> - Safe for single quest
Unsafe reload operations:
  • //reload npc - Can cause spawn issues
  • //reload skill - May break active buffs
  • //reload item - Can corrupt inventories
Alternative: Restart server during low-traffic periods.Source: handlers/admincommandhandlers/AdminReload.java:260

Player Connection Issues

Symptoms:
  • “Server is currently unavailable”
  • Timeout during connection
  • Connection refused errors
Solutions:
  1. Verify server is running:
ps aux | grep L2J
netstat -tulpn | grep 7777
  1. Check firewall rules:
sudo ufw status
sudo ufw allow 7777/tcp
sudo ufw allow 9014/tcp
  1. Verify external IP configuration:
In dist/game/config/Network.ini:
ExternalHostname = your.public.ip.address
InternalHostname = 127.0.0.1
  1. Test port accessibility:
telnet your.server.ip 7777
  1. Check NAT/port forwarding:
  • Forward port 7777 (game server)
  • Forward port 9014 (login server)
  1. Review connection logs:
tail -f dist/game/log/java.log | grep "Connection"
Symptoms:
  • Random disconnections
  • “Connection lost” errors
  • Timeout messages
Solutions:
  1. Check flood protector settings in dist/game/config/FloodProtector.ini:
# May be too aggressive
PacketFloodProtector = True
PacketInterval = 100
PacketMaxAttempts = 10
  1. Increase client timeout in dist/game/config/Network.ini:
ClientPacketQueueSize = 20
ClientPacketQueueMaxPacketsPerSecond = 80
ClientPacketQueueMeasureInterval = 5
  1. Monitor server performance:
//serverinfo
  1. Check for network issues:
ping -c 100 your.server.ip
  1. Review error logs:
grep -i "disconnect" dist/game/log/java.log

Performance Issues

Symptoms:
  • High latency
  • Delayed commands
  • Slow NPC responses
Diagnostic Steps:
  1. Check server metrics:
//serverinfo
  1. Monitor memory usage:
  • Used memory > 80% of max: Increase heap
  • Frequent GC: Optimize or add memory
  1. Check thread count:
  • 1000 threads: Possible thread leak
  • Investigate recent changes
  1. Review CPU usage:
top -p $(pgrep -f L2J)
Solutions:
  1. Optimize JVM settings:
java -Xms4G -Xmx8G \
  -XX:+UseG1GC \
  -XX:MaxGCPauseMillis=200 \
  -XX:+DisableExplicitGC \
  -XX:+ParallelRefProcEnabled \
  -jar L2J_Mobius_C4_ScionsOfDestiny.jar
  1. Reduce geodata precision in dist/game/config/GeoEngine.ini:
# Lower value = better performance, less accuracy
PathFinding = 1
  1. Limit active spawns:
  • Review spawn density
  • Disable unnecessary NPCs
  1. Database optimization:
OPTIMIZE TABLE characters;
OPTIMIZE TABLE items;
ANALYZE TABLE characters;
  1. Enable database connection pooling in dist/game/config/Database.ini:
MaximumPoolSize = 10
MinimumIdle = 5
Symptoms:
  • Memory usage continuously increasing
  • Server crashes after extended runtime
  • OutOfMemoryError in logs
Diagnostic:
  1. Monitor memory over time:
watch -n 60 '//serverinfo'
  1. Take heap dump:
jmap -dump:live,format=b,file=heap.bin <PID>
  1. Analyze with VisualVM or Eclipse MAT
Common Causes:
  • Improper use of //reload commands
  • Custom scripts not cleaning up
  • Event handlers not deregistered
  • Static collections growing unbounded
Solutions:
  1. Restart server regularly:
//server_restart 300
  1. Avoid runtime reloads on production
  2. Review custom scripts for cleanup
  3. Increase heap if memory is legitimately needed

Data and Database Issues

Symptoms:
  • Character cannot login
  • Missing items or skills
  • Stuck at invalid coordinates
Solutions:
  1. Use repair command:
//repairchar <character_name>
  1. Reset character position:
UPDATE characters 
SET x=83400, y=147943, z=-3404 
WHERE char_name='StuckPlayer';
  1. Restore from backup:
mysql -u root -p l2jmobius < backup_YYYYMMDD.sql
  1. Clear invalid items:
DELETE FROM items WHERE item_id NOT IN (SELECT item_id FROM item_templates);
Always backup database before making manual changes.
Symptoms:
  • Quest won’t start
  • NPCs not responding
  • Quest progression blocked
Solutions:
  1. Reload specific quest:
//reload quest <quest_id>
# or
//reload quest <quest_name>
  1. Check quest state:
SELECT * FROM character_quests WHERE char_id = <char_id>;
  1. Reset quest for player:
DELETE FROM character_quests 
WHERE char_id = <char_id> AND quest_name = 'Q00255_Tutorial';
  1. Verify quest script exists:
ls dist/game/data/scripts/quests/Q00255_Tutorial/
  1. Check script errors in logs:
grep -i "quest" dist/game/log/error.log

Spawn and NPC Issues

Symptoms:
  • Missing NPCs in world
  • Empty towns or hunting grounds
Solutions:
  1. Respawn all NPCs:
//respawnall
  1. Check spawn data loaded:
grep -i "spawn" dist/game/log/java.log
  1. Manually spawn NPC:
//spawn <npc_id>
  1. Verify NPC template exists:
//reload npc
  1. Check spawn tables:
SELECT * FROM spawnlist WHERE npc_id = 30001;
Symptoms:
  • Raid boss killed but not respawning
  • Incorrect respawn time
Solutions:
  1. Check raid boss status:
SELECT * FROM grandboss_data WHERE boss_id = <boss_id>;
SELECT * FROM raidboss_spawnlist WHERE boss_id = <boss_id>;
  1. Reset respawn timer:
UPDATE grandboss_data 
SET respawn_time = 0 
WHERE boss_id = <boss_id>;
  1. Force respawn:
//grandboss <boss_id>
  1. Reload boss manager:
//reload handler

Olympiad and Siege Issues

Symptoms:
  • Olympiad period not ending
  • Heroes not being selected
Solutions:
  1. Check Olympiad status:
//checkolympiad
  1. Manually save Olympiad:
//saveolymp
  1. Force end period and select heroes:
//endolympiad
//endolympiad immediately cycles the Olympiad. Use only when period is truly stuck.
  1. Check Olympiad configuration in dist/game/config/Olympiad.ini:
AltOlyPeriod = 2592000000
AltOlyWeeklyPeriod = 604800000

Logging and Debugging

Enable Debug Logging

For development troubleshooting, enable verbose logging:
  1. Locate logging configuration (typically in startup scripts)
  2. Enable debug mode:
java -Ddebug=true -jar L2J_Mobius_C4_ScionsOfDestiny.jar
  1. Review logs:
tail -f dist/game/log/java.log
tail -f dist/game/log/error.log

Common Log Locations

dist/game/log/
├── java.log          # General server log
├── error.log         # Error messages
├── chat.log          # Chat messages
├── items.log         # Item transactions
└── audit.log         # GM actions

Emergency Procedures

Server Crash Recovery
  1. Stop any running instances:
    pkill -f L2J
    
  2. Check database integrity:
    mysqlcheck -u root -p --auto-repair l2jmobius
    
  3. Review crash logs:
    less dist/game/log/error.log
    
  4. Restore from backup if needed:
    mysql -u root -p l2jmobius < backup.sql
    
  5. Start server with increased logging:
    java -Xmx4G -jar L2J_Mobius_C4_ScionsOfDestiny.jar > startup.log 2>&1
    

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

  1. Regular Backups: Automate daily database backups
  2. Staging Environment: Test changes before production
  3. Monitor Resources: Set up alerting for memory/CPU
  4. Update Regularly: Keep server updated with patches
  5. Document Changes: Maintain changelog of modifications
  6. Limit Access: Restrict admin permissions appropriately

Admin Commands

Command reference

Security

Access control

Monitoring

Performance monitoring

Build docs developers (and LLMs) love