clawchain/docs/troubleshooting-guide.md
2026-05-15 19:18:10 +03:00

976 lines
33 KiB
Markdown

# ClawChain Troubleshooting Guide
This guide covers common issues operators and developers encounter when running a ClawChain node, interacting with the agent and privacy modules, using the marketplace, and managing wallets. Each section follows a **Problem** / **Cause** / **Solution** format with example commands.
---
## Table of Contents
1. [Node Won't Start / Sync Issues](#1-node-wont-start--sync-issues)
2. [Agent Registration Failures](#2-agent-registration-failures)
3. [Transaction Errors](#3-transaction-errors)
4. [Privacy Module Errors](#4-privacy-module-errors)
5. [Marketplace Errors](#5-marketplace-errors)
6. [Network Connectivity Issues](#6-network-connectivity-issues)
7. [Wallet / Key Management Issues](#7-wallet--key-management-issues)
8. [Using clawd doctor and clawd readiness for Diagnostics](#8-using-clawd-doctor-and-clawd-readiness-for-diagnostics)
9. [Common Error Codes and Their Solutions](#9-common-error-codes-and-their-solutions)
---
## 1. Node Won't Start / Sync Issues
### 1.1 Chain RPC is unreachable
**Problem:** `clawd doctor` reports `[FAIL] Chain RPC` and the node does not respond on port 26657.
**Cause:** The `clawchaind` process is not running, crashed, or is bound to a different address/port.
**Solution:**
```bash
# Check if the process is running
ps aux | grep clawchaind
# Start (or restart) the chain daemon
sudo systemctl restart clawchaind
# Monitor logs for startup errors
journalctl -u clawchaind -f --no-pager
# If the process is stuck (zombie/deadlock), force-kill and restart
sudo pkill -9 -x clawchaind && sleep 3 && sudo systemctl start clawchaind
```
### 1.2 Genesis file missing or checksum mismatch
**Problem:** `clawd doctor` reports `[FAIL] Genesis file: missing at ~/.clawchain/config/genesis.json` or `[FAIL] Genesis checksum: mismatch`.
**Cause:** The node was initialized without the correct genesis file, or the file was corrupted or replaced.
**Solution:**
```bash
# Re-join the network with the correct manifest (downloads verified genesis)
clawd join --from-manifest <manifest-url-or-path>
# Verify the genesis checksum manually
sha256sum ~/.clawchain/config/genesis.json
```
### 1.3 Node is syncing / catching up
**Problem:** Transactions fail with timeout or the node reports `catching_up=true`.
**Cause:** The node has not finished syncing to the latest block height. This is normal after first start or a long period offline.
**Solution:**
```bash
# Check sync status
clawd status
# Or query the RPC directly
curl -s http://localhost:26657/status | jq '.result.sync_info'
# Wait for catching_up to become false before submitting transactions
```
### 1.4 Chain ID mismatch
**Problem:** `clawd doctor` reports `chain_id mismatch expected=clawchain-1 got=<other>`.
**Cause:** The node is running with a different chain ID than what is configured in `~/.clawd/clawd.json`.
**Solution:**
```bash
# Verify the configured chain ID
cat ~/.clawd/clawd.json | jq '.chainId'
# Re-initialize with the correct chain by re-joining
clawd join --from-manifest <manifest-url-or-path>
```
### 1.5 REST/LCD endpoint unreachable
**Problem:** `clawd doctor` reports `[FAIL] Chain REST`.
**Cause:** The REST API server (port 1317 by default) is disabled or misconfigured in `app.toml`.
**Solution:**
```bash
# Enable the API in app.toml
# Edit ~/.clawchain/config/app.toml and set:
# [api]
# enable = true
# address = "tcp://0.0.0.0:1317"
# Restart the node
sudo systemctl restart clawchaind
# Verify
clawd status
```
---
## 2. Agent Registration Failures
### 2.1 Agent already registered (error 1101)
**Problem:** `MsgRegisterAgent` fails with `agent already registered`.
**Cause:** The address has already been registered as an agent. Each address can only register once.
**Solution:**
```bash
# Query existing agent info
clawchaind query agent agent <your-address> --node http://localhost:26657
# If you need to update agent metadata, use the update message instead
# If you need to re-register, deregister first (only if no active tasks)
clawchaind tx agent deregister-agent --from <key-name> --gas auto --gas-adjustment 1.5
```
### 2.2 Insufficient deposit (error 1124)
**Problem:** `MsgRegisterAgent` fails with `insufficient deposit`.
**Cause:** The account does not hold enough `uclaw` to cover the governance-required minimum agent deposit.
**Solution:**
```bash
# Check your balance
clawchaind query bank balances <your-address>
# Check the required deposit amount
clawchaind query agent params
# Request tokens from the faucet (testnet only)
clawd faucet request --from <faucet-url>
# Retry registration with sufficient funds
clawchaind tx agent register-agent \
--name "my-agent" \
--pubkey "<pubkey>" \
--from <key-name> \
--gas auto --gas-adjustment 1.5
```
### 2.3 Invalid agent name (error 1105) or invalid pubkey (error 1106)
**Problem:** Registration fails with `invalid agent name` or `invalid pubkey`.
**Cause:** The `name` field is empty or the `pubkey` field is empty/malformed.
**Solution:**
```bash
# Ensure both fields are provided and non-empty
clawchaind tx agent register-agent \
--name "my-agent" \
--pubkey "$(clawchaind tendermint show-validator)" \
--from <key-name> \
--gas auto --gas-adjustment 1.5
```
### 2.4 Agent has active tasks and cannot deregister (error 1125)
**Problem:** `MsgDeregisterAgent` fails with `agent has active tasks and cannot deregister`.
**Cause:** The agent still has accepted/pending tasks that must be completed or reassigned before deregistration.
**Solution:**
```bash
# List your active tasks
clawchaind query agent tasks-by-assignee <your-address>
# Complete or delegate each task before attempting to deregister
clawchaind tx agent complete-task <task-id> --result '{}' --from <key-name> --gas auto
```
### 2.5 Agent inactive due to stale heartbeat (error 1114)
**Problem:** Agent actions fail with `agent is inactive (deactivated due to stale heartbeat)`.
**Cause:** The agent has not sent a heartbeat within the required interval and has been marked inactive.
**Solution:**
```bash
# Send a heartbeat to reactivate
clawchaind tx agent agent-heartbeat --from <key-name> --gas auto --gas-adjustment 1.5
# Verify liveness
clawd readiness --json | jq '.checks[] | select(.name == "Agent heartbeat/liveness")'
# Configure automatic heartbeats by running the clawd daemon
clawd start
```
---
## 3. Transaction Errors
### 3.1 Insufficient gas
**Problem:** Transaction fails with `out of gas` or `insufficient fees`.
**Cause:** The gas limit was set too low, or the gas price does not meet the minimum.
**Solution:**
```bash
# Use auto gas estimation with a safety margin
clawchaind tx agent register-agent \
--name "my-agent" --pubkey "<pubkey>" \
--from <key-name> \
--gas auto --gas-adjustment 1.5 \
--gas-prices 0.025uclaw
# Simulate to see gas estimate without broadcasting
clawchaind tx agent register-agent \
--name "my-agent" --pubkey "<pubkey>" \
--from <key-name> \
--dry-run
```
### 3.2 Account not found
**Problem:** Transaction fails with `account not found` or `unknown address`.
**Cause:** The account has never received tokens and does not exist on-chain yet.
**Solution:**
```bash
# Fund the account first (testnet)
clawd faucet request --from <faucet-url>
# Or send tokens from an existing account
clawchaind tx bank send <funded-address> <new-address> 1000000uclaw \
--from <funded-key-name> --gas auto --gas-prices 0.025uclaw
# Verify the account exists
clawchaind query auth account <your-address>
```
### 3.3 Account sequence mismatch
**Problem:** Transaction fails with `account sequence mismatch, expected X, got Y`.
**Cause:** Multiple transactions were submitted concurrently or a previous transaction was not yet committed, causing the sequence (nonce) to be out of sync.
**Solution:**
```bash
# Query the current sequence number
clawchaind query auth account <your-address> | grep sequence
# Explicitly set the correct sequence
clawchaind tx bank send <from> <to> 1000uclaw \
--from <key-name> \
--sequence <correct-sequence> \
--gas auto --gas-prices 0.025uclaw
# Or wait for pending transactions to commit and retry
sleep 6 && clawchaind tx bank send <from> <to> 1000uclaw \
--from <key-name> --gas auto --gas-prices 0.025uclaw
```
### 3.4 Rate limit exceeded (agent error 1121, privacy error 1114)
**Problem:** Transaction rejected with `agent action rate limit exceeded` or `privacy transaction rate limit exceeded for this block`.
**Cause:** Too many transactions of this type were submitted in the current block. The chain enforces per-block rate limits.
**Solution:**
```bash
# Wait for the next block and retry
sleep 6 && clawchaind tx agent agent-action \
--action-type <type> --payload '{}' \
--from <key-name> --gas auto
# Check current block height to confirm a new block has been produced
curl -s http://localhost:26657/status | jq '.result.sync_info.latest_block_height'
```
---
## 4. Privacy Module Errors
### 4.1 Invalid zero-knowledge proof (error 1103)
**Problem:** `MsgPrivateTransfer` or `MsgUnshield` fails with `zero-knowledge proof verification failed`.
**Cause:** The Groth16 proof is invalid. This can happen if the proof was generated with incorrect inputs, the wrong proving key, or data was corrupted during serialization.
**Solution:**
```bash
# Verify you are using the correct proving/verifying key pair
ls -la ~/.clawchain/config/keys/
# Regenerate the proof with the correct inputs:
# - Correct Merkle root (must match a known on-chain root)
# - Correct nullifiers derived from the original commitment
# - Correct blinding factors
clawproof generate-transfer \
--amount <amount> \
--blinding <hex> \
--merkle-path <path-json> \
--root <root-hex>
# Ensure the transfer verifying key is initialized on the node
clawchaind query privacy params
```
### 4.2 Nullifier already used / double-spend (error 1101)
**Problem:** Transaction fails with `nullifier has already been used (double-spend)`.
**Cause:** The nullifier was already consumed in a previous private transfer. Each shielded note can only be spent once.
**Solution:**
```bash
# Check if the nullifier is already spent
clawchaind query privacy nullifier-exists <nullifier-hex>
# If spent, you cannot reuse this note. Use a different unspent commitment.
# List your available commitments and their leaf indices to find unspent notes.
```
### 4.3 Merkle root not recognized (error 1102)
**Problem:** Transaction fails with `merkle root is not recognized`.
**Cause:** The Merkle root used in the proof does not match any root in the on-chain history. This happens when a new commitment was added after you generated the proof, and the old root has been evicted from the history window.
**Solution:**
```bash
# Query the current Merkle root
clawchaind query privacy tree-stats
# Query the root history to see valid roots
clawchaind query privacy root-history
# Regenerate the proof using a current valid root and updated Merkle path
clawchaind query privacy merkle-proof <leaf-index>
```
### 4.4 Insufficient funds for shielding (error 1104)
**Problem:** `MsgShield` fails with `insufficient funds for shielding`.
**Cause:** The sender account does not have enough tokens to cover the shield amount.
**Solution:**
```bash
# Check balance
clawchaind query bank balances <your-address>
# Ensure you have at least the shield amount in the correct denomination
# Default denomination is "uclaw"
clawchaind tx privacy shield \
--amount 1000 --coins uclaw \
--blinding <32-random-bytes-hex> \
--from <key-name> --gas auto --gas-prices 0.025uclaw
```
### 4.5 Invalid blinding factor (error 1113)
**Problem:** Shield transaction fails with `blinding factor is required` or `blinding must be exactly 32 bytes`.
**Cause:** The blinding field is missing or not exactly 32 bytes. The blinding factor must be generated client-side using a cryptographically secure random number generator (CSPRNG).
**Solution:**
```bash
# Generate a 32-byte random blinding factor
BLINDING=$(openssl rand -hex 32)
# Use it in the shield transaction
clawchaind tx privacy shield \
--amount 1000 --coins uclaw \
--blinding "$BLINDING" \
--from <key-name> --gas auto --gas-prices 0.025uclaw
```
### 4.6 Merkle tree is full (error 1106)
**Problem:** Shield transaction fails with `merkle tree is full`.
**Cause:** The on-chain Merkle tree has reached its maximum capacity. No more commitments can be added.
**Solution:** This is a chain-level limitation. A governance proposal may be needed to deploy a new tree or increase tree depth. Contact the network operators.
### 4.7 Failed to deserialize proof (error 1108)
**Problem:** Transaction fails with `failed to deserialize proof`.
**Cause:** The proof bytes are not valid hex or do not represent a valid Groth16 proof structure.
**Solution:**
```bash
# Verify the proof is valid hex
echo "<proof-hex>" | xxd -r -p > /dev/null 2>&1 && echo "Valid hex" || echo "Invalid hex"
# Ensure you are hex-encoding the raw proof bytes (not base64 or other encoding)
# Regenerate the proof if necessary
```
---
## 5. Marketplace Errors
### 5.1 Skill not found (error 1202)
**Problem:** Operation fails with `skill not found`.
**Cause:** The skill ID does not exist in the marketplace registry.
**Solution:**
```bash
# List available skills
clawchaind query marketplace skills
# Verify the skill ID before referencing it
clawchaind query marketplace skill <skill-id>
```
### 5.2 Escrow not found or not active (errors 1211, 1214)
**Problem:** Escrow operation fails with `escrow not found` or `escrow is not active`.
**Cause:** The escrow ID is invalid, or the escrow has already been completed, cancelled, or expired.
**Solution:**
```bash
# Query escrow status
clawchaind query marketplace escrow <escrow-id>
# If the escrow has expired, create a new one with a longer deadline
# If the escrow was already completed, no further action is possible
```
### 5.3 Escrow has expired (error 1215)
**Problem:** Milestone completion or release fails with `escrow has expired`.
**Cause:** The escrow deadline has passed. Funds must be handled through the dispute/refund process.
**Solution:**
```bash
# Check the escrow deadline
clawchaind query marketplace escrow <escrow-id>
# Open a dispute to resolve fund distribution
clawchaind tx marketplace open-dispute <escrow-id> \
--reason "deadline passed, work partially complete" \
--from <key-name> --gas auto
```
### 5.4 Dispute already open (error 1219)
**Problem:** `open-dispute` fails with `dispute already open`.
**Cause:** A dispute has already been filed for this escrow.
**Solution:**
```bash
# Query the existing dispute
clawchaind query marketplace dispute <escrow-id>
# Wait for resolution or provide evidence to the existing dispute
```
### 5.5 Not an escrow party (error 1213)
**Problem:** Escrow operation fails with `not an escrow party`.
**Cause:** The transaction sender is neither the buyer nor the seller in this escrow.
**Solution:**
```bash
# Verify the escrow parties
clawchaind query marketplace escrow <escrow-id>
# Ensure you are signing with the correct key
clawchaind keys list
```
### 5.6 Invalid dispute resolution target (error 1220)
**Problem:** Dispute resolution fails with `invalid dispute resolution target`.
**Cause:** The resolution specifies an invalid fund distribution target (must be one of the escrow parties).
**Solution:** Ensure the resolution target address matches either the buyer or seller in the escrow.
### 5.7 Insufficient funds to purchase skill (error 1210)
**Problem:** Skill purchase fails with `insufficient funds to purchase skill`.
**Cause:** The buyer's account does not hold enough tokens to cover the skill price.
**Solution:**
```bash
# Check your balance and the skill price
clawchaind query bank balances <your-address>
clawchaind query marketplace skill <skill-id>
# Fund your account before purchasing
```
### 5.8 GPU compute resource errors (errors 1230-1252)
**Problem:** GPU lease or compute job operations fail.
**Cause:** Common issues include: resource not found (1230), resource inactive (1231), resource already leased (1232), invalid lease duration (1233), or invalid GPU spec (1239).
**Solution:**
```bash
# List available compute resources
clawchaind query marketplace compute-resources
# Check a specific resource status
clawchaind query marketplace compute-resource <resource-id>
# Check active lease status
clawchaind query marketplace lease <lease-id>
# Ensure endpoint is not empty when registering a resource
clawchaind tx marketplace register-compute \
--gpu-spec "NVIDIA A100 80GB" \
--endpoint "https://my-gpu-node.example.com:8443" \
--from <key-name> --gas auto
```
---
## 6. Network Connectivity Issues
### 6.1 Zero connected peers
**Problem:** `clawd doctor` reports `[FAIL] Peer connectivity: 0 connected peers (seeds configured; check networking/firewall)`.
**Cause:** The node cannot reach seed or persistent peers. Common causes: firewall rules blocking port 26656, incorrect seed addresses, or NAT traversal issues.
**Solution:**
```bash
# Check current peer count
curl -s http://localhost:26657/net_info | jq '.result.n_peers'
# Auto-maintain peers from manifest
clawd peers auto-maintain --from-manifest <manifest-url-or-path>
# Manually inject seed peers
clawchaind config set config p2p.seeds '<node-id>@<ip>:26656' --home ~/.clawchain
sudo systemctl restart clawchaind
# Add persistent peers for guaranteed connections
clawchaind config set config p2p.persistent_peers '<node-id>@<ip>:26656' --home ~/.clawchain
sudo systemctl restart clawchaind
# Check firewall (port 26656 must be open for inbound/outbound)
sudo ufw status
sudo ufw allow 26656/tcp
```
### 6.2 Seed nodes unreachable
**Problem:** Node logs show repeated dial failures to seed addresses.
**Cause:** The configured seed nodes are offline, the addresses are stale, or DNS resolution fails.
**Solution:**
```bash
# Verify seed addresses from the network manifest
clawd peers sync-manifest --from-manifest <manifest-url-or-path>
# Test connectivity to a seed node manually
nc -zv <seed-ip> 26656
# Update seeds in the clawd config and node config
# Edit ~/.clawd/clawd.json: "seeds": "<node-id>@<ip>:26656"
# Then restart
sudo systemctl restart clawchaind
```
### 6.3 Gateway unreachable
**Problem:** `clawd doctor` reports `[FAIL] Gateway: not reachable on :18789 or :3000`.
**Cause:** The OpenClaw gateway process is not running.
**Solution:**
```bash
# Start the gateway via clawd
clawd up --require-ready
# Or check if the OPENCLAW_GATEWAY_URL env variable is set correctly
echo $OPENCLAW_GATEWAY_URL
# Verify gateway process
ps aux | grep openclaw
```
### 6.4 Messaging endpoint unreachable
**Problem:** `clawd readiness` reports `[FAIL] Messaging endpoint`.
**Cause:** The agent messaging server is not running, the port is blocked, or `messagingEndpoint` is not configured in `~/.clawd/clawd.json`.
**Solution:**
```bash
# Set the messaging endpoint during join
clawd join --host <your-public-host>
# Ensure the messaging port (default 7777) is open
sudo ufw allow 7777/tcp
# Verify the configuration
cat ~/.clawd/clawd.json | jq '.messagingEndpoint'
# Test the endpoint
curl -s http://<your-host>:7777/agent/health
```
---
## 7. Wallet / Key Management Issues
### 7.1 Key not found
**Problem:** Transaction fails with `key not found` when using `--from <key-name>`.
**Cause:** The key name does not exist in the local keyring.
**Solution:**
```bash
# List available keys
clawchaind keys list
# Add a key (creates new mnemonic)
clawchaind keys add <key-name>
# Recover a key from mnemonic
clawchaind keys add <key-name> --recover
```
### 7.2 Keyring backend errors
**Problem:** `failed to open keyring` or keyring password prompts hang in automated scripts.
**Cause:** The keyring backend is set to `os` (system keychain) which may not work in headless/CI environments.
**Solution:**
```bash
# Use the test backend for development (NOT for production)
clawchaind keys list --keyring-backend test
# Or set it globally in client.toml
# Edit ~/.clawchain/config/client.toml:
# keyring-backend = "test"
# For production, use "file" backend with password via env var
export CLAWCHAIND_KEYRING_PASSWORD="<password>"
clawchaind keys list --keyring-backend file
```
### 7.3 Mnemonic file missing or corrupted
**Problem:** `clawd` commands fail referencing `~/.clawd/mnemonic.enc`.
**Cause:** The encrypted mnemonic file was deleted or corrupted.
**Solution:**
```bash
# Check if the file exists
ls -la ~/.clawd/mnemonic.enc
# Re-initialize identity
clawd init --skip-setup
# Or recover from your backed-up mnemonic phrase
```
### 7.4 Address mismatch between clawd config and keyring
**Problem:** `clawd readiness` shows `agentAddress is missing in clawd config` or the configured address does not match any local key.
**Cause:** The `agentAddress` in `~/.clawd/clawd.json` was never set or does not correspond to a key in the keyring.
**Solution:**
```bash
# Check the configured agent address
cat ~/.clawd/clawd.json | jq '.agentAddress'
# List keys and find the correct address
clawchaind keys show <key-name> -a
# Update the config if needed (or re-run clawd init)
clawd init --skip-setup
```
---
## 8. Using `clawd doctor` and `clawd readiness` for Diagnostics
### 8.1 clawd doctor
`clawd doctor` is the primary operator diagnostic tool. It checks:
| Check | What it verifies | Critical? |
|---|---|---|
| **Chain RPC** | Node is reachable on RPC port (26657); chain ID matches | Yes |
| **Chain REST** | REST/LCD API reachable on port 1317 | Yes |
| **Peer connectivity** | At least one peer is connected via `net_info` | No |
| **Gateway** | OpenClaw gateway is reachable on :18789 or :3000 | Yes |
| **Faucet** | Faucet endpoint responds (if configured) | No |
| **Messaging endpoint** | Agent messaging server health endpoint responds | No |
| **On-chain agent capabilities** | Agent is registered with valid `supported_tools`, `pricing_hint`, `version` | No |
| **Genesis checksum** | Genesis file exists and SHA256 matches expected value | No |
| **Incident mode** | Not currently in incident/degraded mode | No |
| **Integrated readiness** | All runtime + chain gates pass | No |
**Usage:**
```bash
# Human-readable output
clawd doctor
# Machine-readable JSON (good for CI/monitoring)
clawd doctor --json
# Exit code: 0 if all critical checks pass, 1 otherwise
clawd doctor --json; echo "Exit code: $?"
```
The doctor command also evaluates the **startup lifecycle** stages in order:
1. **identity_init** -- `agentAddress` is present in config
2. **chain_connect** -- Chain RPC and REST are both reachable
3. **register** -- Agent is registered on-chain
4. **heartbeat** -- Agent has sent at least one heartbeat
5. **messaging** -- Messaging endpoint is reachable
Each failing stage includes a **repair hint** with the exact command to run.
### 8.2 clawd readiness
`clawd readiness` is a strict pass/fail check that evaluates whether the node is fully operational. Every check is marked as either `required` or `advisory`.
**Required checks (all must pass for readiness):**
- Chain RPC reachable with correct chain ID
- Chain REST reachable
- OpenClaw gateway reachable
- On-chain agent identity registered
- Agent heartbeat/liveness active
- Messaging endpoint reachable
- Peer connectivity (at least 1 peer)
**Usage:**
```bash
# Human-readable output
clawd readiness
# JSON output for automation
clawd readiness --json
# Use in scripts
if clawd readiness --json > /dev/null 2>&1; then
echo "Node is ready"
else
echo "Node is NOT ready"
clawd readiness --json | jq '.blockers'
fi
```
### 8.3 clawd status
`clawd status` provides a quick overview of:
- Chain node health (height, sync state, moniker, network)
- Connected peers (count and first 10 peer details)
- Gateway health
- Configuration summary (chain ID, node home, agent address, seeds, incident mode)
```bash
clawd status
```
### 8.4 Incident mode
If the node enters a degraded state, incident mode can be used to safely isolate and recover:
```bash
# Enter incident mode (halts operations)
clawd incident enter --reason "investigating stuck consensus"
# Exit incident mode (resumes operations)
clawd incident exit
# Exit without restoring previous peer config (if peer state is corrupted)
clawd incident exit --no-restore-peers
clawd peers sync-manifest --from-manifest <manifest-url-or-path>
```
---
## 9. Common Error Codes and Their Solutions
### Agent Module (`x/agent`) -- Error Codes 1100-1132
| Code | Error | Description | Solution |
|------|-------|-------------|----------|
| 1100 | `ErrInvalidSigner` | Expected governance account as signer | Use a governance proposal for param changes |
| 1101 | `ErrAgentAlreadyExists` | Address already registered | Query existing agent; use update or deregister first |
| 1102 | `ErrAgentNotFound` | Agent address not in registry | Register the agent first with `MsgRegisterAgent` |
| 1103 | `ErrUnsupportedAction` | Action type not recognized | Check supported action types in module params |
| 1104 | `ErrInvalidAddress` | Malformed bech32 address | Verify address format (must start with `claw1`) |
| 1105 | `ErrInvalidAgentName` | Agent name is empty | Provide a non-empty `--name` value |
| 1106 | `ErrInvalidPubkey` | Pubkey is empty or malformed | Provide a valid pubkey via `--pubkey` |
| 1107 | `ErrIntentNotFound` | Intent ID does not exist | Verify intent ID before responding |
| 1108 | `ErrIntentNotPending` | Intent is no longer pending | Intent was already finalized or expired |
| 1109 | `ErrIntentAlreadyResponded` | Agent already responded to this intent | Each agent can only respond once per intent |
| 1110 | `ErrNotIntentCreator` | Only creator can finalize intent | Sign with the intent creator's key |
| 1111 | `ErrUnsupportedIntentType` | Intent type not recognized | Check supported intent types |
| 1112 | `ErrInvalidIntentPayload` | Intent payload is malformed | Validate JSON payload before submission |
| 1113 | `ErrSelfResponse` | Creator cannot respond to own intent | Use a different agent address |
| 1114 | `ErrAgentInactive` | Stale heartbeat deactivated agent | Send a heartbeat: `clawchaind tx agent agent-heartbeat` |
| 1115 | `ErrTaskNotFound` | Task ID does not exist | Verify task ID |
| 1116 | `ErrNotAssignee` | Only assignee can act on task | Sign with the assigned agent's key |
| 1117 | `ErrTaskNotPending` | Task is not in pending status | Task was already accepted or completed |
| 1118 | `ErrTaskNotAccepted` | Task must be accepted first | Accept the task before completing it |
| 1119 | `ErrSelfDelegation` | Cannot delegate task to yourself | Choose a different agent for delegation |
| 1120 | `ErrInvalidBudget` | Budget amount is invalid | Provide a positive integer budget in uclaw |
| 1121 | `ErrRateLimitExceeded` | Too many actions per block | Wait for the next block and retry |
| 1122 | `ErrHeartbeatTooFrequent` | Heartbeat interval too short | Wait for the minimum interval before next heartbeat |
| 1123 | `ErrPayloadTooLarge` | Payload exceeds `max_payload_bytes` | Reduce payload size; check module params for limit |
| 1124 | `ErrInsufficientDeposit` | Not enough funds for deposit | Fund account and retry |
| 1125 | `ErrAgentHasActiveTasks` | Active tasks block deregistration | Complete or delegate active tasks first |
| 1126 | `ErrNegotiationNotFound` | Negotiation ID does not exist | Verify negotiation ID |
| 1127 | `ErrNegotiationNotActive` | Negotiation is no longer active | Negotiation was settled or cancelled |
| 1128 | `ErrNotNegotiationParty` | Not a party to this negotiation | Sign with a participating agent's key |
| 1129 | `ErrNotCounterparty` | Only counterparty can respond | Wait for the other party to act |
| 1130 | `ErrNegotiationMaxRounds` | Max negotiation rounds reached | Settle or cancel the negotiation |
| 1131 | `ErrSelfNegotiation` | Cannot negotiate with yourself | Choose a different counterparty |
| 1132 | `ErrInsufficientReputation` | Reputation too low for task tier | Build reputation with simpler tasks first |
### Privacy Module (`x/privacy`) -- Error Codes 1100-1114
| Code | Error | Description | Solution |
|------|-------|-------------|----------|
| 1100 | `ErrInvalidSigner` | Expected governance account | Use a governance proposal for param changes |
| 1101 | `ErrNullifierAlreadyUsed` | Double-spend attempt | Use a different unspent commitment |
| 1102 | `ErrInvalidMerkleRoot` | Root not in history | Regenerate proof with a current root |
| 1103 | `ErrInvalidProof` | ZK proof verification failed | Regenerate proof with correct inputs and keys |
| 1104 | `ErrInsufficientFunds` | Not enough tokens to shield | Fund account before shielding |
| 1105 | `ErrInvalidCommitment` | Commitment data is malformed | Verify commitment hex encoding |
| 1106 | `ErrMerkleTreeFull` | Tree has reached max capacity | Contact network operators; governance action needed |
| 1107 | `ErrInvalidAmount` | Amount is zero or negative | Provide a positive amount |
| 1108 | `ErrDeserializeProof` | Proof bytes are not valid | Ensure proof is hex-encoded Groth16 format |
| 1109 | `ErrInvalidAddress` | Malformed bech32 address | Verify address format |
| 1110 | `ErrViewKeyAlreadyExists` | View key already registered | Each commitment can only have one view key |
| 1111 | `ErrViewKeyNotFound` | View key not registered | Register a view key first |
| 1112 | `ErrInvalidViewKeyProof` | View key proof failed | Regenerate view key proof |
| 1113 | `ErrInvalidBlinding` | Blinding factor invalid | Use 32 bytes from a CSPRNG |
| 1114 | `ErrRateLimitExceeded` | Per-block privacy tx limit hit | Wait for the next block and retry |
### Marketplace Module (`x/marketplace`) -- Error Codes 1200-1252
| Code | Error | Description | Solution |
|------|-------|-------------|----------|
| 1200 | `ErrInvalidSigner` | Expected governance account | Use a governance proposal |
| 1201 | `ErrInvalidAddress` | Malformed address | Verify bech32 format |
| 1202 | `ErrSkillNotFound` | Skill does not exist | Query available skills first |
| 1203 | `ErrNotSkillOwner` | Not the skill owner | Sign with the owner's key |
| 1204 | `ErrSkillInactive` | Skill is deactivated | Reactivate skill before operations |
| 1205 | `ErrSelfPurchase` | Cannot buy your own skill | Use a different account |
| 1206 | `ErrEmptyName` | Skill name is empty | Provide a non-empty name |
| 1207 | `ErrEmptyDescription` | Skill description is empty | Provide a non-empty description |
| 1208 | `ErrInvalidPrice` | Skill price is invalid | Set a positive price in uclaw |
| 1209 | `ErrTooManySkills` | Max skills per agent reached | Remove unused skills before adding new ones |
| 1210 | `ErrInsufficientFunds` | Not enough tokens to purchase | Fund your account |
| 1211 | `ErrEscrowNotFound` | Escrow does not exist | Verify escrow ID |
| 1212 | `ErrDisputeNotFound` | Dispute does not exist | Verify escrow/dispute ID |
| 1213 | `ErrNotEscrowParty` | Not buyer or seller | Sign with the correct key |
| 1214 | `ErrEscrowNotActive` | Escrow is closed | Create a new escrow |
| 1215 | `ErrEscrowExpired` | Deadline has passed | Open a dispute for resolution |
| 1216 | `ErrInvalidDeadline` | Deadline is in the past | Set a future block height or timestamp |
| 1217 | `ErrInvalidMilestones` | Milestone config is invalid | Provide valid milestone definitions |
| 1218 | `ErrMilestoneComplete` | All milestones done | No more milestones to complete |
| 1219 | `ErrDisputeOpen` | Dispute already filed | Respond to existing dispute |
| 1220 | `ErrInvalidResolution` | Resolution target invalid | Target must be buyer or seller address |
| 1221 | `ErrEmptyReason` | Reason field is empty | Provide a non-empty reason string |
| 1230 | `ErrComputeResourceNotFound` | GPU resource not found | Verify resource ID |
| 1231 | `ErrComputeResourceInactive` | GPU resource is inactive | Reactivate or use a different resource |
| 1232 | `ErrComputeResourceLeased` | GPU already leased | Wait for lease to end or use another resource |
| 1233 | `ErrInvalidLeaseHours` | Lease duration invalid | Provide a positive number of hours |
| 1234 | `ErrLeaseNotFound` | Lease does not exist | Verify lease ID |
| 1235 | `ErrNotLeaseParty` | Not a party to this lease | Sign with the correct key |
| 1236 | `ErrLeaseNotActive` | Lease is not active | Lease may have expired or been terminated |
| 1237 | `ErrNotResourceOwner` | Not the resource owner | Sign with the owner's key |
| 1238 | `ErrResourceCurrentlyLeased` | Cannot delist with active lease | Wait for lease to complete before delisting |
| 1239 | `ErrInvalidGpuSpec` | GPU specification malformed | Provide a valid GPU spec string |
| 1240 | `ErrEmptyEndpoint` | Endpoint is empty | Provide a non-empty endpoint URL |
| 1250 | `ErrJobNotFound` | Compute job not found | Verify job ID |
| 1251 | `ErrInvalidJobStatus` | Invalid job status transition | Check current job status before updating |
| 1252 | `ErrInvalidJobType` | Job type not recognized | Use a supported job type |
---
## Quick Reference: Diagnostic Workflow
When something goes wrong, follow this sequence:
```
1. clawd status # Quick health overview
2. clawd doctor --json # Full diagnostics with repair hints
3. clawd readiness --json # Strict readiness check with blockers listed
4. journalctl -u clawchaind -n 100 --no-pager # Recent chain logs
```
If all diagnostics pass but issues persist, check:
```bash
# Chain logs for application-level errors
journalctl -u clawchaind --since "10 minutes ago" | grep -i "error\|panic\|fatal"
# Query the latest block for failed transactions
clawchaind query txs --events 'tx.height=<height>' --node http://localhost:26657
# Verify module params haven't changed unexpectedly
clawchaind query agent params
clawchaind query privacy params
clawchaind query marketplace params
```