Resource icon

Scripted installation of Nextcloud 28 in iocage jail 2018-03-23

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
Can you even get Onlyoffice or Collabora running in on FreeNAS without a VM? Both are pretty easy to setup on a Linux VM, with or without Docker. You’ll also probably be looking at some kind of reverse proxy config to handle the SSL certs and redirect services to the jails and VM.

Not sure any of this is scriptable in the same way this Nextcloud install is.
 

Benc

Dabbler
Joined
Nov 5, 2015
Messages
37
Specifically, from the shell in the jail, what happens if you run mysql? And what's the output of cat ~/.my.cnf?

1.
[root@nextcloud ~]# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

2. The output of cat ~/.my.cnf is [client] and MariaDB root password
 

Benc

Dabbler
Joined
Nov 5, 2015
Messages
37
What kind of error do you get when you try directly logging into mysql, rather than via nextcloud, with the password?

I'm not sure what do you mean - is it what danb35 also asked?
 

Benc

Dabbler
Joined
Nov 5, 2015
Messages
37
What about the output (from the FreeNAS shell, not inside the jail) of iocage fstab -l nextcloud?


+-------+------------------------------------------------------------------------------------------+
| INDEX | FSTAB ENTRY |
+=======+=============================================================+
| 0 | /mnt/volPOPA1/portsnap/db /mnt/iocage/jails/nextcloud/root/var/db/portsnap nullfs rw 0 0 |
+-------+------------------------------------------------------------------------------------------+
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
That's strange, it appears to have lost your storage mount points. You'll need to recreate them. The commands used to do that are:
Code:
iocage fstab -a ${JAIL_NAME} ${PORTS_PATH}/ports /usr/ports nullfs rw 0 0     
iocage fstab -a ${JAIL_NAME} ${FILES_PATH} /mnt/files nullfs rw 0 0     
iocage fstab -a ${JAIL_NAME} ${DB_PATH}  /var/db/mysql  nullfs  rw  0  0     

${JAIL_NAME} gets replaced with the name of your jail, of course. The _PATH variables get replaced with the respective paths. Stop the jail, run those commands, and restart it. Then consider filing a bug report about 11.2-U2.1 destroying jail mount points.
 
Last edited:

Benc

Dabbler
Joined
Nov 5, 2015
Messages
37
It is working now:
+-------+------------------------------------------------------------------------------------------+
| INDEX | FSTAB ENTRY |
+=======+==================================================================+
| 0 | /mnt/volPOPA1/portsnap/db /mnt/iocage/jails/nextcloud/root/var/db/portsnap nullfs rw 0 0 |
+-------+------------------------------------------------------------------------------------------+
| 1 | /mnt/volPOPA1/db /mnt/iocage/jails/nextcloud/root/var/db/mysql nullfs rw 0 0 |
+-------+------------------------------------------------------------------------------------------+
| 2 | /mnt/volPOPA1/files /mnt/iocage/jails/nextcloud/root/mnt/files nullfs rw 0 0 |
+-------+------------------------------------------------------------------------------------------+

Only I am not sure what ports path should be?

I checked other jails and fstab seems to be fine. But they were all created before 11.2.
 

glauco

Guru
Joined
Jan 30, 2017
Messages
526
I've installed Nextcloud thanks to this script a long time ago.
Up until now, I've updated software in my jails with pkg upgrade but now I'm thinking that maybe I'm doing something wrong with Nextcloud because this script used portsnap, right? I know nothing about portsnap, can you tell me what I should do to keep my software up-to-date?
Thanks!
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
pkg upgrade should be perfectly fine. There's one specific dependency that's installed using the port, but shouldn't be causing a problem with anything.
 

Benc

Dabbler
Joined
Nov 5, 2015
Messages
37
$PORTS_PATH defaults to $POOL_PATH/portsnap if you haven't set it otherwise.

I haven't set it at all and I see now where I missed it. I used instructions on github because as you wrote at the begining, it should be most up-to-date. But on github you only mention /db and /files datasets so I created only those.

Although iocage fstab -l nextcloud reports /portsnap/db I have no such dataset under 'storage' in freenas (GUI), but it does exist (checked in shell). I guess this is ok and there is no need to change it now? It seems to be working fine now.

PS. BTW, portsnap entry was not removed from fstab during upgrade while /db and /files were, could this help why this happened at all?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
But on github you only mention /db and /files datasets so I created only those.
Yeah, I didn't see any particular reason people would want to change that path, but still left it configurable if someone did want to.
/portsnap/db I have no such dataset under 'storage' in freenas (GUI), but it does exist (checked in shell).
Perfectly normal.
PS. BTW, portsnap entry was not removed from fstab during upgrade while /db and /files were, could this help why this happened at all?
It would probably be a relevant detail in the bug report.
 

Thomas_VDB

Contributor
Joined
Sep 22, 2012
Messages
102
I had it working previously, but now I am completely reinstalling Nextcloud with the script on FreeNAS-11.2-U2.1 , and it's not working anymore.
Got to the dreadfull "Your Data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users."-nextcloud-page.
However after restarting the jail, I just got a blank page (in firefox). In Edge I get a page 500-error.
Tried to reinstall again (deleted the jail, zvol, and related data on my pool). After rerunning the script, I got again the same error 500.
Does anyone have some advice?
I think it is related to : https://github.com/danb35/freenas-iocage-nextcloud/issues/56
 

Thomas_VDB

Contributor
Joined
Sep 22, 2012
Messages
102
I redid the complete installation. Same results again. But now I noticed that the scripts throws errors right before ending. See below.

