# After reboot PC node did not start. File is not a database

**URL:** <https://forum.storj.io/t/after-reboot-pc-node-did-not-start-file-is-not-a-database/22922>\
**Category:** troubleshooting\
**Tags:** debian-11, docker, linux, database\
**Created:** [June 12, 2023, 12:42pm UTC](https://forum.storj.io/t/after-reboot-pc-node-did-not-start-file-is-not-a-database/22922 "2023-06-12T12:42:50Z")\
**Posts on this page:** 13\
**Page:** 2

<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, 2023, 1:25am UTC](https://forum.storj.io/t/after-reboot-pc-node-did-not-start-file-is-not-a-database/22922/21 "2023-06-16T01:25:11Z")

</div>

I can assume, that all corruptions happened to nodes, working in VM, when their data was on the passed partitions from the host (without using of virtual disks). Perhaps this is a root cause.  
Could you please try to use a virtual disk instead for at least databases?

I do not trust a software virtualization such as QEMU too much; when I use Linux as a host, I usually use KVM instead.

---

<div class="post-metadata">

**Author:** ![Jice](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/jice/32/1132_2.png) [@Jice](https://forum.storj.io/u/Jice)\
**Post date:** [June 16, 2023, 9:38am UTC](https://forum.storj.io/t/after-reboot-pc-node-did-not-start-file-is-not-a-database/22922/22 "2023-06-16T09:38:08Z")

</div>

“no killing the node process give it as much time to shut down as needed.”  
If we talk about docker this is “docker stop storagenode?” or there is something more “gracefully” ?

---

<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, 2023, 3:37pm UTC](https://forum.storj.io/t/after-reboot-pc-node-did-not-start-file-is-not-a-database/22922/23 "2023-06-16T15:37:18Z")

</div>

> [@Alexey](#):
>
> I can assume, that all corruptions happened to nodes, working in VM, when their data was on the passed partitions from the host (without using of virtual disks).

For sure, because i didn’t use any virtual hard disk. Because you’re depening on 2 filesystems in that case: the host file system and the guest file system. But can give it a try in a few days to see how it works out.

> [@Alexey](#):
>
> I do not trust a software virtualization such as QEMU too much; when I use Linux as a host, I usually use KVM instead.

Jup, but usually it’s KVM/QEMU (as is in my case). I haven’t seen happen so much, that people run KVM standalone without any (para)virtualization. As far as I’m aware, libvirt/virsh/QEMU/KVM is all on the same page. See for example [KVM - Debian Wiki](https://wiki.debian.org/KVM). KVM is just the hypervisor QEMU uses in order to get hardware acceleration, opposed to full software emulated (Tiny Code Generator) in order to be able to run foreign instruction sets. If you ran it otherwise, please enlighten me. By as far as I know, KVM is always run with KVM.

> [@arrogantrabbit](#):
>
> make sure OOM monitors don’t kill it

Any help, how to configure the system in order to prevent kills of VM’s?

---

<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 17, 2023, 1:22am UTC](https://forum.storj.io/t/after-reboot-pc-node-did-not-start-file-is-not-a-database/22922/24 "2023-06-17T01:22:38Z")

</div>

> [@JWvdV](#):
>
> how to configure the system in order to prevent kills of VM’s?

Use KVM as a backend, no jokes. At least I never meet such a problem, when I used it.  
And passing partitions become rock solid unlike QEMU. Your load is not testing/developing for what QEMU is designed for, so use a normal hardware virtualization instead of software virtualization.

---

<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 17, 2023, 7:01am UTC](https://forum.storj.io/t/after-reboot-pc-node-did-not-start-file-is-not-a-database/22922/25 "2023-06-17T07:01:01Z")

</div>

> [@Alexey](#):
>
> Use KVM as a backend, no jokes. At least I never meet such a problem, when I used it.  
> And passing partitions become rock solid unlike QEMU.

Show code please.

Because QEMU is using KVM under the hood, and there are no KVM CLI-utilities as far as I know aside from QEMU. That was the reason I referred that KVM page from Debian.

```auto
root@VM-HOST:~# virsh dumpxml Storj-node
<domain type='kvm' id='2'>
(...)
</domain>

```

```auto
root 6158 0.0 0.0 0 0 ? I< jun15 0:00 [kvm]
root 6159 0.0 0.0 0 0 ? S jun15 0:00 [kvm-nx-lpage-recovery-6153]
root 6164 0.0 0.0 0 0 ? S jun15 0:58 [kvm-pit/6153]

```

---

<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 17, 2023, 7:10am UTC](https://forum.storj.io/t/after-reboot-pc-node-did-not-start-file-is-not-a-database/22922/26 "2023-06-17T07:10:45Z")

</div>

You may install QEMU without KVM.  
I usually install it like this

```auto
sudo apt -y install qemu-kvm libvirt-daemon bridge-utils virtinst libvirt-daemon-system
sudo apt -y install virt-top libguestfs-tools libosinfo-bin qemu-system virt-manager

```

and manage VMs via virt-manager or virsh. I did use Ubuntu though, but I think it doesn’t matter too much.  
Many of SNOs use Proxmox without issues with db too.

---

<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 17, 2023, 7:14am UTC](https://forum.storj.io/t/after-reboot-pc-node-did-not-start-file-is-not-a-database/22922/27 "2023-06-17T07:14:21Z")

</div>

So, I’m doing exactly the same and you’re using QEMU too 😉

As I said:

> [@JWvdV](#):
>
> As far as I’m aware, libvirt/virsh/QEMU/KVM is all on the same page.

The only difference is what hypervisor you choose in QEMU. Which by default is KVM.

---

<div class="post-metadata">

**Author:** ![arrogantrabbit](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/arrogantrabbit/32/11200_2.png) [@arrogantrabbit](https://forum.storj.io/u/arrogantrabbit)\
**Post date:** [June 17, 2023, 7:23am UTC](https://forum.storj.io/t/after-reboot-pc-node-did-not-start-file-is-not-a-database/22922/28 "2023-06-17T07:23:50Z")

</div>

> [@JWvdV](#):
>
> Partitions are being passed trough, so no caching (isn’t also supported anyway) and the file system is all being managed by the guests.

Unless you are passing the hardware disk device, the disk management is running on the host. It’s a problem.

> [@JWvdV](#):
>
> using qemu

See Alexey’s commend below on QEMU. Any reason why you need virtualization in the first place? You can switch to docker (or podman) and run containers rootless if you want better security; but the containers and will share kernel and you will avoid file locking issues, and likely your issues will go away.

> [@JWvdV](#):
>
> Situation is the same for Home Assistant and for the storage-nodes: file systems are all in RAID1 (so two partitions on two different drives are being passed through for the root file system),

Yeah, I think it is what I think – the fielssytem is managed by the host and VMs get to access it. This is the root of all evil.

Alternately, you can just keep databases on the VM’s disk. Then VM’s kernel will take care of correct locking and promises.

> [@JWvdV](#):
>
> Most data drives for STORJ are USB drives.

if you pass-through the USB device (not filesystem!) to VM – it will also work.

But seriously, get rid of so many VMs. use rootless podman containers instead.

> [@JWvdV](#):
>
> > [@arrogantrabbit](#):
> >
> > syncthing for backup (which isn’t either 🙂
> 
> How do you mean, are you pointing to the fact it’s not used on a freezed (but running) file system or something? Just out of curiosity.

Syncthinkg is replication. For backup you want point-in-time snapshots and versioning.

> [@JWvdV](#):
>
> he Syncthing use case is that all our phones are being synced real-time so photos aren’t being lost accidentally.

Imagine you corrupted a photo and it diligently replicated eveywhere, replacing good copies.

> [@JWvdV](#):
>
> The Syncthing-system is being snapshotted at regular intervals till 3months back

This addition makes it somewhat suitable for backup. But just 3 months is too little. you can’t be sure you’ll detect corruption in such a short time. Use actual backup tools, no need to reinvent a wheel. But while I can speak about data backup for hours, this is off topic 🙂

> [@JWvdV](#):
>
> Except from commit-time, no other caching is enabled since these are passthrough block devices.

do block device write atomically? VM does not know if blocks are actually written by the host, there is still a windows of opportunity for corruption.

> [@JWvdV](#):
>
> I really doubt whether you see them all. For example, I had already three occurences and only reported one on the forum. People not caring their stats, just throw away the databases and will have a full running and functional node afterwards in most situations.

But the difference is not many people construct such a complex multilayer system with drive sharing and VMs (with a few suspect points of failure as outlined above) and as a result don’t have issues.

As an experiment, switch to containers from VMs and see if you notice any improvement. This should be fairly easy to do.

---

<div class="post-metadata">

**Author:** ![arrogantrabbit](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/arrogantrabbit/32/11200_2.png) [@arrogantrabbit](https://forum.storj.io/u/arrogantrabbit)\
**Post date:** [June 17, 2023, 7:25am UTC](https://forum.storj.io/t/after-reboot-pc-node-did-not-start-file-is-not-a-database/22922/29 "2023-06-17T07:25:27Z")

</div>

> [@JWvdV](#):
>
> The only difference is what hypervisor you choose in QEMU. Which by default is KVM.

TLDR – let’s either get away from QEMU/KVM/etc OR passthrough the PCIE SATA controller to the VM. You want to remove the middle layer the can screw up atomicity of your transactions.

---

<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 17, 2023, 7:37am UTC](https://forum.storj.io/t/after-reboot-pc-node-did-not-start-file-is-not-a-database/22922/30 "2023-06-17T07:37:45Z")

</div>

I would support that. I did use a whole drive connected to VM, not partitions, but not for nodes though. And usually you have a better results with virtual disks than with passed partitions…

---

<div class="post-metadata">

**Author:** ![Jice](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/jice/32/1132_2.png) [@Jice](https://forum.storj.io/u/Jice)\
**Post date:** [June 17, 2023, 10:16am UTC](https://forum.storj.io/t/after-reboot-pc-node-did-not-start-file-is-not-a-database/22922/31 "2023-06-17T10:16:28Z")

</div>

so the most gracefull stop for nodes is docker stop storagenode?

---

<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 17, 2023, 11:13am UTC](https://forum.storj.io/t/after-reboot-pc-node-did-not-start-file-is-not-a-database/22922/32 "2023-06-17T11:13:05Z")

</div>

```auto
docker stop -t 300 storagenode

```

for precise, but - yes. You also need to remove a stopped container as well

```auto
docker rm storagenode

```

---

<div class="post-metadata">

**Author:** ![donald.m.motsinger](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/donald.m.motsinger/32/71_2.png) [@donald.m.motsinger](https://forum.storj.io/u/donald.m.motsinger)\
**Post date:** [June 19, 2023, 2:07pm UTC](https://forum.storj.io/t/after-reboot-pc-node-did-not-start-file-is-not-a-database/22922/33 "2023-06-19T14:07:14Z")

</div>

> [@JWvdV](#):
>
> But just out of curiosity: are there plans on automatically handling those database errors? Especially because they are that frequent coming along?

Frequently? Really? I run multiple nodes since when v3 started and AFAIR never have had a corrupted database.

[Previous page](https://forum.storj.io/t/after-reboot-pc-node-did-not-start-file-is-not-a-database/22922.md?page=1)
