# Cardano Node Sync stuck

**URL:** <https://forum.cardano.org/t/cardano-node-sync-stuck/91806>\
**Category:** Community Technical Support\
**Tags:** cardano-node\
**Created:** [12 January 2022 23:00 UTC](https://forum.cardano.org/t/cardano-node-sync-stuck/91806 "2022-01-12T23:00:44Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattmco](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/mattmco/32/48775_2.png) [@mattmco](https://forum.cardano.org/u/mattmco)\
**Post date:** [12 January 2022 23:00 UTC](https://forum.cardano.org/t/cardano-node-sync-stuck/91806/1 "2022-01-12T23:00:44Z")

</div>

Hi I noticed my node sync is out on --mainnet and I noticed that when I run cardano-cli query tip --mainnet its stuck on the same block !

```auto
{
    "epoch": 154,
    "hash": "43732b25542df0652fc3095075f78e044830f300942b0464635dbaa315e1c46b",
    "slot": 36416289,
    "block": 2885555,
    "era": "Alonzo",
    "syncProgress": "49.17"
}

```

My version is cardano-cli 1.31.0

Although I ran this to check the cardano-db-sync and got not found could that be the issue or something else. please help if you can as i need to run transactions for minting native assets asap preferably.

cardano-db-sync --version  
command not found: cardano-db-sync

Regards

Matt

---

<div class="post-metadata">

**Author:** ![Alexd1985](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/alexd1985/32/23759_2.png) [@Alexd1985](https://forum.cardano.org/u/Alexd1985)\
**Post date:** [12 January 2022 23:09 UTC](https://forum.cardano.org/t/cardano-node-sync-stuck/91806/2 "2022-01-12T23:09:12Z")

</div>

Hi,

type sudo systemctl status cardano-node  
and journalctl -e -f -u cardano-node (do u see any errors?)  
don’t u have glive on your node?

---

<div class="post-metadata">

**Author:** ![erikd](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/erikd/32/813_2.png) [@erikd](https://forum.cardano.org/u/erikd)\
**Post date:** [13 January 2022 00:29 UTC](https://forum.cardano.org/t/cardano-node-sync-stuck/91806/3 "2022-01-13T00:29:11Z")

</div>

`cardano-cli` does not need `cardano-db-sync` to operate correctly.

Use the `systemctl status` command from @Alexd1985 to find out why the node is not progressing.

---

<div class="post-metadata">

**Author:** ![mattmco](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/mattmco/32/48775_2.png) [@mattmco](https://forum.cardano.org/u/mattmco)\
**Post date:** [13 January 2022 12:29 UTC](https://forum.cardano.org/t/cardano-node-sync-stuck/91806/4 "2022-01-13T12:29:15Z")

</div>

> [@Alexd1985](#):
>
> systemctl

Hi Alex I am running on Mac OS shell  
I can run testnet and I left it for about 4 hours until it was 100% synced

```auto
cardano-cli query tip --testnet-magic 1097911063
{
    "epoch": 180,
    "hash": "49c1f9d0d462d0941d9b964f4c57da16edea3dc484df450aad72e35967027ecd",
    "slot": 47707686,
    "block": 3234223,
    "era": "Alonzo",
    "syncProgress": "100.00"
}

```

Its just on Mainnet its stuck any other ideas ?

I can only run one or other node at a time on my machine

---

<div class="post-metadata">

**Author:** ![Alexd1985](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/alexd1985/32/23759_2.png) [@Alexd1985](https://forum.cardano.org/u/Alexd1985)\
**Post date:** [13 January 2022 12:47 UTC](https://forum.cardano.org/t/cardano-node-sync-stuck/91806/5 "2022-01-13T12:47:03Z")

</div>

yes, you need to check why on mainnet the node is not syncing.

did u replaced all files for tesnet with mainnet files? (mainnet-topology, mainnet-config, etc)  
what guide did u followed to install the node?

---

<div class="post-metadata">

**Author:** ![mattmco](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/mattmco/32/48775_2.png) [@mattmco](https://forum.cardano.org/u/mattmco)\
**Post date:** [14 January 2022 00:27 UTC](https://forum.cardano.org/t/cardano-node-sync-stuck/91806/6 "2022-01-14T00:27:52Z")

</div>

> [@Alexd1985](#):
>
> did u replaced all files for tesnet with mainnet files? (mainnet-topology, mainnet-config, etc)  
> what guide did u followed to install the node?

Used this guide

> **[Installing cardano-node and cardano-cli from source | Cardano Developer Portal](https://developers.cardano.org/docs/get-started/installing-cardano-node/)**
>
> This guide shows how to build and install the cardano-node and cardano-cli from the source-code for all major Operating Systems

Not sure I replaced all of them only the db number I downloaded them all testnet and mainnet into same folder as they had different names ?

Please tell me what i should of done ?

---

<div class="post-metadata">

**Author:** ![Alexd1985](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/alexd1985/32/23759_2.png) [@Alexd1985](https://forum.cardano.org/u/Alexd1985)\
**Post date:** [14 January 2022 07:27 UTC](https://forum.cardano.org/t/cardano-node-sync-stuck/91806/7 "2022-01-14T07:27:49Z")

</div>

How did u started the node? Can u share the script?

---

<div class="post-metadata">

**Author:** ![erikd](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/erikd/32/813_2.png) [@erikd](https://forum.cardano.org/u/erikd)\
**Post date:** [14 January 2022 09:11 UTC](https://forum.cardano.org/t/cardano-node-sync-stuck/91806/8 "2022-01-14T09:11:41Z")

</div>

@mattmco All this other stuff you are posting is next to useless. You need to post the `cardano-node` logs.

---

<div class="post-metadata">

**Author:** ![mattmco](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/mattmco/32/48775_2.png) [@mattmco](https://forum.cardano.org/u/mattmco)\
**Post date:** [14 January 2022 11:29 UTC](https://forum.cardano.org/t/cardano-node-sync-stuck/91806/9 "2022-01-14T11:29:54Z")

</div>

Hi yes of course

cardano-node run --config $HOME/cardano-src/cardano-node/mainnet-config.json --database-path $HOME/cardano-src/cardano-node/db/ --socket-path $HOME/cardano-src/cardano-node/db/node.socket --host-addr 127.0.0.1 --port 1337 --topology $HOME/cardano-src/cardano-node/mainnet-topology.json

---

<div class="post-metadata">

**Author:** ![HeptaSean](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/heptasean/32/82306_2.png) [@HeptaSean](https://forum.cardano.org/u/HeptaSean)\
**Post date:** [14 January 2022 11:31 UTC](https://forum.cardano.org/t/cardano-node-sync-stuck/91806/10 "2022-01-14T11:31:50Z")

</div>

> [@mattmco](#):
>
> `--database-path $HOME/cardano-src/cardano-node/db/`

Do you use the same database path for your testnet experiments?

That could (would?) be bad, since the databases of both have totally different content.

---

<div class="post-metadata">

**Author:** ![Alexd1985](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/alexd1985/32/23759_2.png) [@Alexd1985](https://forum.cardano.org/u/Alexd1985)\
**Post date:** [14 January 2022 11:44 UTC](https://forum.cardano.org/t/cardano-node-sync-stuck/91806/11 "2022-01-14T11:44:22Z")

</div>

> [@mattmco](#):
>
> –host-addr 127.0.0.1

replace 127.0.0.1 with 0.0.0.0 and try to start the node again

---

<div class="post-metadata">

**Author:** ![mattmco](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/mattmco/32/48775_2.png) [@mattmco](https://forum.cardano.org/u/mattmco)\
**Post date:** [14 January 2022 13:02 UTC](https://forum.cardano.org/t/cardano-node-sync-stuck/91806/12 "2022-01-14T13:02:32Z")

</div>

Hi ok will give that a go any explanation ?

---

<div class="post-metadata">

**Author:** ![mattmco](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/mattmco/32/48775_2.png) [@mattmco](https://forum.cardano.org/u/mattmco)\
**Post date:** [14 January 2022 13:03 UTC](https://forum.cardano.org/t/cardano-node-sync-stuck/91806/13 "2022-01-14T13:03:07Z")

</div>

Hi Ok what is the better practise ?

---

<div class="post-metadata">

**Author:** ![HeptaSean](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/heptasean/32/82306_2.png) [@HeptaSean](https://forum.cardano.org/u/HeptaSean)\
**Post date:** [14 January 2022 13:11 UTC](https://forum.cardano.org/t/cardano-node-sync-stuck/91806/14 "2022-01-14T13:11:18Z")

</div>

I would use `--database-path $HOME/cardano-src/cardano-node/testnet-db/` for testnet and `--database-path $HOME/cardano-src/cardano-node/mainnet-db/` for mainnet or something like that.

---

<div class="post-metadata">

**Author:** ![mattmco](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/mattmco/32/48775_2.png) [@mattmco](https://forum.cardano.org/u/mattmco)\
**Post date:** [14 January 2022 13:13 UTC](https://forum.cardano.org/t/cardano-node-sync-stuck/91806/15 "2022-01-14T13:13:44Z")

</div>

Yes good logic I like that !

---

<div class="post-metadata">

**Author:** ![mattmco](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/mattmco/32/48775_2.png) [@mattmco](https://forum.cardano.org/u/mattmco)\
**Post date:** [14 January 2022 13:14 UTC](https://forum.cardano.org/t/cardano-node-sync-stuck/91806/16 "2022-01-14T13:14:32Z")

</div>

Do I need to populate the both database again I remember doing something with that

---

<div class="post-metadata">

**Author:** ![HeptaSean](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/heptasean/32/82306_2.png) [@HeptaSean](https://forum.cardano.org/u/HeptaSean)\
**Post date:** [14 January 2022 13:45 UTC](https://forum.cardano.org/t/cardano-node-sync-stuck/91806/17 "2022-01-14T13:45:09Z")

</div>

In [How to run cardano-node | Cardano Developer Portal](https://developers.cardano.org/docs/get-started/running-cardano#running-the-node) it only says that the directories should exist. `mkdir $HOME/cardano-src/cardano-node/testnet-db` for testnet and `mkdir $HOME/cardano-src/cardano-node/mainnet-db` for mainnet should be enough.

---

<div class="post-metadata">

**Author:** ![HeptaSean](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/heptasean/32/82306_2.png) [@HeptaSean](https://forum.cardano.org/u/HeptaSean)\
**Post date:** [14 January 2022 18:19 UTC](https://forum.cardano.org/t/cardano-node-sync-stuck/91806/18 "2022-01-14T18:19:18Z")

</div>

> [@Alexd1985](#):
>
> replace 127.0.0.1 with 0.0.0.0 and try to start the node again

> [@mattmco](#):
>
> Hi ok will give that a go any explanation ?

You can tell all kinds of servers (it’s not just `cardano-node`-specific), on which Internet addresses to answer requests. 127.0.0.1 is the local loopback interface, so with that the server will only answer requests from the current machine. 0.0.0.0 most often means “bind on every available interface”, so that it will answer on the local loopback, on the address given to your ethernet port, on the address given to your wifi connection, …

For relays and block producers, it’s pretty important to have them open on all interfaces, since they want and need incoming connections (although the original design said that they should work with only outgoing connections, but SPOs say they don’t). For this to really work, the router also has to be configured to forward requests to the right machine inside the network. Normally, they don’t. They wouldn’t even know if Cardano requests should go to your computer, the TV or the Playstation.

If you just use the node to mint some tokens (or as the backend of a wallet or something like that), you would not need the node to answer external requests and `--host-addr 127.0.0.1` is probably okay. (Your router wouldn’t be configured in the way described above, anyway.)

`cardano-cli` doesn’t use the TCP/IP interface, when talking to `cardano-node`, but it uses a Unix socket – a special file on the file system that behaves a bit like a connection over the network. That’s what you tell it to open with `--socket-path $HOME/cardano-src/cardano-node/db/node.socket` (by the way, if we distinguish mainnet and testnet db folders, we should probably just put that one level up or so) and tell `cardano-cli` to find with `export CARDANO_NODE_SOCKET_PATH="$HOME/cardano-src/cardano-node/db/node.socket"` (has to also be adapted, when you put it somewhere else).

---

<div class="post-metadata">

**Author:** ![mattmco](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/mattmco/32/48775_2.png) [@mattmco](https://forum.cardano.org/u/mattmco)\
**Post date:** [14 January 2022 18:31 UTC](https://forum.cardano.org/t/cardano-node-sync-stuck/91806/19 "2022-01-14T18:31:00Z")

</div>

> [@HeptaSean](#):
>
> `cardano-cli` doesn’t use the TCP/IP interface, when talking to `cardano-node` , but it uses a Unix socket – a special file on the file system that behaves a bit like a connection over the network. That’s what you tell it to open with `--socket-path $HOME/cardano-src/cardano-node/db/node.socket` (by the way, if we distinguish mainnet and testnet db folders, we should probably just put that one level up or so) and tell `cardano-cli` to find with `export CARDANO_NODE_SOCKET_PATH="$HOME/cardano-src/cardano-node/db/node.socket"` (has to also be adapted, when you put it somewhere else).

Ok you lost me a bit here what do I need to do folder structure wise ?

---

<div class="post-metadata">

**Author:** ![HeptaSean](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/heptasean/32/82306_2.png) [@HeptaSean](https://forum.cardano.org/u/HeptaSean)\
**Post date:** [14 January 2022 18:57 UTC](https://forum.cardano.org/t/cardano-node-sync-stuck/91806/20 "2022-01-14T18:57:17Z")

</div>

> [@mattmco](#):
>
> Ok you lost me a bit here what do I need to do folder structure wise ?

Above, I suggested that it’s perhaps not a good idea to have the databases of testnet and mainnet in the same folder and that may well be the cause of your problems.

If we do not use `$HOME/cardano-src/cardano-node/db/` anymore, but separate `$HOME/cardano-src/cardano-node/mainnet-db/` and `$HOME/cardano-src/cardano-node/testnet-db/`, then you will probably want to delete the whole `$HOME/cardano-src/cardano-node/db/` to keep it tidy and also, because each of these folders eats up several GiB.

But then the socket shouldn’t be configured in that directory, also.

- You could configure `cardano-node` with `--socket-path $HOME/cardano-src/cardano-node/testnet-db/node.socket` if you are running testnet and with `--socket-path $HOME/cardano-src/cardano-node/mainnet-db/node.socket` if you are running mainnet. That would especially be necessary if you want to run both at the same time (and your machine is powerful enough for that craziness).
- You could also choose `--socket-path $HOME/cardano-src/cardano-node/node.socket` and put it outside the database folder and use the same socket for testnet and mainnet. Should be totally fine, as long as both are not running at the same time.

In any case, `cardano-cli` needs to know, where the node is. Therefore, all walkthroughs that I have seen contain something like `export CARDANO_NODE_SOCKET_PATH="$HOME/cardano-src/cardano-node/db/node.socket"` somewhere near the beginning. Whatever you have decided above needs to be reflected there.

- If you distinguish mainnet and testnet, it needs to be `export CARDANO_NODE_SOCKET_PATH="$HOME/cardano-src/cardano-node/testnet-db/node.socket"` before you can do something with a running testnet node and `export CARDANO_NODE_SOCKET_PATH="$HOME/cardano-src/cardano-node/mainnet-db/node.socket"` to connect to a running mainnet node.
- If you decide that the socket should be the same and put it one level up, it would be `export CARDANO_NODE_SOCKET_PATH="$HOME/cardano-src/cardano-node/node.socket"` in both cases.

Perhaps, some guide told you to put in `.bashrc`, `.zshrc` or something like that. Then the easiest way would be the “same socket for mainnet and testnet” choice and just edit it there (and remember that it only takes effect for newly started shells after the change).

[Next page](https://forum.cardano.org/t/cardano-node-sync-stuck/91806.md?page=2)
