Resource icon

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

snorp

Dabbler
Joined
Jul 10, 2018
Messages
35
Thank you for your answer!

Short summary:

I played locally on the switch and router with various settings. That worked so far, especially with VLAN´s. After that I reset the network settings in the shell menu.

After the last restart of freenas I got a message after booting and calling the GUI that I should change the root password and the wizard opened. No ZFS volume and other settings like starting services were missing.

Here in the forum I read that you can reload the ZFS volume. That worked too, but a lot of data is missing, among other things the content of Nextcloud (Cage). In the partition table I also see that not all of the disk space is in use. Or it is not used as much as it should be.

[root@freenas ~]# iocage restart ALL

Code:
nextcloud is not running!                                                   
* Starting nextcloud                                                       
  + Start FAILED                                                           
mount: /mnt/iocage: No such file or directory                               
jail: /sbin/mount -t nullfs -o rw /mnt/thunderfire.raid/portsnap/ports /mnt/ioca
ge/jails/nextcloud/root/usr/ports: failed  
 
Last edited:

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
Thank you for your answer!

Short summary:

I played locally on the switch and router with various settings. That worked so far, especially with VLAN´s. After that I reset the network settings in the shell menu.

After the last restart of freenas I got a message after booting and calling the GUI that I should change the root password and the wizard opened. No ZFS volume and other settings like starting services were missing.

Here in the forum I read that you can reload the ZFS volume. That worked too, but a lot of data is missing, among other things the content of Nextcloud (Cage). In the partition table I also see that not all of the disk space is in use. Or it is not used as much as it should be.

[root@freenas ~]# iocage restart ALL

Code:
nextcloud is not running!                                                   
* Starting nextcloud                                                       
  + Start FAILED                                                           
mount: /mnt/iocage: No such file or directory                               
jail: /sbin/mount -t nullfs -o rw /mnt/thunderfire.raid/portsnap/ports /mnt/ioca
ge/jails/nextcloud/root/usr/ports: failed  
Are you saying your "thunderfire.raid" under "Storage" isn't reporting the volume?
If that's the case are you sure you didn't reset the "Freenas configuration" to default and not just the password?
Are you using an encrypted volume?

To deal with the jail issue, I just wrote something about updating iocage jail mount points. It might be useful for you to understand. Maybe you will find something relevant to your issue.

https://forums.freenas.org/index.ph...d-after-replicating-a-pool.72148/#post-501969
 

snorp

Dabbler
Joined
Jul 10, 2018
Messages
35
Don't panic, yet.
What type of restart? Freenas or "nextcloud" jail?
One thing that might work is to restart all the jails only if they have a unique IP allocated.

iocage restart ALL
If this doesn't work, I found resetting the host address under Freenas console and setting it again does fix the issue.
Freenas pre 11.2 Release had lots of issues related to iocage jails. Would it make sense to upgrade then worry about iocage jails?

You can edit "fstab" file to edit jail mount point.

I was just looking. I actually reset the configuration via shell menu. -.-

root@freenas:~ # iocage restart ALL

Code:
nextcloud is not running!
* Starting nextcloud
  + Start FAILED
mount: /mnt/iocage: No such file or directory
jail: /sbin/mount -t nullfs -o rw /mnt/thunderfire.raid/portsnap/ports /mnt/iocage/jails/nextcloud/root/usr/ports: failed


The partitions etc. all look the same as before only missing about 250GB of data in the IOCage (nextcloud). The remaining 67GB is a backup file (archive) I created manually.
 

Attachments

  • Bildschirmfoto 2019-01-02 um 12.34.31.png
    Bildschirmfoto 2019-01-02 um 12.34.31.png
    205.2 KB · Views: 472
Last edited:

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
Resetting the configuration via shell is like starting a brand new install of Freenas.
This shouldn't affect the content of the data on your pool. However, you will need to find how everything used to be setup for it to work as before.
What is an upgrade of Freenas? If so, you can reboot from the configuration prior to the update and save the Freenas configuration. Then you can reboot on the latest and reload the configuration.
 

