Tried updating Nextcloud plugin. Now it's broken.

NASNEWBY

Dabbler
Joined
Nov 13, 2023
Messages
19
Hi All.

If you're reading this, thanks for taking the time.

I built my first NAS back in February. It's been running TrueNas Core with the Nextcloud plugin and working a treat.
It recently started misbehaving and I thought I might be able to fix it by updating the plugin. Unfortunately the update did not complete, stating that it cannot skip big versions of Nextcloud to update to the latest version. What happened after I restarted it is that it seems to constantly try and update to the latest version and then give me the previous notification again.

This means that I cannot log in to my Nextcloud account until the update completes, but I cannot complete the update?

I then tried running the plugin update again, and now I'm presented with a completely different login screen that does not recognize my account details. Almost as if it wants me to create a new one?

I am really desperate now. I've been looking everywhere for answers, but I'm afraid I may have broken it completely and lost a lot of sentimental photos.

I would appreciate anyone helping me try to at least recover what was on these drives.

Thanks.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Your data is most probably perfectly fine.

Plugins are deprecated and - as you found out - broken. Don't use the plugin. Create a new standard well supported installation using the script provided by @danb35 instead. Once you have that up and running we will gladly help finding and moving your photos and other data.

Just do not delete the old plugin! Switch it to "off" and let it be for the time being.
 

NASNEWBY

Dabbler
Joined
Nov 13, 2023
Messages
19
Hi Patrick,

Thank you so much for your response.
I will complete the new installation and let you know once I'm ready for the next step.
 

Rajstopy

Dabbler
Joined
Dec 27, 2020
Messages
25
I there !

Just to add my two cents, I definitely avoid to use plugins on TrueNAS. Those are never updated, and lead to gaps between versions that are just impossible to reach. Despite of that, I do love TrueNAS and I'm not sorry I gave up on Synology... Now when I need to install a software in a jail, it takes me a little bit more time, but I issue the whole configuration manually. Its easier with following up with upgrades using the classical pkg update stuff... Moreover, using the powerful snapshot feature, there is almost zero risk when dealing with an update...

I installed some time ago a Nextcloud instance for my internal use using the plugin, but now I'm stuck because the upgrade gap is to huge. I'm going to install a new jail manually and transfer all the data...

R.
 

NASNEWBY

Dabbler
Joined
Nov 13, 2023
Messages
19
Hey guys,

I apologize for the stupid question.

I'm trying to follow the instructions from danb35, but I actually have no idea how to achieve the below:

Installation​

Download the repository to a convenient directory on your FreeNAS system by changing to that directory and running git clone https://github.com/danb35/freenas-iocage-nextcloud. Then change into the new freenas-iocage-nextcloud directory and create a file called nextcloud-config with your favorite text editor. In its minimal form, it would look like this:

JAIL_IP="192.168.1.199"
DEFAULT_GW_IP="192.168.1.1"
POOL_PATH="/mnt/tank"
TIME_ZONE="America/New_York"
HOST_NAME="YOUR_FQDN"
STANDALONE_CERT=1
CERT_EMAIL="you@yourdomain.com"

I'm not sure how to download to a convenient directory let alone the rest of that sentence.

I'm unfortunately pretty new to this but eager to learn.
I'd appreciate any info.

Thanks.
 

Attachments

  • Screenshot 2023-12-09 143952.png
    Screenshot 2023-12-09 143952.png
    29.6 KB · Views: 43

victort

Guru
Joined
Dec 31, 2021
Messages
973
Hey guys,

I apologize for the stupid question.

I'm trying to follow the instructions from danb35, but I actually have no idea how to achieve the below:

Installation​

Download the repository to a convenient directory on your FreeNAS system by changing to that directory and running git clone https://github.com/danb35/freenas-iocage-nextcloud. Then change into the new freenas-iocage-nextcloud directory and create a file called nextcloud-config with your favorite text editor. In its minimal form, it would look like this:

JAIL_IP="192.168.1.199"
DEFAULT_GW_IP="192.168.1.1"
POOL_PATH="/mnt/tank"
TIME_ZONE="America/New_York"
HOST_NAME="YOUR_FQDN"
STANDALONE_CERT=1
CERT_EMAIL="you@yourdomain.com"

I'm not sure how to download to a convenient directory let alone the rest of that sentence.

I'm unfortunately pretty new to this but eager to learn.
I'd appreciate any info.

Thanks.
In the TrueNAS shell, go to a directory that you want, cd /usr/local is what I alway do, the do git clone https://github.com/danb35/freenas-iocage-nextcloud the to enter that directory cd freenas-iocage-nextcloud and to create the config file inside that directory do edit nextcloud-config and fill in the config file with your IP and the rest. Then hit ESC and make sure to save the file, then do script nextcloud.log ./nextcloud-jail.sh to run the script.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Since your new it also bears mentioning that you should be doing this all via SSH and not the shell in the webUI.
 

