Skip to content

Commit 4ed92ba

Browse files
authored
Merge pull request #757 from edochieblessing09-max/docs/add-troubleshooting
docs: add troubleshooting guide with 10 documented issues
2 parents 6e98452 + 638bedd commit 4ed92ba

3 files changed

Lines changed: 94 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Thank you for your interest in contributing to **Stellar Goal Vault**!
1616

1717
- Read the [README.md](./README.md) for project overview and architecture.
1818
- Check the [FAQ.md](./FAQ.md) for answers to common questions.
19+
- See the [Troubleshooting Guide](./docs/TROUBLESHOOTING.md) for solutions to common development issues.
1920
- Browse `OPEN_SOURCE_ISSUES.md` for curated contribution ideas.
2021

2122
## Backend Development
@@ -104,6 +105,8 @@ Thank you for your interest in contributing to **Stellar Goal Vault**!
104105

105106
### Troubleshooting
106107

108+
See the [Troubleshooting Guide](./docs/TROUBLESHOOTING.md) for a comprehensive list of common issues.
109+
107110
#### "SQLITE_CANTOPEN" or database file not found
108111
- Ensure the directory specified in `DB_PATH` exists
109112
- Check file permissions on the database directory

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,10 @@ That issue is already represented in:
542542

543543
See the [FAQ.md](./FAQ.md) for answers to common questions about testnet funding, Freighter setup, contract deployment, database reset, pledge failures, and more.
544544

545+
## Troubleshooting
546+
547+
See the [Troubleshooting Guide](./docs/TROUBLESHOOTING.md) for solutions to common issues like SQLite permissions, Soroban CLI mismatches, and CORS errors.
548+
545549
## Security
546550

547551
Please see [SECURITY.md](./SECURITY.md) for our responsible disclosure policy, supported versions, and reporting instructions.

docs/TROUBLESHOOTING.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Troubleshooting Guide
2+
3+
This guide covers common issues encountered while developing, building, or running the application.
4+
5+
## 1. SQLite File Permission Errors
6+
**Symptom**: `Error: SQLITE_CANTOPEN: unable to open database file` when starting the backend.
7+
**Cause**: The process running the backend does not have write permissions to the directory where the SQLite database file is stored or to the file itself.
8+
**Fix**: Grant appropriate read/write permissions to the database file and its parent directory.
9+
```bash
10+
chmod 755 backend/data
11+
chmod 644 backend/data/campaigns.db
12+
```
13+
14+
## 2. Soroban CLI Version Mismatch
15+
**Symptom**: `error: Found argument '--network' which wasn't expected` or unexpected CLI behavior when deploying contracts.
16+
**Cause**: You have an outdated or newer version of the Soroban CLI installed globally that is incompatible with the project's contract scripts.
17+
**Fix**: Install the specific version of Soroban CLI required by the project using cargo.
18+
```bash
19+
cargo install --locked --version 20.0.0 soroban-cli
20+
```
21+
22+
## 3. Freighter Connection Issues
23+
**Symptom**: "Freighter is not installed" or "Connection rejected" in the web application.
24+
**Cause**: The Freighter browser extension is not installed, the user denied the connection request, or the extension is locked.
25+
**Fix**: Reset the local network configuration via CLI to ensure proper testnet connections if local accounts are used.
26+
```bash
27+
stellar network add --global testnet --rpc-url https://soroban-testnet.stellar.org:443
28+
```
29+
30+
## 4. CORS Errors
31+
**Symptom**: `Access to fetch at 'http://localhost:8000/api/...' from origin 'http://localhost:3000' has been blocked by CORS policy.`
32+
**Cause**: The backend server is not configured to allow cross-origin requests from the frontend development server.
33+
**Fix**: Update your backend environment variables to allow the frontend origin, or restart the backend with CORS enabled.
34+
```bash
35+
export CORS_ALLOWED_ORIGINS="http://localhost:3000"
36+
npm run dev --prefix backend
37+
```
38+
39+
## 5. Contract ID Not Set
40+
**Symptom**: `Error: Contract ID not configured` when attempting to invoke a contract function from the frontend.
41+
**Cause**: The compiled contract ID is missing from the environment configuration files.
42+
**Fix**: Rebuild the contracts and copy the generated contract ID into your backend `.env` file.
43+
```bash
44+
soroban contract deploy --wasm target/wasm32-unknown-unknown/release/contract.wasm --source account > backend/.env.contract
45+
```
46+
47+
## 6. Node Version Mismatch
48+
**Symptom**: `SyntaxError: Unexpected token '?'` or package installation failures during `npm install`.
49+
**Cause**: You are using an unsupported version of Node.js.
50+
**Fix**: Switch to the recommended Node.js version (e.g., v18 or v20) using nvm.
51+
```bash
52+
nvm install 18
53+
nvm use 18
54+
```
55+
56+
## 7. Docker Daemon Not Running
57+
**Symptom**: `Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?`
58+
**Cause**: The Docker background service is not running on your host machine.
59+
**Fix**: Start the Docker service systemd.
60+
```bash
61+
sudo systemctl start docker
62+
sudo systemctl enable docker
63+
```
64+
65+
## 8. Environment Variables Not Loaded
66+
**Symptom**: Application starts but immediately crashes with missing configuration errors.
67+
**Cause**: The `.env` file is missing or not being properly sourced in the backend directory.
68+
**Fix**: Copy the example environment file and populate it.
69+
```bash
70+
cp backend/.env.example backend/.env
71+
```
72+
73+
## 9. Network Timeout on Testnet
74+
**Symptom**: `Timeout waiting for transaction confirmation` when interacting with the Stellar Testnet.
75+
**Cause**: Network congestion or the RPC node is temporarily unreachable.
76+
**Fix**: Ping the RPC endpoint to check availability.
77+
```bash
78+
curl -X POST "https://soroban-testnet.stellar.org:443" -d '{"jsonrpc":"2.0","id":1,"method":"getNetwork"}'
79+
```
80+
81+
## 10. Insufficient Funds in Testnet Account
82+
**Symptom**: `op_underfunded` or `tx_insufficient_balance` when submitting a transaction.
83+
**Cause**: The account signing the transaction does not have enough XLM to cover the network fees and minimum balance requirements.
84+
**Fix**: Fund your account using the Stellar Friendbot.
85+
```bash
86+
curl "https://friendbot.stellar.org/?addr=YOUR_PUBLIC_KEY"
87+
```

0 commit comments

Comments
 (0)