snorp

Dabbler
Joined
Jul 10, 2018
Messages
35
Resetting the configuration via shell is like starting a brand new install of Freenas.
This shouldn't affect the content of the data on your pool. However, you will need to find how everything used to be setup for it to work as before.
What is an upgrade of Freenas? If so, you can reboot from the configuration prior to the update and save the Freenas configuration. Then you can reboot on the latest and reload the configuration.
And I thought it is just the network setting. Strange is that only some data is missing which I do not understand.
You mean if I update my system it is possible to get my data back? I used this version of freenas because of the compatibility to the automated script which danb35 made.

I'm thinking that iocage activate <poolname> should solve the immediate problem.
thunderfire.raid is already activated and 'nextcloud' could not found!
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
And I thought it is just the network setting. Strange is that only some data is missing which I do not understand.
You mean if I update my system it is possible to get my data back? I used this version of freenas because of the compatibility to the automated script which danb35 made.
thunderfire.raid is already activated and 'nextcloud' could not found!
Under the Freenas Shell, you have the possibility of resetting your network setting or you can restore Freenas to it's default setting which will cause your pool to be unmounted, shares mount point removed and so forth. Data will not be affected.

I don't graps the entire process you went through and because of it I can only offer limited help.
If you used Danb35's script and followed it to the letter, then you would have a "db" and "files" dataset assigned and used as part of the new script install. If you were planning to use the newly installed script to create a jail to replace the one you used to have, then you will have to change several things in the jail mount point as well as the various passwords and config parameters used in the php.ini file I think in order to regain access to your original database and files.
One thing is sure, if you know the location of your original "db" and "files" dataset for Owncloud/Nextcloud, then you can list the content of you data under the "files" dataset. You should be able to see the list of the different accoutn and within those accounts your files some levels below.
 

Toast