NASNEWBY

Dabbler
Joined
Nov 13, 2023
Messages
19
Hey guys,

I'm slowly making progress...
I've ran the script and end up with the following:

root@truenas[~/freenas-iocage-nextcloud]# script nextcloud.log ./nextcloud-jail.sh
Script started, output file is nextcloud.log
+ id -u
+ [ 0 '=' 0 ]
+ JAIL_IP=''
+ JAIL_INTERFACES=''
+ DEFAULT_GW_IP=''
+ INTERFACE=vnet0
+ VNET=on
+ POOL_PATH=''
+ JAIL_NAME=nextcloud
+ TIME_ZONE=''
+ HOST_NAME=''
+ DATABASE=mariadb
+ DB_PATH=''
+ FILES_PATH=''
+ PORTS_PATH=''
+ CONFIG_PATH=''
+ THEMES_PATH=''
+ STANDALONE_CERT=0
+ SELFSIGNED_CERT=0
+ DNS_CERT=0
+ NO_CERT=0
+ CERT_EMAIL=''
+ DL_FLAGS=''
+ DNS_SETTING=''
+ CONFIG_NAME=nextcloud-config
+ NEXTCLOUD_VERSION=27
+ COUNTRY_CODE=US
+ readlink -f ./nextcloud-jail.sh
+ SCRIPT=/root/freenas-iocage-nextcloud/nextcloud-jail.sh
+ dirname /root/freenas-iocage-nextcloud/nextcloud-jail.sh
+ SCRIPTPATH=/root/freenas-iocage-nextcloud
+ [ -e /root/freenas-iocage-nextcloud/nextcloud-config ]
+ . /root/freenas-iocage-nextcloud/nextcloud-config
+ JAIL_IP=192.168.1.114
+ DEFAULT_GW_IP=192.168.1.1
+ POOL_PATH=/mnt/MeinallNAS/nextcloud
+ TIME_ZONE=Australia/Perth
+ HOST_NAME=YOUR_FQDN
+ NO_CERT=1
+ CERT_EMAIL=soanderou@gmail.com
+ INCLUDES_PATH=/root/freenas-iocage-nextcloud/includes
+ openssl rand -base64 12
+ ADMIN_PASSWORD=x/iKugpIq1WqLnkb
+ openssl rand -base64 16
+ DB_ROOT_PASSWORD='lAS2NWzynPCIrqMDlIQw9g=='
+ openssl rand -base64 16
+ DB_PASSWORD='WGz6epCkfmRWXgCPg0OEYg=='
+ [ mariadb '=' mariadb ]
+ DB_NAME=MariaDB
+ freebsd-version
+ cut -d - -f -1
+ RELEASE=13.1-RELEASE
+ [ 13.1-RELEASE '=' 13.1-RELEASE ]
+ RELEASE=13.2-RELEASE
+ iocage get -p
+ zfs get -H -o value mountpoint MeinallNAS/iocage
+ JAILS_MOUNT=/mnt/MeinallNAS/iocage
+ [ -z 192.168.1.114 ]
+ [ -z '' ]
+ echo 'JAIL_INTERFACES not set, defaulting to: vnet0:bridge0'
JAIL_INTERFACES not set, defaulting to: vnet0:bridge0
+ JAIL_INTERFACES=vnet0:bridge0
+ [ -z 192.168.1.1 ]
+ [ -z /mnt/MeinallNAS/nextcloud ]
+ [ -z Australia/Perth ]
+ [ -z YOUR_FQDN ]
+ [ 0 -eq 0 ]
+ [ 0 -eq 0 ]
+ [ 1 -eq 0 ]
+ [ 0 -eq 1 ]
+ [ 0 -eq 1 ]
+ [ 0 -eq 1 ]
+ [ 0 -eq 1 ]
+ [ -z '' ]
+ DB_PATH=/mnt/MeinallNAS/nextcloud/nextcloud/db
+ [ -z '' ]
+ FILES_PATH=/mnt/MeinallNAS/nextcloud/nextcloud/files
+ [ -z '' ]
+ CONFIG_PATH=/mnt/MeinallNAS/nextcloud/nextcloud/config
+ [ -z '' ]
+ THEMES_PATH=/mnt/MeinallNAS/nextcloud/nextcloud/themes
+ [ -z '' ]
+ PORTS_PATH=/mnt/MeinallNAS/nextcloud/portsnap
+ [ /mnt/MeinallNAS/nextcloud/nextcloud/db '=' /mnt/MeinallNAS/nextcloud/nextcloud/files ]
+ [ /mnt/MeinallNAS/nextcloud/nextcloud/files '=' /mnt/MeinallNAS/nextcloud/portsnap ]
+ [ /mnt/MeinallNAS/nextcloud/portsnap '=' /mnt/MeinallNAS/nextcloud/nextcloud/db ]
+ [ /mnt/MeinallNAS/nextcloud/nextcloud/config '=' /mnt/MeinallNAS/nextcloud/nextcloud/files ]
+ [ /mnt/MeinallNAS/nextcloud/nextcloud/config '=' /mnt/MeinallNAS/nextcloud/portsnap ]
+ [ /mnt/MeinallNAS/nextcloud/nextcloud/config '=' /mnt/MeinallNAS/nextcloud/nextcloud/db ]
+ [ /mnt/MeinallNAS/nextcloud/nextcloud/themes '=' /mnt/MeinallNAS/nextcloud/portsnap ]
+ [ /mnt/MeinallNAS/nextcloud/nextcloud/themes '=' /mnt/MeinallNAS/nextcloud/nextcloud/db ]
+ [ /mnt/MeinallNAS/nextcloud/nextcloud/themes '=' /mnt/MeinallNAS/nextcloud/nextcloud/config ]
+ [ /mnt/MeinallNAS/nextcloud/nextcloud/db '=' /mnt/MeinallNAS/nextcloud ]
+ [ /mnt/MeinallNAS/nextcloud/nextcloud/files '=' /mnt/MeinallNAS/nextcloud ]
+ [ /mnt/MeinallNAS/nextcloud/portsnap '=' /mnt/MeinallNAS/nextcloud ]
+ [ /mnt/MeinallNAS/nextcloud/nextcloud/config '=' /mnt/MeinallNAS/nextcloud ]
+ [ /mnt/MeinallNAS/nextcloud/nextcloud/themes '=' /mnt/MeinallNAS/nextcloud ]
+ echo 192.168.1.114
+ cut -f1 -d/
+ IP=192.168.1.114
+ echo 192.168.1.114
+ cut -f2 -d/
+ NETMASK=192.168.1.114
+ [ 192.168.1.114 '=' 192.168.1.114 ]
+ NETMASK=24
+ [ 24 -lt 8 ]
+ [ 24 -gt 30 ]
+ ls -A /mnt/MeinallNAS/nextcloud/nextcloud/config
ls: /mnt/MeinallNAS/nextcloud/nextcloud/config: No such file or directory
+ [ '' ]
+ cat
+ iocage create --name nextcloud -p /tmp/pkg.json -r 13.2-RELEASE 'interfaces=vnet0:bridge0' 'ip4_addr=vnet0|192.168.1.114/24' 'defaultrouter=192.168.1.1' 'boot=on' 'host_hostname=nextcloud' 'vnet=on'
Jail: nextcloud already exists!
+ echo 'Failed to create jail'
Failed to create jail
+ exit 1

