# Cardano node was not cleanly shutdown

**URL:** <https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863>\
**Category:** Operate a Stake Pool\
**Created:** [5 September 2020 21:04 UTC](https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863 "2020-09-05T21:04:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![LatinStakePools](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/latinstakepools/32/55482_2.png) [@LatinStakePools](https://forum.cardano.org/u/LatinStakePools)\
**Post date:** [5 September 2020 21:04 UTC](https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863/1 "2020-09-05T21:04:01Z")

</div>

Hello,

I’m working on getting my second node running, but I’m having issues syncing with the network.  
I think the problem was that I tried to run the node for the first time in tmux, it frozen so I closed it and now I get the following error message:  
WARN: A prior running Cardano node was not cleanly shutdown, socket file still exists. Cleaning up.  
Listening on [http://127.0.0.1:12798](http://127.0.0.1:12798)  
I tried leaving it like this for a while to see if it fixed itself but nothing happen. Suggestions?

---

<div class="post-metadata">

**Author:** ![ADAfrog](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/adafrog/32/16303_2.png) [@ADAfrog](https://forum.cardano.org/u/ADAfrog)\
**Post date:** [6 September 2020 02:58 UTC](https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863/2 "2020-09-06T02:58:01Z")

</div>

Hi Martin,

Maybe try stopping your node manually and then executing **killall cardano-node**

If that doesn’t work, try removing your node.socket file and restarting the node

If all else fails you can wipe the entire database directory

Your friend, FROG

---

<div class="post-metadata">

**Author:** ![LatinStakePools](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/latinstakepools/32/55482_2.png) [@LatinStakePools](https://forum.cardano.org/u/LatinStakePools)\
**Post date:** [6 September 2020 22:45 UTC](https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863/3 "2020-09-06T22:45:23Z")

</div>

> [@ADAfrog](#):
>
> **killall cardano-node**

Hi Frog,

Thanks for your response. I tried killall cardano-node but got no process found. So I went and removed socket0.node. I was now able to run it without getting the warning message but I only got Listening on [http://127.0.0.1:12798](http://127.0.0.1:12798) as message and nothing more. The actual node is not opening…  
What should I do? 😥

---

<div class="post-metadata">

**Author:** ![ADAfrog](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/adafrog/32/16303_2.png) [@ADAfrog](https://forum.cardano.org/u/ADAfrog)\
**Post date:** [6 September 2020 23:04 UTC](https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863/4 "2020-09-06T23:04:34Z")

</div>

try

**rm -R /path/to/cardano-node/db**

Your friend, FROG

---

<div class="post-metadata">

**Author:** ![LatinStakePools](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/latinstakepools/32/55482_2.png) [@LatinStakePools](https://forum.cardano.org/u/LatinStakePools)\
**Post date:** [6 September 2020 23:09 UTC](https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863/5 "2020-09-06T23:09:38Z")

</div>

I tried removing db directory and node.stocket still same outcome, it gets stuck at listening…  
any other idea? 😅

---

<div class="post-metadata">

**Author:** ![ADAfrog](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/adafrog/32/16303_2.png) [@ADAfrog](https://forum.cardano.org/u/ADAfrog)\
**Post date:** [6 September 2020 23:14 UTC](https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863/6 "2020-09-06T23:14:46Z")

</div>

try using 0.0.0.0 as the host-addr param when starting the node

---

<div class="post-metadata">

**Author:** ![LatinStakePools](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/latinstakepools/32/55482_2.png) [@LatinStakePools](https://forum.cardano.org/u/LatinStakePools)\
**Post date:** [6 September 2020 23:46 UTC](https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863/7 "2020-09-06T23:46:14Z")

</div>

where do I find that parameter? in the config file?  
thanks for the help! 🙂

---

<div class="post-metadata">

**Author:** ![ADAfrog](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/adafrog/32/16303_2.png) [@ADAfrog](https://forum.cardano.org/u/ADAfrog)\
**Post date:** [7 September 2020 00:11 UTC](https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863/8 "2020-09-07T00:11:08Z")

</div>

My pleasure

It will either be in whatever script you are using to start the node, or used as a parameter when invoking that script

---

<div class="post-metadata">

**Author:** ![LatinStakePools](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/latinstakepools/32/55482_2.png) [@LatinStakePools](https://forum.cardano.org/u/LatinStakePools)\
**Post date:** [7 September 2020 02:13 UTC](https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863/9 "2020-09-07T02:13:23Z")

</div>

so I checked the script and the host address was okay, I did change the port which I had changed in the topology file and it was not updated in the script. But it’s still stuck in listening…

---

<div class="post-metadata">

**Author:** ![lauris](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/lauris/32/37129_2.png) [@lauris](https://forum.cardano.org/u/lauris)\
**Post date:** [7 September 2020 08:15 UTC](https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863/10 "2020-09-07T08:15:14Z")

</div>

you can always check if you have any open tmux session by typing:

> tmux list-sessions

If there is one (or more) you can attach to latest session by typing

> tmux a

if you have any frozen tmux session - you can kill it with:

> tmux kill-server

before that, try to gracefully kill the cardano-node processes with:  
`killall -s SIGKILL cardano-node`

if you are using CNtools scripts to run your nodes, after forced cardano-node shutdown (before it closes db and removes socket file) in some cases you will have to manually remove the socket file and only then start the script

**Do you run your second node on the same server? If yes, then don’t forget to change in start script the db directory and socket file names so they are different from each node. It will not work if you are pointing to the same socket / db dir.**

---

<div class="post-metadata">

**Author:** ![LatinStakePools](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/latinstakepools/32/55482_2.png) [@LatinStakePools](https://forum.cardano.org/u/LatinStakePools)\
**Post date:** [19 September 2020 22:09 UTC](https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863/11 "2020-09-19T22:09:14Z")

</div>

Hi lauris thanks for your feedback and sorry for the late reply. I still haven’t been able to solve this issue.  
I don’t have any tmux session running, using the killall command returns “no process found” and I tried several times already deleting the socket file and db but still get the same error message…  
What else could I do? delete everything and start from scratch?

---

<div class="post-metadata">

**Author:** ![lauris](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/lauris/32/37129_2.png) [@lauris](https://forum.cardano.org/u/lauris)\
**Post date:** [21 September 2020 14:37 UTC](https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863/12 "2020-09-21T14:37:41Z")

</div>

can you share how are you starting the node?  
what’s in the startup script?

---

<div class="post-metadata">

**Author:** ![LatinStakePools](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/latinstakepools/32/55482_2.png) [@LatinStakePools](https://forum.cardano.org/u/LatinStakePools)\
**Post date:** [21 September 2020 15:16 UTC](https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863/13 "2020-09-21T15:16:22Z")

</div>

Hi lauris, I’m using the scripts from the guild operators page.  
I’m using ./cnode.sh which contains the following:

```
#!/bin/bash
# shellcheck disable=SC2086

[[-z "$CNODE_HOME"]] && CNODE_HOME=/opt/cardano/cnode

. "${CNODE_HOME}"/scripts/env

if [[-S "$CNODE_HOME/sockets/node0.socket"]]; then
  if [`ps -ef | grep -c [c]ardano-node.*.$CNODE_HOME/sockets/node0.socket` -gt 0 ]; then
     echo "ERROR: A Cardano node is already running, please terminate this node before starting a new one with this script."
     exit 1
  else
    echo "WARN: A prior running Cardano node was not cleanly shutdown, socket file still exists. Cleaning up."
    unlink $CNODE_HOME/sockets/node0.socket
  fi
fi

[[! -d "$CNODE_HOME/logs/archive"]] && mkdir -p "$CNODE_HOME/logs/archive"

[[$(find "$CNODE_HOME"/logs/*.json | wc -l) -gt 0]] && mv $CNODE_HOME/logs/*.json $CNODE_HOME/logs/archive/

cardano-node run \
        --topology $CNODE_HOME/files/topology.json \
        --config $CNODE_HOME/files/config.json \
        --database-path $CNODE_HOME/db \
        --socket-path $CNODE_HOME/sockets/node0.socket \
        --host-addr 0.0.0.0 \
        --port 6003
"$POOL_DIR/hot.skey" ]]; then
  cardano-node run \
        --topology $CNODE_HOME/files/topology.json \
        --config $CNODE_HOME/files/config.json \
        --database-path $CNODE_HOME/db \
        --socket-path $CNODE_HOME/sockets/node0.socket \
        --host-addr 0.0.0.0 \
        --shelley-kes-key $POOL_DIR/hot.skey \
        --shelley-vrf-key $POOL_DIR/vrf.skey \
        --shelley-operational-certificate $POOL_DIR/op.cert \
        --port $CNODE_PORT
else
  cardano-node run \
        --topology $CNODE_HOME/files/topology.json \
        --config $CNODE_HOME/files/config.json \
        --database-path $CNODE_HOME/db \
        --socket-path $CNODE_HOME/sockets/node0.socket \
        --host-addr 0.0.0.0 \
        --port $CNODE_PORT
fi

## End
```

---

<div class="post-metadata">

**Author:** ![LatinStakePools](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/latinstakepools/32/55482_2.png) [@LatinStakePools](https://forum.cardano.org/u/LatinStakePools)\
**Post date:** [21 September 2020 16:02 UTC](https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863/14 "2020-09-21T16:02:41Z")

</div>

Okay, so I run `prereqs.sh` again to update the files. I updated the port and the topology file. I run the `cnode.sh` again and is still stuck on `Listening on http://127.0.0.1:12798` 😭

---

<div class="post-metadata">

**Author:** ![lauris](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/lauris/32/37129_2.png) [@lauris](https://forum.cardano.org/u/lauris)\
**Post date:** [21 September 2020 18:32 UTC](https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863/15 "2020-09-21T18:32:52Z")

</div>

do you have any log file? maybe in logs folder?  
as it looks like it starts, but doesn’t report any movement to the console.  
check config file for:  
“defaultScribes”: [  
[  
“StdoutSK”,  
“stdout”  
]  
],

or maybe MinSeverity settings are too high.  
“minSeverity”: “Debug”,

which version of cardano-node you have?

---

<div class="post-metadata">

**Author:** ![LatinStakePools](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/latinstakepools/32/55482_2.png) [@LatinStakePools](https://forum.cardano.org/u/LatinStakePools)\
**Post date:** [21 September 2020 20:35 UTC](https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863/16 "2020-09-21T20:35:12Z")

</div>

Hi lauris, thanks again for your feedback. I have node version 1.19.0  
I do have logs files in the logs folder, every single one has the following information

> {“at”:“2020-09-21T18:22:45.68Z”,“env”:“1.19.0:48140”,“ns”:[“cardano.node.ChainSyncClient”],“data”:{“kind”:“ChainSyncClientEvent.TraceDownloadedHeader”,“block”:{“kind”:“BlockPoint”,\>

In the config file I have the following

```
 "defaultScribes": [
    [
      "FileSK",
      "/opt/cardano/cnode/logs/node0.json"
    ]
  ],

```

and  
`"minSeverity": "Info",`

---

<div class="post-metadata">

**Author:** ![lauris](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/lauris/32/37129_2.png) [@lauris](https://forum.cardano.org/u/lauris)\
**Post date:** [22 September 2020 09:31 UTC](https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863/17 "2020-09-22T09:31:00Z")

</div>

i would suggest to reinstall from scratch, here is an **unofficial guide** i have created, hope this helps:

> **[Getting ready to install the Cardano Node (v1.19.1)](https://cardano-node-installation.stakepool247.eu/cardano-node-prerequisites)**
>
> Now the most complicated part (not so complicated if you follow this guide :) ) - the installation process!

---

<div class="post-metadata">

**Author:** ![LatinStakePools](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/latinstakepools/32/55482_2.png) [@LatinStakePools](https://forum.cardano.org/u/LatinStakePools)\
**Post date:** [22 September 2020 16:48 UTC](https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863/18 "2020-09-22T16:48:55Z")

</div>

Thanks lauris. What’s the easiest way to uninstall everything and start again?

---

<div class="post-metadata">

**Author:** ![lauris](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/lauris/32/37129_2.png) [@lauris](https://forum.cardano.org/u/lauris)\
**Post date:** [22 September 2020 20:41 UTC](https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863/19 "2020-09-22T20:41:07Z")

</div>

it depends where you store your scripts/logs/db, etc… if not in the cardano-node source folder, then just delete (or just in case, rename) and that’s it.

---

<div class="post-metadata">

**Author:** ![reza.sydney](https://avatars.discourse-cdn.com/v4/letter/r/f17d59/32.png) [@reza.sydney](https://forum.cardano.org/u/reza.sydney)\
**Post date:** [28 November 2020 12:48 UTC](https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863/20 "2020-11-28T12:48:25Z")

</div>

Hi @lauris  
I have the same issue, getting Listening on [http://127.0.0.1:12798](http://127.0.0.1:12798) when running ./cnode.sh script  
I build up my servers from scratch twice but still the same.  
I appreciate your resolution steps in advance

[Next page](https://forum.cardano.org/t/cardano-node-was-not-cleanly-shutdown/39863.md?page=2)