Dabbler
Joined
Jun 17, 2014
Messages
16
Hey, I'm pretty new to domains And dns. I'm on Freenas 11.2 release. I bought a domain with Google and pretty sure I set it up to use the cloudflare dns. The domain isn't hosted anywhere. When I go to the page, it sends me to a cloud flare dns page. I used the global api from cloudflare. When I run the script, towards the end it gives me this error in red
Code:
  new-authz error: {"type":"urn:acme:error:m
alformed","detail":"Error creating new authz :: DNS name does not have en
ough labels","status": 400} 

my domain is setup like "cd.mydomain.com" I'm assume the issue is with my domain setup, but I'm not sure what I need to do. Thanks for any help
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504

Toast

Dabbler
Joined
Jun 17, 2014
Messages
16
Is that what you set as HOST_NAME in nextcloud-config?
Yes. Except the mydomain isn't literally mydomain of course. I put my domain there instead. I created a CNAME for my domain on cloudflare that is cd.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Would you mind sharing the actual domain (specifically, the exact contents of HOST_NAME) by PM? Because the message you're getting suggests that it isn't something that ends in a public suffix.
 

Sanfe

Dabbler
Joined
Apr 23, 2016
Messages
14
Hi all!!!!

Scritp ran and 0 errors!!!!! Well done. Only one problem. Im unable to acces Nextcloud, because now, im localy go to 192.168.1.2 a new frenas instace opens. My freenas also in 192.168.1.129.....

What happend!? What im doing wrong?
Thanks in advance for any idea...
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
im localy go to 192.168.1.2 a new frenas instace opens. My freenas also in 192.168.1.129.....
That sounds like you aren't using vnet for the jail.
 

Sanfe

Dabbler
Joined
Apr 23, 2016
Messages
14
Hi... very quick reply... o_O

this is my config...
Code:
JAIL_IP="192.168.1.2"
DEFAULT_GW_IP="192.168.1.1"
INTERFACE="bge0"
VNET="off"
POOL_PATH="/mnt/wd2018"
JAIL_NAME="nextcloud"
TIME_ZONE="Europe/Madrid"
# See http://php.net/manual/en/timezones.php
HOST_NAME="xxxxx.xxxxx.com"

TEST_CERT="--test"

STANDALONE_CERT=1 DNS_CERT=0
SELFSIGNED_CERT=1 NO_CERT=0



Setting up VNET=On into jail. im going to try---
Thanks a lot for your Help and your script = hero
 
Last edited:

Sanfe

Dabbler
Joined
Apr 23, 2016
Messages
14
So... This morning I downloaded the last version, FreeNAS 11.2-RELEASE-U1 and made a fresh install it into my server (192.168.1.128:24)

I setup the dns service with no-ip, made the port routing, create the <db>,<files> and <portsnap> data sheets.

I create the nextcloud-config like this:

JAIL_IP="192.168.1.2" DEFAULT_GW_IP="192.168.1.1" INTERFACE="bge0" POOL_PATH="/mnt/wd2" JAIL_NAME="nextcloud" TIME_ZONE="Europe/Madrid" HOST_NAME="xxxxx.xxxxx.com" TEST_CERT="--test" STANDALONE_CERT=1 DNS_CERT=0 SELFSIGNED_CERT=1 NO_CERT=0

The main difference between today and yesterday is that I didn't write VNET="off". So... I proceed with the script, and like yesterday, I have 0 errors during the process, so the installation is sucessful. I have all the DB information, passwords...

I try to locally access to nextcloud with <192.168.1.2> and nothing happened. The same from outside, using my no.ip domain. I check the Jail, and I see that VNET is off, so I switch on and restart the Jail. The same, I can't access to next cloud locally and from outside my localnet.

I also restart the freenas server, but, I can't access to nextcloud...

Any idea?

You think its problem from the freenas version?
 

Sanfe

Dabbler
Joined
Apr 23, 2016
Messages
14
Set the interface to "vnet0". You'll also want to set SELFSIGNED_CERT to 0.

IT WORKS!!!!!!!!
To change SELFSIGNED_CERT to 0 I have to change in nextcloud-config and re-run the script?

Thanks a lot @danb35 for your script and your big help. +1
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
To change SELFSIGNED_CERT to 0 I have to change in nextcloud-config and re-run the script?
If you've already run the script and have it working, there's no need to make this change and re-run it--the STANDALONE_CERT will take precedence. But really, only one of the _CERT options should be set to 1.
 

gt2416

Patron
Joined
Feb 4, 2018
Messages
262
@danb35 Hey, from following your nextcloud 13 guide manually, theres a step where you ask us to change the zfs primary cache location with
zfs set primarycache=metadata YOURDRIVENAME/db

In your script however, you skip this step. I was wondering why we did it in the first place and how to revert that change if it is not needed.
Thanks
 

samuel-emrys

Contributor
Joined
Dec 14, 2018
Messages
136
@danb35 Hey, from following your nextcloud 13 guide manually, theres a step where you ask us to change the zfs primary cache location with
zfs set primarycache=metadata YOURDRIVENAME/db

In your script however, you skip this step. I was wondering why we did it in the first place and how to revert that change if it is not needed.
Thanks

I can't speak to why it's not in the script, but as for the effect it has:
This setting provides some optimisations specific to database storage, and should only be applied to your database directory. Since MariaDB has it’s own internal cache, it would be a waste of memory to cache the same thing in ZFS as well.

Further reading on the impact of tweaking this setting can be found on PatPro[1][2]. TLDR; Only ever set this to ‘metadata’ for database applications, and ‘all’ for everything else, otherwise you’ll have significant performance degradation.

Reference: How to install NextCloud 14/15 on FreeNAS 11.2 in an iocage jail with hardened security
 
Top