# Strange error concerning graceful exit, while not graceful exiting

**URL:** <https://forum.storj.io/t/strange-error-concerning-graceful-exit-while-not-graceful-exiting/26646>\
**Category:** troubleshooting\
**Tags:** database\
**Created:** [June 15, 2024, 3:58am UTC](https://forum.storj.io/t/strange-error-concerning-graceful-exit-while-not-graceful-exiting/26646 "2024-06-15T03:58:47Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![JWvdV](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/jwvdv/32/7814_2.png) [@JWvdV](https://forum.storj.io/u/JWvdV)\
**Post date:** [June 15, 2024, 3:58am UTC](https://forum.storj.io/t/strange-error-concerning-graceful-exit-while-not-graceful-exiting/26646/1 "2024-06-15T03:58:47Z")

</div>

I get this error:

```auto
2024-06-15T00:30:28Z ERROR services unexpected shutdown of a runner {"Process": "storagenode", "name": "forgetsatellite:chore", "error": "database is locked"}
2024-06-15T00:30:33Z ERROR gracefulexit:chore error retrieving satellites. {"Process": "storagenode", "error": "satellitesdb: context canceled", "errorVerbose": "satellitesdb: context canceled\n\tstorj.io/storj/storagenode/storagenodedb.(*satellitesDB).ListGracefulExits.func1:200\n\tstorj.io/storj/storagenode/storagenodedb.(*satellitesDB).ListGracefulExits:212\n\tstorj.io/storj/storagenode/gracefulexit.(*Service).ListPendingExits:59\n\tstorj.io/storj/storagenode/gracefulexit.(*Chore).AddMissing:55\n\tstorj.io/common/sync2.(*Cycle).Run:160\n\tstorj.io/storj/storagenode/gracefulexit.(*Chore).Run:48\n\tstorj.io/storj/private/lifecycle.(*Group).Run.func2.1:87\n\truntime/pprof.Do:51\n\tstorj.io/storj/private/lifecycle.(*Group).Run.func2:86\n\tgolang.org/x/sync/errgroup.(*Group).Go.func1:78"}
2024-06-15T00:30:37Z ERROR failure during run {"Process": "storagenode", "error": "database is locked"}
Error: database is locked
2024-06-15 00:30:37,607 INFO exited: storagenode (exit status 1; not expected)

```

Why is this task even running?  
Checking all databases, did not show an error.

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [June 15, 2024, 4:39am UTC](https://forum.storj.io/t/strange-error-concerning-graceful-exit-while-not-graceful-exiting/26646/2 "2024-06-15T04:39:05Z")

</div>

It should update these databases with info from satellites. If it cannot - it may fail.  
Do you have a FATAL error around this time also?

---

<div class="post-metadata">

**Author:** ![JWvdV](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/jwvdv/32/7814_2.png) [@JWvdV](https://forum.storj.io/u/JWvdV)\
**Post date:** [June 15, 2024, 8:11pm UTC](https://forum.storj.io/t/strange-error-concerning-graceful-exit-while-not-graceful-exiting/26646/3 "2024-06-15T20:11:27Z")

</div>

No I don’t have any fatal error in the same time frame (till half hour before this restart). Actually, I see this error also coming along on some other nodes. But apparently, it usually doesn’t make the storagenode restarting. So it might even be a coincidence the restart and this error coming along.

It feels like some process is locking the database. That proces is being killed for unknown reason. But then the database remains locked forever…?

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [June 16, 2024, 7:23am UTC](https://forum.storj.io/t/strange-error-concerning-graceful-exit-while-not-graceful-exiting/26646/4 "2024-06-16T07:23:59Z")

</div>

This should not be the case if the process is killed - it should not run and it cannot have a lock. But lock can be put by the remained main process, i.e. storagenode itself, if you disabled the lazy mode.

---

<div class="post-metadata">

**Author:** ![JWvdV](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/jwvdv/32/7814_2.png) [@JWvdV](https://forum.storj.io/u/JWvdV)\
**Post date:** [June 16, 2024, 9:34am UTC](https://forum.storj.io/t/strange-error-concerning-graceful-exit-while-not-graceful-exiting/26646/5 "2024-06-16T09:34:03Z")

</div>

> [@Alexey](#):
>
> But lock can be put by the remained main process, i.e. storagenode itself, if you disabled the lazy mode.

That’s indeed the case, but than it’s strange the system can’t cope with this expected situation?

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [June 16, 2024, 10:05am UTC](https://forum.storj.io/t/strange-error-concerning-graceful-exit-while-not-graceful-exiting/26646/6 "2024-06-16T10:05:52Z")

</div>

Perhaps there are some relations between the disk speed and the size of the database, see

> [@ERROR lazyfilewalker.gc-filewalker.subprocess failed to save progress in the database](https://forum.storj.io/t/error-lazyfilewalker-gc-filewalker-subprocess-failed-to-save-progress-in-the-database/26407/90):
>
> In the hopes that this is true, allow me to give a bit more detail on what I have been experiencing for months now (this locking issue was affecting me even when my node was only around 3TB, rather than the 12+TB it is at now). Right now, piece\_expiration.db seems to be roughly 12x or so the size of bandwidth.db. I think the difference was considerably less when my node was much smaller. That shifting size difference roughly corresponds to how often it would pick one database or the other to…

---

<div class="post-metadata">

**Author:** ![JWvdV](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/jwvdv/32/7814_2.png) [@JWvdV](https://forum.storj.io/u/JWvdV)\
**Post date:** [June 16, 2024, 10:31am UTC](https://forum.storj.io/t/strange-error-concerning-graceful-exit-while-not-graceful-exiting/26646/7 "2024-06-16T10:31:06Z")

</div>

Yeah, might be. Although I also got this error on an external USB-attached SSD. As long it doesn’t kill my node, I’m inclined to ignore it and wait a little bit until the further maturation of STORJ.

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [June 16, 2024, 10:41am UTC](https://forum.storj.io/t/strange-error-concerning-graceful-exit-while-not-graceful-exiting/26646/8 "2024-06-16T10:41:51Z")

</div>

Hm. SSD. Then it must not be the case.  
Interesting.  
How is it possible that DB can be locked on SSD?  
did you check the speed?

---

<div class="post-metadata">

**Author:** ![JWvdV](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/jwvdv/32/7814_2.png) [@JWvdV](https://forum.storj.io/u/JWvdV)\
**Post date:** [June 16, 2024, 11:59am UTC](https://forum.storj.io/t/strange-error-concerning-graceful-exit-while-not-graceful-exiting/26646/9 "2024-06-16T11:59:48Z")

</div>

I did `iostat -x` and i see no worrisome unusual use fraction and so on. But this error happens on almost all nodes now, with disabled filewalker.  
The databases are on the internal SSD BTW.

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [June 16, 2024, 12:19pm UTC](https://forum.storj.io/t/strange-error-concerning-graceful-exit-while-not-graceful-exiting/26646/10 "2024-06-16T12:19:42Z")

</div>

Weird. Very weird. How is it possible, that my spinning disks (under Windows and worse - Docker Desktop for Windows) doesn’t have this issue?  
Ok. I would ping the team. But right now it’s very strange.

---

<div class="post-metadata">

**Author:** ![nerdatwork](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/nerdatwork/32/1135_2.png) [@nerdatwork](https://forum.storj.io/u/nerdatwork)\
**Post date:** [June 16, 2024, 12:19pm UTC](https://forum.storj.io/t/strange-error-concerning-graceful-exit-while-not-graceful-exiting/26646/11 "2024-06-16T12:19:56Z")

</div>

> [@JWvdV](#):
>
> all nodes now,

> [@JWvdV](#):
>
> The databases are on the internal SSD BTW.

If all nodes use same internal SSD then it might slow it down which is why the database got locked. Its usually seen in slow drives.

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [June 16, 2024, 12:20pm UTC](https://forum.storj.io/t/strange-error-concerning-graceful-exit-while-not-graceful-exiting/26646/12 "2024-06-16T12:20:36Z")

</div>

yes, but SSD is in 100x faster than a spinning disk, I hope?  
Hm  
@JWvdV what’s the model? Not something equal to a low-end SD cards, I hope?

---

<div class="post-metadata">

**Author:** ![nerdatwork](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/nerdatwork/32/1135_2.png) [@nerdatwork](https://forum.storj.io/u/nerdatwork)\
**Post date:** [June 16, 2024, 12:22pm UTC](https://forum.storj.io/t/strange-error-concerning-graceful-exit-while-not-graceful-exiting/26646/13 "2024-06-16T12:22:46Z")

</div>

> [@Alexey](#):
>
> but SSD is in 100x faster than spinning disk

Agreed. It could be dying SSD, overworked SSD so we need more info.

---

<div class="post-metadata">

**Author:** ![ACarneiro](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/acarneiro/32/1129_2.png) [@ACarneiro](https://forum.storj.io/u/ACarneiro)\
**Post date:** [June 16, 2024, 12:28pm UTC](https://forum.storj.io/t/strange-error-concerning-graceful-exit-while-not-graceful-exiting/26646/14 "2024-06-16T12:28:26Z")

</div>

> [@Alexey](#):
>
> How is it possible that DB can be locked on SSD?

Well, you have to wonder if there is something in common with @Qwinn having locked DB errors on a highly performant system as well.  
There does seem to be something fishy surfacing with the DBs

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [June 16, 2024, 12:42pm UTC](https://forum.storj.io/t/strange-error-concerning-graceful-exit-while-not-graceful-exiting/26646/15 "2024-06-16T12:42:57Z")

</div>

No, it’s not the same… We are talking about locks on SSD…  
SSD is much more faster than HDD, usually…  
But I’m agree, something is not right here.  
However, I know, you host Raspberry Pi nodes (likely less powerful than any discussed setups). Do you see this problem on your nodes?

---

<div class="post-metadata">

**Author:** ![ACarneiro](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/acarneiro/32/1129_2.png) [@ACarneiro](https://forum.storj.io/u/ACarneiro)\
**Post date:** [June 16, 2024, 12:54pm UTC](https://forum.storj.io/t/strange-error-concerning-graceful-exit-while-not-graceful-exiting/26646/16 "2024-06-16T12:54:52Z")

</div>

No, not really.  
The Pi5s are dealing perfectly with the workload so far.  
I only wish there was a PCI-SATA bridge for the Pi5 so I didn’t have to go via USB but otherwise all my Pi5-based nodes have been performing just fine (as far as I can tell so far)

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [June 16, 2024, 1:01pm UTC](https://forum.storj.io/t/strange-error-concerning-graceful-exit-while-not-graceful-exiting/26646/17 "2024-06-16T13:01:32Z")

</div>

This is exactly why I loved this one

> [@Post pictures of your storagenode rig(s)](https://forum.storj.io/t/post-pictures-of-your-storagenode-rig-s/1422/145):
>
> I just performed an upgrade of my node for both disk and board. Now it’s running on a Odroid HC2 board (8 cores, 2GB RAM) with a 8TB Seagate IronWolf HDD directly connected to the HC2 SATA port. I previously posted the old hardware [here](https://forum.storj.io/t/post-pictures-of-your-storagenode-rig-s/1422/121).

> [@Post pictures of your storagenode rig(s)](https://forum.storj.io/t/post-pictures-of-your-storagenode-rig-s/1422/95):
>
> Mine is a pretty simple setup. I had an unused ODROID-HC2 and scavenged a 4TB drive from my media mergerfs/snapraid array. I am running Ubuntu 18.04 LTS on it. This node has only been up for a few days. Hoping that I can add to the storj ecosystem! And here is a pic of my lil’ guy;

Very simple and slight design.

---

<div class="post-metadata">

**Author:** ![JWvdV](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/jwvdv/32/7814_2.png) [@JWvdV](https://forum.storj.io/u/JWvdV)\
**Post date:** [June 16, 2024, 4:08pm UTC](https://forum.storj.io/t/strange-error-concerning-graceful-exit-while-not-graceful-exiting/26646/18 "2024-06-16T16:08:42Z")

</div>

> [@Alexey](#):
>
> @JWvdV what’s the model? Not something equal to a low-end SD cards, I hope?

It’s happening on many nodes, which for databases are backed up by Kingston NV2, Crucial MX500 (\*2) and unknown brand N900-512.

They’re all without errors in SMART. If I look in iostat, on average they delivered a throughput of 5MiB/s read and 2MiB/s write. A load of 20% according to iostat. Temperature is all around 40 degrees Celsius.

Comparing to benchmarks, these loads are still peanuts.
