HA on NAS not working - SOLVED

Hello, I had a system crash (yes, alcohol was involved) and lost my previous installation of HA. The good news was that all of my configuration and database was on USB attached storage and the crash was limited to the SD Card. So I figured now would be a great time to redesign the whole thing and start using my 4TB NAS. So I moved /srv/homeassistant to the NAS and then moved /home/homeassistant/.homeassistant under /srv/homeassistant.

Here’s where it gets weird. Initially my installation was on a mirrored lvm volume across 2 2TB Western Digital USB drives. I currently have those drives attached to my laptop and shared via NFS. I also copied everything to the NAS and set up NFS there as well. I have both me laptop and NAS sharing with the exact same options and mounted with the exact same options but I can’t get HA to start completely when launching from the NAS. It hangs just after the following:

INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=websocket_api>
INFO:homeassistant.setup:Setting up api
INFO:homeassistant.setup:Setup of domain api took 0.0 seconds.
INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=api>
INFO:homeassistant.setup:Setting up frontend
INFO:homeassistant.setup:Setup of domain frontend took 0.1 seconds.
INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=frontend>
WARNING:homeassistant.setup:Setup of recorder is taking over 10 seconds.

I’ve tried using my original config dir AND I’ve tried a new one from scratch and neither will start up when loading from the NAS. It WILL, however, start when mounted via NFS from my laptop.

Anyone have any ideas why HA is hanging when started from the NAS? I would much rather leverage the speed of the NAS instead of plugging in via USB 2.0. Creating a 100MB file over the network to my laptop takes 23 seconds. Creating the same 100MB file over the network to the NAS takes 4 seconds.

Here’s a little more info on my setup:

HA server is an Odroid C2+ and the NAS is a D-Link DNS-320 with latest and greatest firmware as of yesterday.
I am mounting the share to /srv which is currently 2777 permissions (a+rwx with sticky bit)
The .homeassistant config directory is located in /srv/homeassistant/.homeassistant with a symlink in homeassistant’s home dir.

(homeassistant) homeassistant@HomeServ:~ $ ls -la .homeassistant
lrwxrwxrwx 1 homeassistant homeassistant 34 Sep 25 17:50 .homeassistant -> /srv/homeassistant/.homeassistant/
(homeassistant) homeassistant@HomeServ:~ $ ls -la /srv/homeassistant
total 28
drwxrwxr-x 6 homeassistant homeassistant 4096 Sep 25 18:08 .
drwxrwxrwt 6 homeserv homeserv 4096 Sep 25 22:20 …
drwxrwxr-x 2 homeassistant homeassistant 4096 Sep 25 18:10 bin
drwxrwxr-x 3 homeassistant homeassistant 4096 Sep 25 21:12 .homeassistant
drwxrwxr-x 2 homeassistant homeassistant 4096 Sep 25 18:07 include
drwxrwxr-x 3 homeassistant homeassistant 4096 Sep 25 18:07 lib
-rw-rw-r-- 1 homeassistant homeassistant 60 Sep 25 18:08 pip-selfcheck.json
(homeassistant) homeassistant@HomeServ:~ $

Here are the mount options:

(homeassistant) homeassistant@HomeServ:~ $ mount |grep srv
homenas:/mnt/HD/HD_a2/Applications/homeserv on /srv type nfs (rw,relatime,vers=3,rsize=16384,wsize=16384,namlen=255,soft,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=,mountvers=3,mountport=46212,mountproto=udp,local_lock=none,addr=

And here are the export options from the NAS exports file:


SOLVED: Turns out it’s a file locking issue with NFS that causes sqlite3 to misbehave. As soon as I moved the database to local storage it worked.