๐ฌ Diagnostic Approach
Before diving into specific fixes, follow this systematic diagnostic process:
- 1. Check the logs โ tail -f /opt/tron-node/logs/tron.log for ERROR or WARNING messages.
- 2. Verify system resources โ CPU, memory, disk space, and network.
- 3. Check sync status โ Compare your node's block height with Tronscan.
- 4. Test API endpoints โ Ensure HTTP and gRPC ports are responsive.
- 5. Review recent changes โ Did you upgrade, change config, or modify the environment?
โณ Sync Issues
Sync problems are the most common issue with TRON full nodes. Here's how to diagnose and fix them.
| Symptom | Likely Cause | Solution |
|---|---|---|
| Node stuck at a specific block | Database corruption or bad peer | Restart node; if persists, restore from snapshot |
| Slow sync (< 10 blocks/min) | Disk I/O bottleneck, low RAM, or HDD | Upgrade to NVMe SSD, increase heap, use RocksDB |
| Frequent peer disconnections | Network issues, firewall, or stale peers | Check firewall, add seed IPs, increase peer limit |
| Sync restarts from genesis | Corrupted database or config change | Restore snapshot or re-sync with clean database |
| Node falls behind after being synced | Resource contention or network lag | Increase JVM heap, check CPU/network usage |
If your node is more than 10,000 blocks behind, the fastest recovery is to restore from a recent snapshot. This takes hours instead of days.
๐ง Memory & OOM Issues
Out-of-memory (OOM) errors are common when the JVM heap is too small or the server has insufficient RAM.
Symptoms
- java.lang.OutOfMemoryError: Java heap space
- Node crashes with exit code 137 (killed by OOM killer).
- Extremely slow sync with frequent GC pauses.
- Swap usage > 0 (indicates memory pressure).
Solutions
- Increase heap size โ For 32 GB servers, use -Xmx20G -Xms20G.
- Switch to G1GC โ -XX:+UseG1GC -XX:MaxGCPauseMillis=200.
- Reduce RocksDB memory โ Lower db.blockCacheSize to 1024 MB.
- Add more RAM โ If your server has < 16 GB, consider upgrading.
Add -Xlog:gc*:file=gc.log:time,uptime:filecount=10,filesize=100M to log GC activity and diagnose memory issues.
๐ Peer & Network Issues
A healthy node needs at least 5โ10 active peers. Common peer issues and fixes:
Ensure port 18888 is open and reachable. Use telnet to test from outside.
Increase maxActiveNodes = 30 and add seed IPs in config.conf.
Restart the node to flush peer cache. Use the /wallet/listnodes API to inspect peers.
Choose peers in the same geographic region. Monitor ping latency to peers.
๐ฅ Database Corruption
Database corruption can occur due to power outages, disk failures, or improper shutdowns. Symptoms include:
- java.lang.IllegalStateException: Could not open database
- Corruption: ... in logs
- Node crashes immediately after startup
- Sync stuck at a specific block
Recovery Steps
sudo systemctl stop tron-node
java -cp FullNode.jar org.rocksdb.tools.DbRecover -db /opt/tron-node/database
Download a fresh snapshot and extract it to the database directory.
sudo systemctl start tron-node
Always shut down the node gracefully with systemctl stop. Use a UPS and RAID for critical nodes. Regular snapshots are your best defense.
๐ Performance Degradation
If your node is running but performing poorly, check these areas:
| Metric | Warning Sign | Fix |
|---|---|---|
| CPU Usage | > 90% sustained | Reduce peer count, lower log level, upgrade CPU |
| Disk I/O | High await time (> 20 ms) | Upgrade to NVMe, reduce compaction threads |
| Network | High retransmission rate | Check firewall, upgrade bandwidth |
| GC Pauses | > 1 second frequently | Increase heap, tune G1GC, use ZGC |
| Block Lag | > 10 blocks | Check all of the above |
๐ Common Error Codes & Messages
| Error Message | Meaning | Solution |
|---|---|---|
| Could not open database | Database corruption or lock issue | Run DbRecover or restore snapshot |
| Out of memory | JVM heap exhausted | Increase -Xmx, tune GC |
| Connection refused | Port not open or node not listening | Check firewall, verify node is running |
| No such peer | Peer disconnected or not reachable | Check network, add more seed IPs |
| Invalid block header | Potential fork or corrupted block | Restart node; if persists, re-sync |
| Too many open files | File descriptor limit too low | Increase ulimit -n to 65536 |
๐ Recovery Playbook: Quick Reference
Wait โ the node will catch up. Check logs for errors. Restart if no progress after 1 hour.
Restart the node. Check peers and network. Increase maxActiveNodes if needed.
Restore from a recent snapshot. This is the fastest recovery method.
Check logs for specific errors. Try DbRecover. If all else fails, re-sync from snapshot.