SOLVED TC seems unable to use FreeNAS for storage

Joined
Jan 4, 2014
Messages
1,644
As per the TC documentation:

docker run --detach -v "/hostdirectory:/data" -p portnumber:80 -p sslport:443 ixsystems/truecommand:latest where hostdirectory is a directory on the host machine

Startup is fine. Here's a snippet of the startup:

Code:
administrator@ubuntu-bhyve:~$ sudo docker logs truecommand
Generating a RSA private key
Generate SSL Certificate
...............................................................................................+++++
..................................................+++++
writing new private key to '/etc/truecommand/server.key.auto'
-----
Starting PostgreSQL 11 database server: main.
Stopping PostgreSQL 11 database server: main.
2020-05-06 22:51:37,366 INFO Included extra file "/etc/supervisor/conf.d/middleware.conf" during parsing
2020-05-06 22:51:37,367 INFO Included extra file "/etc/supervisor/conf.d/nginx.conf" during parsing
2020-05-06 22:51:37,367 INFO Included extra file "/etc/supervisor/conf.d/postgresql.conf" during parsing
2020-05-06 22:51:37,367 INFO Set uid to user 0 succeeded
2020-05-06 22:51:37,376 INFO RPC interface 'supervisor' initialized
2020-05-06 22:51:37,376 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2020-05-06 22:51:37,376 INFO supervisord started with pid 63
2020-05-06 22:51:38,382 INFO spawned: 'nginx' with pid 66
2020-05-06 22:51:38,384 INFO spawned: 'middleware' with pid 67
2020-05-06 22:51:38,386 INFO spawned: 'postgres' with pid 68
2020-05-06 22:51:38,432 INFO exited: middleware (exit status 1; not expected)
2020-05-06 22:51:39,473 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-05-06 22:51:39,475 INFO spawned: 'middleware' with pid 94
2020-05-06 22:51:39,475 INFO success: postgres entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)


However, I'd like to have TC data saved on a FreeNAS share in case I nuke the Ubuntu VM. So, I followed the IXsystems guide Mount a TrueNAS or FreeNAS Share to a Docker Host. The Docker run command above is exactly the same except that hostdirectory on the host machine now maps to a FreeNAS NFS share.

Startup fails. Here's a snippet of the startup:

Code:
administrator@ubuntu-bhyve:~$ sudo docker logs truecommand
Generate SSL Certificate
Generating a RSA private key
..............................+++++
..........................................+++++
writing new private key to '/etc/truecommand/server.key.auto'
-----
chown: changing ownership of '/var/lib/postgresql/11/main': Operation not permitted
chmod: changing permissions of '/data': Operation not permitted
2020-05-06 23:25:10,225 INFO Included extra file "/etc/supervisor/conf.d/middleware.conf" during parsing
2020-05-06 23:25:10,225 INFO Included extra file "/etc/supervisor/conf.d/nginx.conf" during parsing
2020-05-06 23:25:10,225 INFO Included extra file "/etc/supervisor/conf.d/postgresql.conf" during parsing
2020-05-06 23:25:10,225 INFO Set uid to user 0 succeeded
2020-05-06 23:25:10,233 INFO RPC interface 'supervisor' initialized
2020-05-06 23:25:10,234 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2020-05-06 23:25:10,234 INFO supervisord started with pid 16
2020-05-06 23:25:11,238 INFO spawned: 'nginx' with pid 19
2020-05-06 23:25:11,240 INFO spawned: 'middleware' with pid 20
2020-05-06 23:25:11,242 INFO spawned: 'postgres' with pid 21
2020-05-06 23:25:11,299 INFO exited: middleware (exit status 1; not expected)
2020-05-06 23:25:11,389 INFO exited: postgres (exit status 1; not expected)
2020-05-06 23:25:12,390 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-05-06 23:25:12,392 INFO spawned: 'middleware' with pid 36
2020-05-06 23:25:12,395 INFO spawned: 'postgres' with pid 37
2020-05-06 23:25:12,440 INFO exited: middleware (exit status 1; not expected)
2020-05-06 23:25:12,550 INFO exited: postgres (exit status 1; not expected)
2020-05-06 23:25:14,555 INFO spawned: 'middleware' with pid 51
2020-05-06 23:25:14,557 INFO spawned: 'postgres' with pid 52
2020-05-06 23:25:14,596 INFO exited: middleware (exit status 1; not expected)
2020-05-06 23:25:14,682 INFO exited: postgres (exit status 1; not expected)