The output of iocage fstab -l nextcloud gives :
Code:
root@freenas:~ # iocage fstab -l nextcloud
+-------+-------------------------------------------------------------------------------------------------------+
| INDEX |                                              FSTAB ENTRY                                              |
+=======+=======================================================================================================+
| 0     | /mnt/DataMirror/portsnap/db /mnt/DataMirror/iocage/jails/nextcloud/root/var/db/portsnap nullfs rw 0 0 |
+-------+-------------------------------------------------------------------------------------------------------+


Code:
Nextcloud was successfully installed

Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /usr/local/www/apache24/data/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /usr/local/www/apache24/data/nextcloud/console.php(95): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /usr/local/www/apache24/data/nextcloud/occ(11): require_once('/usr/local/www/...')
#2 {main}
Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /usr/local/www/apache24/data/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /usr/local/www/apache24/data/nextcloud/console.php(95): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /usr/local/www/apache24/data/nextcloud/occ(11): require_once('/usr/local/www/...')
#2 {main}
Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /usr/local/www/apache24/data/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /usr/local/www/apache24/data/nextcloud/console.php(95): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /usr/local/www/apache24/data/nextcloud/occ(11): require_once('/usr/local/www/...')
#2 {main}
Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /usr/local/www/apache24/data/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /usr/local/www/apache24/data/nextcloud/console.php(95): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /usr/local/www/apache24/data/nextcloud/occ(11): require_once('/usr/local/www/...')
#2 {main}
Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /usr/local/www/apache24/data/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /usr/local/www/apache24/data/nextcloud/console.php(95): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /usr/local/www/apache24/data/nextcloud/occ(11): require_once('/usr/local/www/...')
#2 {main}
Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /usr/local/www/apache24/data/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /usr/local/www/apache24/data/nextcloud/console.php(95): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /usr/local/www/apache24/data/nextcloud/occ(11): require_once('/usr/local/www/...')
#2 {main}
Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /usr/local/www/apache24/data/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /usr/local/www/apache24/data/nextcloud/console.php(95): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /usr/local/www/apache24/data/nextcloud/occ(11): require_once('/usr/local/www/...')
#2 {main}
Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /usr/local/www/apache24/data/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /usr/local/www/apache24/data/nextcloud/console.php(95): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /usr/local/www/apache24/data/nextcloud/occ(11): require_once('/usr/local/www/...')
#2 {main}
Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /usr/local/www/apache24/data/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /usr/local/www/apache24/data/nextcloud/console.php(95): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /usr/local/www/apache24/data/nextcloud/occ(11): require_once('/usr/local/www/...')
#2 {main}
Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /usr/local/www/apache24/data/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /usr/local/www/apache24/data/nextcloud/console.php(95): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /usr/local/www/apache24/data/nextcloud/occ(11): require_once('/usr/local/www/...')
#2 {main}
Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /usr/local/www/apache24/data/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /usr/local/www/apache24/data/nextcloud/console.php(95): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /usr/local/www/apache24/data/nextcloud/occ(11): require_once('/usr/local/www/...')
#2 {main}
Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /usr/local/www/apache24/data/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /usr/local/www/apache24/data/nextcloud/console.php(95): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /usr/local/www/apache24/data/nextcloud/occ(11): require_once('/usr/local/www/...')
#2 {main}
Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /usr/local/www/apache24/data/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /usr/local/www/apache24/data/nextcloud/console.php(95): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /usr/local/www/apache24/data/nextcloud/occ(11): require_once('/usr/local/www/...')
#2 {main}
Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /usr/local/www/apache24/data/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /usr/local/www/apache24/data/nextcloud/console.php(95): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /usr/local/www/apache24/data/nextcloud/occ(11): require_once('/usr/local/www/...')
#2 {main}
Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /usr/local/www/apache24/data/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /usr/local/www/apache24/data/nextcloud/console.php(95): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /usr/local/www/apache24/data/nextcloud/occ(11): require_once('/usr/local/www/...')
#2 {main}
Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /usr/local/www/apache24/data/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /usr/local/www/apache24/data/nextcloud/console.php(95): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /usr/local/www/apache24/data/nextcloud/occ(11): require_once('/usr/local/www/...')
#2 {main}
Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /usr/local/www/apache24/data/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /usr/local/www/apache24/data/nextcloud/console.php(95): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /usr/local/www/apache24/data/nextcloud/occ(11): require_once('/usr/local/www/...')
#2 {main}
Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /usr/local/www/apache24/data/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /usr/local/www/apache24/data/nextcloud/console.php(95): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /usr/local/www/apache24/data/nextcloud/occ(11): require_once('/usr/local/www/...')
#2 {main}

Successfully removed mount from nextcloud's fstab
Installation complete!
 
Joined
Feb 9, 2019
Messages
7
another complete reinstall fixed my issue.

How do you completely reinstall the script because whenever I tried to delete the db directory it would say device busy and I cant delete it,

I tried it with jail running and without running, it is still the same.

My issue with the install is that I assigned an internal ip to the jail but using that ip always gave me the freenas login instead of nextcloud. I tried enabling vnet and it is the same.

I am running out of options here except that I think I reinstall the script like 5 times already and I am not sure what it is doing to the db, files, portsnap directory.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
How do you completely reinstall the script
<code>
iocage destroy -f nextcloud
rm -rf ${DB_PATH}/*
rm -rf ${FILES_PATH}/*
</code>
Substitute the path variables as appropriate above, then re-run the script.
 
Top