# Node Troubleshooting

If you are a developer, running a private network using [AlgoKit](https://developer.algorand.org/docs/get-started/algokit) provides more flexibility and is simpler.

Running a production node for MainNet benefits decentralization. However, like any unmanaged system (and any blockchain node/indexer), running a production node has many requirements to maintain high availability and reliability: appropriate redundancy (some upgrades create downtime on nodes), 24/7 monitoring, regular maintenance, and use of a staging environment for testing updates.

Consider using [third-party API services](https://developer.algorand.org/ecosystem-projects/?tags=api-services) or a third-party provider to help set up and maintain your node.

## First steps

[Section titled “First steps”](https://dev.algorand.co/nodes/installation/troubleshooting/#first-steps)

Ensure your `$PATH` and `$ALGORAND_DATA` environment variables are correctly set and your node is running. In particular:

```
goal node status
```

Should return something like:

```
Last committed block: 23119736

Time since last block: 0.1s

Sync Time: 2.7s

Last consensus protocol: https://github.com/algorandfoundation/specs/tree/d5ac876d7ede07367dbaa26e149aa42589aac1f7

Next consensus protocol: https://github.com/algorandfoundation/specs/tree/d5ac876d7ede07367dbaa26e149aa42589aac1f7

Round for next consensus protocol: 23119737

Next consensus protocol supported: true

Last Catchpoint:

Genesis ID: testnet-v1.0

Genesis hash: SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=
```

Read [Install a Node](https://dev.algorand.co/nodes/installation/manual-installation) to set these variables properly.

If you see:

- `Data directory not specified. Please use -d or set $ALGORAND_DATA in your environment. Exiting.`: Your `$ALGORAND_DATA` is not properly set up.
- `command not found: goal`: Your `$PATH` is not properly set up.
- `Cannot contact Algorand node: open ...: no such file or directory`: The node is not started. Starting a node varies depending on the [installation method](https://dev.algorand.co/nodes/installation/manual-installation).

## Common Issues for `algod`

[Section titled “Common Issues for algod”](https://dev.algorand.co/nodes/installation/troubleshooting/#common-issues-for-algod)

### Most common issues: wrong version, wrong network, not caught up

[Section titled “Most common issues: wrong version, wrong network, not caught up”](https://dev.algorand.co/nodes/installation/troubleshooting/#most-common-issues-wrong-version-wrong-network-not-caught-up)

The most common issues are that the node is on the wrong network, has the wrong `algod` version, or is not fully synced.

- **Check that the node is synced/caught up** following [Catchup and Status](https://dev.algorand.co/nodes/installation/catchup-status). See below if the node is not syncing.
- **Check that the node is on the right network**: When running `goal node status`, `Genesis ID` must be `mainnet-v1.0` for MainNet, `testnet-v1.0` for TestNet, `betanet-v1.0` for BetaNet. See [Switch Networks](https://dev.algorand.co/nodes/management/switch-networks) to resolve this issue.
- **Check the version**: The version reported by `algod -v` and `goal version -v` should be the latest stable release (for MainNet or TestNet) or the latest beta release (for BetaNet). See the [official repo](https://github.com/algorand/go-algorand/releases) for all releases. Beta releases are marked.

### My node is not syncing/catching up at all (Last Committed Block is 0)

[Section titled “My node is not syncing/catching up at all (Last Committed Block is 0)”](https://dev.algorand.co/nodes/installation/troubleshooting/#my-node-is-not-syncingcatching-up-at-all-last-committed-block-is-0)

The `Last Committed Block` from `goal node status` should increase when the node starts. If it stays at 0, the node isn’t syncing/catching up at all. This usually indicates a connectivity issue or DNS restriction from your ISP.

#### No connectivity

[Section titled “No connectivity”](https://dev.algorand.co/nodes/installation/troubleshooting/#no-connectivity)

First, verify that your node has internet access. You can check using `curl https://example.com` in the command line.

#### DNS restrictions

[Section titled “DNS restrictions”](https://dev.algorand.co/nodes/installation/troubleshooting/#dns-restrictions)

By default, nodes get their repeater list by reading DNS SRV records. To ensure these records aren’t tampered with, the node uses DNSSec.

The node first tries the system DNS. If that fails, it uses the fallback DNS from **_config.json_** (if provided). If this also fails, it tries hardcoded DNS from [tools/network/dnssec/config.go](https://github.com/algorand/go-algorand/blob/master/tools/network/dnssec/config.go).

Some ISPs, enterprise networks, or public networks only allow DNS queries to their DNS servers, which may not support DNSSec. In this case, set `"DNSSecurityFlags": 0` in [`$ALGORAND_DATA/config.json`](https://github.com/algorand/go-algorand/blob/master/tools/network/dnssec/config.go).

:::caution Setting `DNSSecurityFlags` to `0` reduces node security and may allow attackers to connect your node to untrustworthy repeaters. While these repeaters cannot make your node accept invalid blocks or create invalid transactions, they may censor transactions or prevent syncing by withholding new blocks. Enable DNSSec in production whenever possible. :::

:::tip Remember to restart `algod` after any configuration changes. :::

To check your node’s DNS access, run these commands:

```
dig -t SRV _algobootstrap._tcp.mainnet.algorand.network +dnssec

dig -t SRV _algobootstrap._tcp.mainnet.algorand.network @8.8.8.8 +dnssec
```

At least one command should return a repeater list without errors or warnings. The first command uses system DNS; the second uses Google DNS.

#### Other issues

[Section titled “Other issues”](https://dev.algorand.co/nodes/installation/troubleshooting/#other-issues)

Less common reasons for failing to catch up:

- Check for the correct `genesis.json` file in `$ALGORAND_DATA`. See [switch networks](https://dev.algorand.co/nodes/management/switch-networks) documentation.
- For BetaNet, verify `$ALGORAND_DATA/config.json` has the correct `DNSBootstrapID`. See [configuration for BetaNet](https://dev.algorand.co/nodes/installation/catchup-status).

### My node is syncing/catching up very slowly (without fast-catchup)

[Section titled “My node is syncing/catching up very slowly (without fast-catchup)”](https://dev.algorand.co/nodes/installation/troubleshooting/#my-node-is-syncingcatching-up-very-slowly-without-fast-catchup)

As of November 2022, syncing without fast-catchup takes 2-4 weeks due to the blockchain’s size. Syncing slows as rounds increase since newer blocks typically contain more transactions.

:::tip Non-archiver nodes can sync faster using [fast-catchup](https://dev.algorand.co/nodes/installation/catchup-status). For archiver nodes, nodely.io provides [snapshots](https://nodely.io/extras/). This is not an endorsement - using these snapshots requires careful risk assessment since `algod` cannot verify their validity or that they don’t contain invalid data, allowing double spending. :::

If syncing appears to need much longer than 4 weeks:

1. Verify your node meets the [hardware requirements](https://dev.algorand.co/nodes/types#hardware-requirements). MainNet requires at least 16GB of RAM and cannot run on HDD/slow-SATA-SSD/SD.
2. Check for resource overuse:
   - Monitor RAM and CPU usage with `top` or `htop`
   - Check available disk space with `df -h`
   - Verify your internet connection speed (need 100Mbps minimum) and latency (should be under 100ms).
   - Some regions may have fewer repeaters, which can slow syncing. Latency above 100ms to the top 20 repeaters may cause issues. Check latency to the best repeaters using [nodely.io](https://nodely.io/extras/) scripts (from [https://snap.algonode.cloud](https://snap.algonode.cloud/) in the `utils` directory):

```bash
   #!/bin/bash

# needs dig from dnsutils
   
   N=$(dig +short srv _algobootstrap._tcp.mainnet.algorand.network @1.1.1.1 |wc -l)

echo "Querying $N nodes, be patient..."

echo "" > report.txt

for repeater in $(dig +short srv _algobootstrap._tcp.mainnet.algorand.network @1.1.1.1|awk '{print $4 ":" $3}');
   do

echo -n .

curl -s -o /dev/null --max-time 1 "http://$repeater/v1/urtho/ledger/0"

echo -ne '\bo'

curl -s -o /dev/null --max-time 1 "http://$repeater/v1/urtho/ledger/0" -w %{time_total} >> report.txt

echo -ne '\b+ '

echo "s;$repeater" >> report.txt

done

echo "Top 20 nodes"

sort -n report.txt | head -20
   ```

3. Ensure `$ALGORAND_DATA/config.json` is absent or contains only necessary non-default parameters. Only modify parameters if you understand the implications - some changes can significantly slow syncing.

### My node is not syncing/catching up with fast-catchup

[Section titled “My node is not syncing/catching up with fast-catchup”](https://dev.algorand.co/nodes/installation/troubleshooting/#my-node-is-not-syncingcatching-up-with-fast-catchup)

See [troubleshooting for fast-catchup](https://developer.algorand.org/docs/run-a-node/setup/install#troubleshooting-for-fast-catchup).

### Other issues

[Section titled “Other issues”](https://dev.algorand.co/nodes/installation/troubleshooting/#other-issues-1)

#### I get an `overspend` error when sending a transaction

[Section titled “I get an overspend error when sending a transaction”](https://dev.algorand.co/nodes/installation/troubleshooting/#i-get-an-overspend-error-when-sending-a-transaction)

If you receive an `overspend` error:

1. Verify sufficient Algo in the account using a [block explorer](https://developer.algorand.org/ecosystem-projects/?tags=block-explorers).
2. Confirm your node is [synced and on the right network](https://dev.algorand.co/nodes/installation/troubleshooting/#common-issues-for-algod).
3. Remember to account for:
   - The [minimum balance requirement](https://developer.algorand.org/docs/get-details/parameter_tables/#minimum-balance) of 0.1 Algo for basic accounts (more for ASA or applications).
   - The [fee](https://developer.algorand.org/docs/get-details/transactions/#fees) paid by the transaction sender.

#### None of the above works

[Section titled “None of the above works”](https://dev.algorand.co/nodes/installation/troubleshooting/#none-of-the-above-works)

If these solutions don’t help, check the [third-party nodely.io FAQ](https://nodely.io/faq/#algorand-faq).

If still unresolved, create a new [Forum](https://forum.algorand.org/) post with:

- Your goal and what’s failing (include full command lines and outputs in triple backquotes)
- OS version
- Machine specs: CPU count, RAM size, disk type (NVMe SSD, SATA SSD, etc.)
- Current usage: available memory, available disk space
- `algod -v` output
- `goal version -v` output
- `goal node status` output
- `config.json` content (from `$ALGORAND_DATA`)
- Links to `algod-out.log`, `algod-err.log`, `node.log` (from `$ALGORAND_DATA`) uploaded to GitHub Gist or similar

:::tip Always enclose code/long outputs in triple backquotes or use the `code` button for better readability. :::
