Troubleshooting
This guide helps you diagnose and resolve common issues when running Clementine.Installation Issues
RISC Zero Installation Fails
Symptom: cargo-risczero installation fails
Symptom: cargo-risczero installation fails
Problem: RISC Zero toolchain fails to install or wrong version is installed.Solution:Verify the installation:
Symptom: xcrun metal errors on macOS
Symptom: xcrun metal errors on macOS
Problem: Metal compiler errors when building on macOS.Solution:Also install Xcode from the App Store if the error persists.
Symptom: Compilation fails on Ubuntu with SSL errors
Symptom: Compilation fails on Ubuntu with SSL errors
Problem: Missing system dependencies on Ubuntu/Debian.Solution:
Runtime Issues
Server Won’t Start
Symptom: Stack overflow errors
Symptom: Stack overflow errors
Problem: Server crashes with stack overflow errors.Solution:
Set the minimum stack size:
Add this to your shell profile (~/.bashrc or ~/.zshrc) to make it permanent.
Symptom: Database connection errors
Symptom: Database connection errors
Problem: Cannot connect to PostgreSQL database.Solution:
-
Verify PostgreSQL is running:
-
Check connection settings in your config file:
-
If using Docker, ensure the container is running:
Symptom: TLS certificate errors
Symptom: TLS certificate errors
Problem: Server fails to start with certificate-related errors.Solution:
-
Generate certificates for testing:
-
Verify certificate paths in config:
-
Ensure certificate files exist and are readable:
Symptom: Bitcoin node connection fails
Symptom: Bitcoin node connection fails
Problem: Cannot connect to Bitcoin node.Solution:
- Verify Bitcoin Core is running (v29.0 or later required)
-
Check RPC credentials in config:
-
Ensure Bitcoin Core RPC is enabled in bitcoin.conf:
RPC Authentication Issues
Symptom: Client certificate verification fails
Symptom: Client certificate verification fails
Problem: RPC calls are rejected with authentication errors.Solution:
Clementine uses mutual TLS (mTLS) for authentication:
-
Verifier/Operator methods can only be called by the aggregator:
- Ensure aggregator is using the correct client certificate
- Path specified in
aggregator_cert_pathin config
-
Internal methods can only be called by the entity’s own certificate:
- Use the entity’s client certificate (
client_cert_path)
- Use the entity’s client certificate (
-
Verify certificate configuration:
The aggregator does not enforce client certificates but does use TLS for encryption.
Testing Issues
Test Failures
Symptom: Tests fail with RISC0 errors
Symptom: Tests fail with RISC0 errors
Problem: Circuit-related tests fail.Solution:
-
Enable dev mode for testing:
-
Optionally download BitVM cache:
Symptom: Unit tests pass but integration tests fail
Symptom: Unit tests pass but integration tests fail
Problem: Integration tests require more setup than unit tests.Solution:
- Ensure PostgreSQL is running
- Ensure Bitcoin node is running (for applicable tests)
-
Check that all environment variables are set:
-
Run integration tests separately:
Performance Issues
Slow Performance
Symptom: Circuit generation is very slow
Symptom: Circuit generation is very slow
Problem: BitVM cache generation takes a long time.Solution:
Download pre-generated cache:
If not downloaded, the cache will be generated automatically on first run, which can take significant time.
Symptom: Database queries are slow
Symptom: Database queries are slow
Problem: PostgreSQL performance degradation.Solution:
-
Increase max connections if needed:
- Monitor database performance
- Consider running migrations if schema is outdated
Debugging
Getting More Information
Enable verbose logging
Enable verbose logging
Increase log verbosity to debug issues:Log levels:
- 1: Errors only
- 2: Warnings
- 3: Info
- 4: Debug
- 5: Trace (everything)
Enable full backtraces
Enable full backtraces
Get detailed error backtraces:
Debug Tokio tasks
Debug Tokio tasks
For debugging async task issues:
-
Uncomment
console-subscriberdependency inCargo.toml -
Uncomment
console_subscriber::init();insrc/utils.rs -
Rebuild with console support:
-
Run your service and access the console:
This provides real-time visibility into Tokio task execution, helping identify deadlocks and performance issues.
Security
Certificate Management
Best practices for TLS certificates
Best practices for TLS certificates
- Never commit private keys to version control
- Use proper CAs in production, not self-signed certificates
- Rotate certificates regularly to minimize exposure
- Use distinct certificates for different services/entities
-
Store certificates securely with appropriate file permissions:
- Monitor certificate expiration and renew before expiry
Common Error Messages
| Error | Possible Cause | Solution |
|---|---|---|
stack overflow | RUST_MIN_STACK not set | export RUST_MIN_STACK=33554432 |
Connection refused (database) | PostgreSQL not running | Start PostgreSQL container |
Connection refused (bitcoin) | Bitcoin node not running | Start Bitcoin Core |
Certificate verify failed | Wrong certificate or missing CA | Check certificate paths and regenerate |
RISC0 proof generation failed | Wrong RISC0 version or mode | Verify version 2.1.0 and set RISC0_DEV_MODE=1 for tests |
BitVM cache not found | Cache not downloaded | Download cache or let it generate |
Authentication failed | mTLS certificate mismatch | Verify client certificate matches expected cert in config |
Getting Help
If you’re still experiencing issues:- Search existing issues: Check GitHub Issues for similar problems
-
Review logs: Run with
--verbose 5to get detailed logs - Check configuration: Verify all paths and settings in your config file
-
Create an issue: If you’ve found a bug, create a new issue with:
- Clementine version
- Operating system
- Full error message and backtrace
- Steps to reproduce
- Configuration (sanitize sensitive data)
- Security issues: For security vulnerabilities, see Security Reporting