I'm pretty sure I've messed up somewhere.
Could anyone point me in the right direction?

Thanks!
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Type iocage list - if there is a jail named "nextcloud", already, you cannot name the new one "nextcloud", too. Name it "mycloud" or "cloud" or whatever suits you but differently.
 

NASNEWBY

Dabbler
Joined
Nov 13, 2023
Messages
19
Hey guys,
Thanks for all your help and patience with me.

Renaming the plug in has helped, I am however stuck with the following after running the script:
"Stopped nextcloud due to VNET failure"

I'm guessing its to do with the IP address I've provided?
How would I obtain the correct DEFAULT GW and JAIL IP addresses?

Thanks
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You define them according to the structure of your existing network. The default gateway is the same your PC has and the TrueNAS host should have. The IP address must be a free one in the same network as your TrueNAS host and your PC.
 

ddaenen1

Patron
Joined
Nov 25, 2019
Messages
318
Honestly, you jumped the gun too fast. At the point that it wanted to update again and again, it would have been sufficient to edit one parameter in the config.php file to turn that off. Even if it would have been completely broken, recovering the data would have been dead-easy with an FTP client, as i have done many times.

Up until now, i have had a couple of screw-ups, mostly due to me being too impatient and reading up before doing stuff. In every case, i was able to fix the installation or recover the data.
 

NASNEWBY

Dabbler
Joined
Nov 13, 2023
Messages
19
Thanks, I fixed that and it made its way to "Installing pkg..."
Unfortunately it resulted in "pkg failed to install, retry #1"

It also seems that "pkg.freebsd.org's SRV record could not be verified."
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Default gateway? DNS server? These are the probable causes. The jail needs Internet access.

