Stopped Jail disappears, as if never created

Paravirtual

Dabbler
Joined
Nov 8, 2020
Messages
13
I'm a bit baffled by this.

I installed Nextcloud plugin via the plugins menu. It seemed to hang on "starting mysqld..90%" for an hour which was odd, but I reloaded the TrueNAS Web GUI and, after logging in again, it showed that the jail was created, and running, and I could access the Nextcloud Initial setup web server via it's IP.

Wanting to setup a mountpoint to the main dataset as many guides suggest, I stopped the jail, went to create the dataset, went back to jails and...it's gone? There's no jails configured. None. No sign it ever existed. I only stopped it though, did not delete. But there's no sign of it at all.

Thinking I must have done something wrong somehow, I repeated the whole process. Again, installing mysqld gets stuck at 90% but refreshing UI shows once more, jail exists and is running. I clicked stop, and the jail UI page shows it is stopped. But still in existence. I navigate away to another page, then back to jails - and it's completely vanished without a trace.

Seems like a UI bug, but not sure what CLI stuff to invoke to 'fix' it.

Any suggestions how to either fix, or avoid this from happening?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
Start with iocage list to see if there is indeed a jail there or not. (I suspect not as the GUI is effectively just showing you the output of that, but who knows what's happening here until we dig a bit).
 

Paravirtual

Dabbler
Joined
Nov 8, 2020
Messages
13
I forgot to mention I did actually check that, and yes, it lists nothing, as if nothing ever existed.

I will repeat the Nextcloud plugin installation a 3rd time, and watch to see what iocage list reports at each step...

So, Plugins -> select nextcloud, click install. I set jail name to "nextcloud" as well. The last two were also named this, in case that makes any difference.
Networking set to DHCP, no other defaults changed.

The GUI progress quickly goes from 0% to "Install 50.00% - mysql57-server"
It sits on 50% for quite some time
At this stage, iocage list reports;

Code:
+------+-----------+---------+---------+-----+
| JID  |   NAME    |  STATE  | RELEASE | IP4 |
+======+===========+=========+=========+=====+
| None | nextcloud | CORRUPT | N/A     | N/A |
+------+-----------+---------+---------+-----+


...I guess that could be a clue.

It's now moved on to " Install - 75.00% - nextcloud-php74..." - took about 10 minutes.

(It's not a wickedly fast system but the amount time time it's taken I still found surprising, I suppose because when you're used to CLI you get a lot more console feedback and it's apparent it's doing 'something' rather than just sitting at certain %ages waiting for the status to change)

Still 75% now says it's installing some other stuff... but now, iocode list reports
Code:
+-----+-----------+-------+--------------+------+
| JID |   NAME    | STATE |   RELEASE    | IP4  |
+=====+===========+=======+==============+======+
| 8   | nextcloud | up    | 12.1-RELEASE | DHCP |
+-----+-----------+-------+--------------+------+


90% now, it's got past starting php-fpm but seems once more to be forever stuck at "Install - 90% - starting mysql."
The jail exists, networking is up, and I can connect to the Web UI for nextcloud on the IP I've determined via by dhcp server.

wait a minute, now it reports;
Code:
+-----+-----------+-------+--------------+------+
| JID |   NAME    | STATE |   RELEASE    | IP4  |
+=====+===========+=======+==============+======+
| 9   | nextcloud | up    | 12.1-RELEASE | DHCP |
+-----+-----------+-------+--------------+------+


JID changed from 8 to 9. That's odd... isn't it?



It looks like it should be finished, but the GUI doesn't report it as finished, it never seems to go past the above status.


I went into the jail with iocode console nextcloud and took a look at /var/log and ps, it seems to be trying to start mysql, I'm not actually sure if this is actually running or not;
Code:
USER  PID   %CPU %MEM  VSZ      RSS    TT STAT STARTED TIME    COMMAND
mysql 142   0.0  4.2   1747164  341384 -  IJ   20:02   0:01.35 /usr/local/libexec/mysqld --defaults-extra-file=/usr/local/etc/mysql/my.cnf --base
mysql 98764 0.0  0.0   11960    2824   -  IsJ  20:02   0:00.21 /bin/sh /usr/local/bin/mysqld_safe --defaults-extra-file=/usr/local/etc/mysql/my.cnf


Is it possible that if the GUI thinks it's never successfully finished the plugin install, then as a cleanup action it performs a destroy on the jail afterwards? I suppose that wouldn't be too strange.
 
Last edited:

Paravirtual

Dabbler
Joined
Nov 8, 2020
Messages
13
So, about 30 minutes later, it clearly isn't doing anything. It still says "Install - 90% - starting mysql."

no change to the output of ps inside the jail. It seems the GUI is waiting for some sort of callback that will never come?

Everything is running, and by all means it looks like it's complete, but I guess somewhere it's not flagged as complete, and so it will destroy itself a short while after I navigate away from the page.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
If the plugin installation routine fails for any reason, no matter how far into the process, it will roll back everything, i.e. destroy the jail. I think this is what is happening here.
Why it fails in the first place, though ...?
 

Paravirtual

Dabbler
Joined
Nov 8, 2020
Messages
13
Right, all makes perfect sense now, then.

I'm guessing that either there's some incompatibility between TrueNAS-12.0-U1 and the Nextcloud plugin version 21.0.1 or a fault with the plugin installer, or some very obscure fault with my system (I cannot imagine how) that's preventing the installer from working correctly.

It's starting mysql near the end of the installer...but failing to detect or acknowledge that it has done so.

I shall peruse the code at:

But I don't really know how the GUI interacts with the script or what callback/action is missing/undetected
 
Last edited:
Top