Snap installing as `root`, but shouldn't be

I have snap defined here: here

Local/dev installation:

williamcharltonengineering@ubuntu:~$ snap start nomadik 
Started.
williamcharltonengineering@ubuntu:~$ snap logs nomadik 
2023-01-22T19:02:17Z systemd[1]: Stopped Service for snap application nomadik.nomad.
2023-01-22T19:02:17Z systemd[1]: Started Service for snap application nomadik.nomad.
2023-01-22T19:02:17Z nomadik.nomad[30455]: ==> Error loading configuration from /root/snap/nomadik/common/agent.hcl: stat /root/snap/nomadik/common/agent.hcl: no such file or directory
2023-01-22T19:02:17Z systemd[1]: snap.nomadik.nomad.service: Main process exited, code=exited, status=1/FAILURE
2023-01-22T19:02:17Z systemd[1]: snap.nomadik.nomad.service: Failed with result 'exit-code'.
2023-01-22T19:02:17Z systemd[1]: snap.nomadik.nomad.service: Scheduled restart job, restart counter is at 5.
2023-01-22T19:02:17Z systemd[1]: Stopped Service for snap application nomadik.nomad.
2023-01-22T19:02:17Z systemd[1]: snap.nomadik.nomad.service: Start request repeated too quickly.
2023-01-22T19:02:17Z systemd[1]: snap.nomadik.nomad.service: Failed with result 'exit-code'.
2023-01-22T19:02:17Z systemd[1]: Failed to start Service for snap application nomadik.nomad.

Since I am using $SNAP_USER_COMMON to define the path to my config file, I’d expect it to be under /home/williamcharltonengineering/snap/nomadik, but it’s under /root/....

I am not installing with sudo, so I should expect $SNAP_USER_COMMON to not be under /root.

williamcharltonengineering@ubuntu:~$ snap install nomadik_1.4.3_arm64.snap --dangerous --devmode
nomadik 1.4.3 installed
williamcharltonengineering@ubuntu:~$ snap start nomadik 
Started.
williamcharltonengineering@ubuntu:~$ snap logs nomadik 
2023-01-22T19:02:17Z systemd[1]: Stopped Service for snap application nomadik.nomad.
2023-01-22T19:02:17Z systemd[1]: Started Service for snap application nomadik.nomad.
2023-01-22T19:02:17Z nomadik.nomad[30455]: ==> Error loading configuration from /root/snap/nomadik/common/agent.hcl: stat /root/snap/nomadik/common/agent.hcl: no such file or directory
2023-01-22T19:02:17Z systemd[1]: snap.nomadik.nomad.service: Main process exited, code=exited, status=1/FAILURE
2023-01-22T19:02:17Z systemd[1]: snap.nomadik.nomad.service: Failed with result 'exit-code'.
2023-01-22T19:02:17Z systemd[1]: snap.nomadik.nomad.service: Scheduled restart job, restart counter is at 5.
2023-01-22T19:02:17Z systemd[1]: Stopped Service for snap application nomadik.nomad.
2023-01-22T19:02:17Z systemd[1]: snap.nomadik.nomad.service: Start request repeated too quickly.
2023-01-22T19:02:17Z systemd[1]: snap.nomadik.nomad.service: Failed with result 'exit-code'.
2023-01-22T19:02:17Z systemd[1]: Failed to start Service for snap application nomadik.nomad.

Can someone point out my error here? Thanks!

Update: I have been trying out alot of different methods and I might’ve polluted the system somehow. I re-imaged my device with Ubuntu Core and I am now getting better (different) errors that make more sense now.

if you run a service (daemon), you should not use *_USER_* variables but instead $SNAP_COMMON or $SNAP_DATA (which map to directories under /var/<snapname>) … daemons always run as root (the sandboxing is root-safe, so privilege dropping is not as important here), so using the user focused variables will end up underneath /root (but since /root is not user readable it is a lot less convenient compared to using /var)