Troubleshooting
Common issues and their solutions
Troubleshooting Guide
This section covers common issues and their solutions when developing on Doxa.
Common Errors
Cycle Management
Error: Insufficient Cycles
Symptom: IC0301
error when deploying or calling canisters
Solution:
- Check cycle balance:
dfx canister call my_canister get_cycle_balance
- Transfer cycles:
dfx ledger transfer --amount 0.1 --memo 0 --to <CANISTER_ID>
Authentication
Error: Authentication Failed
Symptom: AUTH004
error when trying to authenticate
Solution:
- Clear browser cache
- Reconnect wallet
- Check NFID permissions
Swap Operations
Error: Slippage Too High
Symptom: SWAP409
error during swap
Solution:
- Adjust slippage tolerance
- Check current market rates
- Try with smaller amount
Development Environment
DFX Issues
DFX Not Starting
Symptom: dfx start
fails
Solution:
- Kill existing processes:
pkill dfx
- Clear cache:
rm -rf .dfx
- Restart DFX:
dfx start --clean
Canister Deployment
Deployment Fails
Symptom: dfx deploy
fails
Solution:
- Check network:
dfx network use local
- Verify canister ID:
dfx canister id my_canister
- Check logs:
dfx canister call my_canister get_logs
Performance Issues
Slow Response Times
Symptom: Canister calls taking too long
Solution:
- Check cycle balance
- Monitor network status
- Optimize code:
// Before
for (i in Iter.range(0, 1000)) {
// expensive operation
};
// After
let batch_size = 100;
for (i in Iter.range(0, 1000, batch_size)) {
// process in batches
};
Debugging Tips
Logging
- Add debug prints:
import Debug "mo:base/Debug";
Debug.print("Debug: " # debug_show(value));
- View logs:
dfx canister call my_canister get_logs
State Inspection
- Check canister state:
public query func get_state() : async Text {
debug_show(state)
};
- View in Candid UI:
dfx canister --network local call my_canister get_state
Getting Help
If you’re still experiencing issues:
- Check our GitHub Issues
- Join our Discord
- Contact support: support@doxa.org