This guide provides solutions to common issues encountered while setting up, developing, or deploying AgenticPay.
Error: Error: listen EADDRINUSE: address already in use :::3001
Solution:
# Kill process on port 3001
lsof -ti:3001 | xargs kill -9
# Or specify a different port in your .env file
PORT=3002 npm run devError: 401 Unauthorized or 429 Too Many Requests
Solution:
- Verify your
OPENAI_API_KEYinbackend/.envis correct. - Check if your API key has sufficient quota at platform.openai.com.
- Ensure you haven't exceeded rate limits for your account tier.
Error: Access to fetch at '...' from origin '...' has been blocked by CORS policy
Solution:
- Update
CORS_ALLOWED_ORIGINSinbackend/.envto include your frontend URL. - Current development default:
CORS_ALLOWED_ORIGINS=http://localhost:3000,http://localhost:3001
Error: FetchError: request to http://localhost:3001/api/v1/health failed
Solution:
- Verify the backend server is running on the correct port.
- Check
NEXT_PUBLIC_API_URLinfrontend/.env.localmatches your backend URL. - Ensure there are no firewall rules blocking local traffic between ports 3000 and 3001.
Error: Web3Auth error: Invalid client id
Solution:
- Verify
NEXT_PUBLIC_WEB3AUTH_CLIENT_IDinfrontend/.env.localis correct. - Ensure the redirect URL in your Web3Auth dashboard matches your local development URL (usually
http://localhost:3000).
Error: Error: Contract not found at address ...
Solution:
- Verify
NEXT_PUBLIC_CONTRACT_ADDRESSis correctly set to a deployed Soroban contract. - Check the contract status on Stellar Testnet using the Stellar CLI:
stellar contract info --id <contract_id> --network testnet
Error: cargo install soroban-cli fails with compilation errors.
Solution:
- Ensure you have the latest Rust version:
rustup update. - Install required system dependencies (e.g.,
libssl-dev,pkg-configon Linux). - Try installing the pre-compiled binary instead.
Error: Transaction failed: op_insufficient_balance
Solution:
- Fund your testnet account using Friendbot:
curl "https://friendbot.stellar.org/?addr=<your_public_key>"
Always verify the backend is healthy before debugging frontend issues:
curl http://localhost:3001/api/v1/healthUse the Stellar CLI to read contract data directly from the network:
stellar contract read --id <contract_id> --source <account> --network testnetIf you encounter weird UI behaviors after an update:
# Frontend
rm -rf frontend/.next
npm run dev
# Global Node Modules
rm -rf node_modules package-lock.json
npm installQ: Can I run AgenticPay on Mainnet?
A: Yes, but ensure you update STELLAR_NETWORK to public and use a production-ready RPC provider in your environment variables.
Q: How do I update a deployed smart contract?
A: Soroban contracts are currently immutable. You must deploy a new version and update the CONTRACT_ID in your backend and frontend configuration.
Q: Why is AI verification taking so long?
A: AI verification depends on the OpenAI API response time and the size of the codebase being reviewed. Ensure your GITHUB_TOKEN is configured to avoid rate limits when fetching repos.