You have some router with a DHCP service in your network, right? Do you have access to the UI of this box? You might want to compare the settings.
 

NASNEWBY

Dabbler
Joined
Nov 13, 2023
Messages
19
Hey guys,
I've been on vacation and back trying to figure this out now.

I ended up finding that I had my IP address incorrectly configured and it managed to get most of the install completed until it got to Caddy:

import (
caddycmd "github.com/caddyserver/caddy/v2/cmd"

// plug in Caddy modules here
_ "github.com/caddyserver/caddy/v2/modules/standard"
)

func main() {
caddycmd.Main()
}
2024/01/15 03:38:03 [INFO] Initializing Go module
2024/01/15 03:38:03 [INFO] exec (timeout=0s): /usr/local/bin/go mod init caddy
go: creating new go.mod: module caddy
go: to add module requirements and sums:
go mod tidy
2024/01/15 03:38:03 [INFO] Pinning versions
2024/01/15 03:38:03 [INFO] exec (timeout=0s): /usr/local/bin/go get -d -v github.com/caddyserver/caddy/v2
go: module github.com/caddyserver/caddy/v2: Get "https://proxy.golang.org/github.com/caddyserver/caddy/v2/@v/list": dial tcp [2404:6800:4006:80a::2011]:443: connect: no route to host
2024/01/15 03:38:03 [FATAL] exit status 1
Command: xcaddy build --output /usr/local/bin/caddy failed!
+ echo 'Failed to build Caddy without plugin, terminating.'
Failed to build Caddy without plugin, terminating.
+ exit 1

Please note the below config I'm currently running:

JAIL_IP="192.168.X.XXX/24"
DEFAULT_GW_IP="192.168.X.XXX"
POOL_PATH="/mnt/MeinallNAS/nextcloud"
TIME_ZONE="Australia/Perth"
HOST_NAME="soanderou.com"
NO_CERT=1
CERT_EMAIL="XXXXXXXX@gmail.com"

I'm currently hosting through google and I think this might be why it isn't working?
Should I move to Cloudflare to fix this?
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
Hey guys,
I've been on vacation and back trying to figure this out now.

I ended up finding that I had my IP address incorrectly configured and it managed to get most of the install completed until it got to Caddy:

import (
caddycmd "github.com/caddyserver/caddy/v2/cmd"

// plug in Caddy modules here
_ "github.com/caddyserver/caddy/v2/modules/standard"
)

func main() {
caddycmd.Main()
}
2024/01/15 03:38:03 [INFO] Initializing Go module
2024/01/15 03:38:03 [INFO] exec (timeout=0s): /usr/local/bin/go mod init caddy
go: creating new go.mod: module caddy
go: to add module requirements and sums:
go mod tidy
2024/01/15 03:38:03 [INFO] Pinning versions
2024/01/15 03:38:03 [INFO] exec (timeout=0s): /usr/local/bin/go get -d -v github.com/caddyserver/caddy/v2
go: module github.com/caddyserver/caddy/v2: Get "https://proxy.golang.org/github.com/caddyserver/caddy/v2/@v/list": dial tcp [2404:6800:4006:80a::2011]:443: connect: no route to host
2024/01/15 03:38:03 [FATAL] exit status 1
Command: xcaddy build --output /usr/local/bin/caddy failed!
+ echo 'Failed to build Caddy without plugin, terminating.'
Failed to build Caddy without plugin, terminating.
+ exit 1

Please note the below config I'm currently running:

JAIL_IP="192.168.X.XXX/24"
DEFAULT_GW_IP="192.168.X.XXX"
POOL_PATH="/mnt/MeinallNAS/nextcloud"
TIME_ZONE="Australia/Perth"
HOST_NAME="soanderou.com"
NO_CERT=1
CERT_EMAIL="XXXXXXXX@gmail.com"

I'm currently hosting through google and I think this might be why it isn't working?
Should I move to Cloudflare to fix this?
This sounds like you might not have properly configured your gateway and such.

Can you confirm your default gateway and dns server on your truenas host is set?
 

NASNEWBY

Dabbler
Joined
Nov 13, 2023
Messages
19
This sounds like you might not have properly configured your gateway and such.

Can you confirm your default gateway and dns server on your truenas host is set?
Sorry mate, pretty new to this.
What's the best way to confirm these?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Network > Global Configuration - Nameserver 1 and IPv4 Default Gateway fields must have proper values.
 

NASNEWBY

Dabbler
Joined
Nov 13, 2023
Messages
19
Thanks Patrick,

I can confirm they're all blank.
I've created a nameserver on my google domain. Waiting for it to propagate, then I'll insert the details and try again.
Hoping this is what I'm supposed to do?

Thanks for the info.
 
Top