TC doesn't appear to be able to save its data in a FreeNAS share. Not sure if this is a bug?
 
Last edited:

aervin

iXsystems
iXsystems
Joined
Jun 13, 2018
Messages
114
It looks like the FreeNAS has not granted write access to the host/docker. Basically, the NAS is blocking TC's access to the /data directory. Please let us know if this is resolved after configuring permissions.

As always, thanks for reporting the issue @Basil Hendroff !
 
Joined
Jan 4, 2014
Messages
1,644
I should probably expand on the OP.

Where TC starts correctly, and uses local storage, this is what the permissions look like for the hostdirectory:

screenshot.316.png


When hostdirectory is mapped to a FreeNAS share, and TC fails to start, the snippet of the startup appears as follows:

Code:
administrator@ubuntu-bhyve:~$ sudo docker logs truecommand
Generating a RSA private key
Generate SSL Certificate
.................+++++
...................+++++
writing new private key to '/etc/truecommand/server.key.auto'
-----
Starting PostgreSQL 11 database server: main.
Stopping PostgreSQL 11 database server: main.
mv: failed to preserve ownership for '/data/ixdb/postmaster.opts': Operation not permitted
mv: failed to preserve ownership for '/data/ixdb/PG_VERSION': Operation not permitted                                                                                            
mv: failed to preserve ownership for '/data/ixdb/base/16384/2681': Operation not permitted                                                                                           mv: failed to preserve ownership for '/data/ixdb/base/16384/2840': Operation not permitted                                                                                           


Ownership for the mapped hostdirectory looks weird.

screenshot.317.png


If I set up a user avahi-autoipd (UID/GID=106) on the FreeNAS server and make it the owner of the dataset that the NFS share maps to, the snippet of the startup is as shown in the tail of the OP. Ownership of the mapped hostdirectory is still weird and looks similar to the previous screenshot.
 

Attachments

  • screenshot.315.png
    screenshot.315.png
    3.6 KB · Views: 419
  • screenshot.316.png
    screenshot.316.png
    4.9 KB · Views: 429
Last edited:
Joined
Jan 4, 2014
Messages
1,644
It looks like the FreeNAS has not granted write access to the host/docker. Basically, the NAS is blocking TC's access to the /data directory.
Hi @aervin, the guide I followed gives full access to world for the dataset.


screenshot.318.png
 
Joined
Jan 4, 2014
Messages
1,644
Here's my original mount command... sudo mount 10.1.1.20:/mnt/tank/nfs/tc $HOME/apps/truecommand/data

A mount -l seems to suggest it is already using NFSv3.

screenshot.320.png


Anyway, I dismounted... sudo umount $HOME/apps/truecomand/data and forced a mount using NFSv3... sudo mount 10.1.1.20:/mnt/tank/nfs/tc $HOME/apps/truecommand/data -o nfsvers=3

I try to start TC again, but it fails as per post #3
 

Attachments

  • screenshot.321.png
    screenshot.321.png
    4.3 KB · Views: 415

anmnz

Patron
Joined
Feb 17, 2018
Messages
286
This looks exactly like you have processes running as root in the Docker container, but you don't have "maproot" set on the NFS share, so the NFS server is mapping "root" to user "nobody", and as a result your "root" processes don't actually have the permissions they expect.
 
Joined
Jan 4, 2014
Messages
1,644
This is unfamiliar to me. I'm assuming I set the advanced share characteristics as shown?

screenshot.322.png


EDIT: That resolved the issue. Thanks @anmnz!
 
Last edited:
Top