Environment
- OS: macOS (aarch64, Apple Silicon)
- CKBadger version: 0.1.0
Problem
During bulk sync, the indexer repeatedly crashes with Too many open files. This causes the bulk sync session to be interrupted, leaving the RocksDB in an incomplete state. On the next startup, the indexer detects the incomplete session and refuses to continue, requiring a full purge and re-sync from genesis.
Error from indexer log
Error: Failed to open CKB RocksDB ... Too many open files
Error: startup fail-fast: detected incomplete bulk build session. bulk sync is single-shot rebuild only; delete RocksDB and re-sync from genesis
Root cause
macOS default file descriptor limit is very low. RocksDB opens many SST files during bulk sync, which likely exceeds this limit.
What I tried
ulimit -n 65535 before ckbadger run — did not reliably fix the issue
sudo launchctl limit maxfiles 65535 200000 — also did not help
ckbadger purge --confirm followed by restart — the indexer eventually stabilized, but it's unclear whether this was a real fix or just luck
No reliable workaround found so far. Leaving this here in case others hit the same issue on macOS.
Suggestion
It may be worth adding macOS-specific notes to the Troubleshooting section, or having ckbadger detect and warn about low fd limits at startup.
Environment
Problem
During bulk sync, the indexer repeatedly crashes with
Too many open files. This causes the bulk sync session to be interrupted, leaving the RocksDB in an incomplete state. On the next startup, the indexer detects the incomplete session and refuses to continue, requiring a full purge and re-sync from genesis.Error from indexer log
Root cause
macOS default file descriptor limit is very low. RocksDB opens many SST files during bulk sync, which likely exceeds this limit.
What I tried
ulimit -n 65535beforeckbadger run— did not reliably fix the issuesudo launchctl limit maxfiles 65535 200000— also did not helpckbadger purge --confirmfollowed by restart — the indexer eventually stabilized, but it's unclear whether this was a real fix or just luckNo reliable workaround found so far. Leaving this here in case others hit the same issue on macOS.
Suggestion
It may be worth adding macOS-specific notes to the Troubleshooting section, or having ckbadger detect and warn about low fd limits at startup.