Upgrade nextcloud jail from FreeNAS to TrueNAS failed

liming

Cadet
Joined
Nov 20, 2020
Messages
2
Upgrade Freenas 11.3 to TrureNAS 12.2, the system is working well.
Try to upgrade nextcloud jail, follow those steps

1. iocage fetch (choose 12.2-RELEASE)
2. iocage upgrade -r 12.2-RELEASE nextcloud
got those logs as below and Nextcloud service show Internal Server Error

Snapshotting nextcloud...
Updating plugin INDEX...
Running upgrade...
Snapshotting nextcloud...
Updating plugin INDEX...
Updating plugin artifact...

Branch 12.2-RELEASE does not exist at https://github.com/freenas/iocage-plugin-nextcloud.git!
Using "master" branch for plugin, this may not work with your RELEASE
Removing old pkgs...
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 118 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
ImageMagick7-nox11: 7.0.10.24_1
avahi-app: 0.7_3
bash: 5.0.18_3
bash-completion: 2.11,2
ca_root_nss: 3.58
cups: 2.3.3_1
curl: 7.73.0
cyrus-sasl: 2.1.27_1
dbus: 1.12.20_3
dbus-glib: 0.110
expat: 2.2.8
fftw3: 3.3.8_6
fontconfig: 2.13.92_2,1
freetype2: 2.10.4
gdbm: 1.18.1_1
gettext-runtime: 0.21
ghostscript9-agpl-base: 9.52_11
giflib: 5.2.1
glib: 2.66.2,1
gmp: 6.2.0
gnome_subr: 1.0
gnutls: 3.6.15
gobject-introspection: 1.66.1,1
groff: 1.22.4_3
gsfonts: 8.11_8
icu: 68.1,1
indexinfo: 0.3.1
jbig2dec: 0.19
jbigkit: 2.1_1
jpeg-turbo: 2.0.5
lcms2: 2.11_1
libICE: 1.0.10,1
libSM: 1.2.3,1
libX11: 1.6.12,1
libXau: 1.0.9
libXdmcp: 1.1.3
libargon2: 20190702
libdaemon: 0.14_1
libedit: 3.1.20191231,1
libevent: 2.1.12
libffi: 3.3_1
libgcrypt: 1.8.7
libgd: 2.3.0,1
libgpg-error: 1.39
libiconv: 1.16
libidn: 1.35
libidn2: 2.3.0_1
liblqr-1: 0.4.2
libltdl: 2.4.6
liblz4: 1.9.2_1,1
libnghttp2: 1.41.0
libpaper: 1.1.24.4
libpthread-stubs: 0.4
libraw: 0.19.5
libtasn1: 4.16.0
libunistring: 0.9.10_1
libwmf-nox11: 0.2.8.4_15
libxcb: 1.14_1
libxml2: 2.9.10_1
libxslt: 1.1.34_1
libzip: 1.5.2
mysql57-client: 5.7.32
mysql57-server: 5.7.32
nettle: 3.6
nextcloud-php74: 20.0.1
nginx: 1.18.0_30,2
oniguruma: 6.9.6
openjpeg: 2.3.1
openldap-client: 2.4.51
p11-kit: 0.23.21
pcre: 8.44
pcre2: 10.35
perl5: 5.32.0
php74: 7.4.12
php74-bcmath: 7.4.12
php74-bz2: 7.4.12
php74-ctype: 7.4.12
php74-curl: 7.4.12
php74-dom: 7.4.12
php74-exif: 7.4.12
php74-fileinfo: 7.4.12
php74-filter: 7.4.12
php74-gd: 7.4.12
php74-gmp: 7.4.12
php74-iconv: 7.4.12
php74-intl: 7.4.12_1
php74-json: 7.4.12
php74-ldap: 7.4.12
php74-mbstring: 7.4.12
php74-opcache: 7.4.12
php74-openssl: 7.4.12
php74-pdo: 7.4.12
php74-pdo_mysql: 7.4.12
php74-pecl-APCu: 5.1.19
php74-pecl-imagick-im7: 3.4.4_2
php74-posix: 7.4.12
php74-session: 7.4.12
php74-simplexml: 7.4.12
php74-xml: 7.4.12
php74-xmlreader: 7.4.12
php74-xmlwriter: 7.4.12
php74-xsl: 7.4.12
php74-zip: 7.4.12
php74-zlib: 7.4.12
pkg: 1.15.10
pkgconf: 1.7.3,1
png: 1.6.37
poppler-data: 0.4.10
protobuf: 3.13.0,1
psutils: 1.17_5
python37: 3.7.9_1
readline: 8.0.4
tiff: 4.1.0
tpm-emulator: 0.7.4_2
trousers: 0.3.14_3
uchardet: 0.0.7
webp: 1.1.0
xorgproto: 2020.1

Number of packages to be removed: 118

The operation will free 1 GiB.
[nextcloud] [1/118] Deinstalling php74-pecl-imagick-im7-3.4.4_2...
[nextcloud] [1/118] Deleting files for php74-pecl-imagick-im7-3.4.4_2: .......... done
[nextcloud] [2/118] Deinstalling ImageMagick7-nox11-7.0.10.24_1...
[nextcloud] [2/118] Deinstalling ImageMagick7-nox11-7.0.10.24_1...
pkg: Failed to execute lua script: [string "args = {}..."]:11: attempt to call a nil value (field 'filecmp')
[nextcloud] [2/118] Deinstalling ImageMagick7-nox11-7.0.10.24_1...
pkg: lua script failed
pkg: lua script failed
pkg: lua script failed
pkg: lua script failed
pkg: lua script failed
pkg: lua script failed
pkg: lua script failed
pkg: lua script failed
pkg: lua script failed
pkg: lua script failed
pkg: lua script failed
[nextcloud] [2/118] Deleting files for ImageMagick7-nox11-7.0.10.24_1: .......... done
pkg: lua script failed
pkg: lua script failed
[nextcloud] [3/118] Deinstalling ghostscript9-agpl-base-9.52_11...
[nextcloud] [3/118] Deleting files for ghostscript9-agpl-base-9.52_11: .......... done
pkg: lua script failed
[nextcloud] [4/118] Deinstalling cups-2.3.3_1...
pkg: lua script failed
[nextcloud] [4/118] Deinstalling cups-2.3.3_1...
pkg: Failed to execute lua script: [string "args = {}..."]:11: attempt to call a nil value (field 'filecmp')
[nextcloud] [4/118] Deinstalling cups-2.3.3_1...
pkg: lua script failed

[nextcloud] [4/118] Deleting files for cups-2.3.3_1: .......... done
pkg: lua script failed
==> You should manually remove the "cups" user.
pkg: lua script failed
==> You should manually remove the "cups" group
pkg: lua script failed
[nextcloud] [5/118] Deinstalling avahi-app-0.7_3...
pkg: lua script failed
[nextcloud] [5/118] Deinstalling avahi-app-0.7_3...
pkg: Failed to execute lua script: [string "args = {}..."]:11: attempt to call a nil value (field 'filecmp')
[nextcloud] [5/118] Deinstalling avahi-app-0.7_3...
pkg: lua script failed

[nextcloud] [5/118] Deleting files for avahi-app-0.7_3: .......... done
pkg: lua script failed
==> You should manually remove the "avahi" user.
pkg: lua script failed
==> You should manually remove the "avahi" group
pkg: lua script failed
[nextcloud] [6/118] Deinstalling nextcloud-php74-20.0.1...
pkg: lua script failed

TL;DR

[nextcloud] [118/118] Deinstalling xorgproto-2020.1...
[nextcloud] [118/118] Deleting files for xorgproto-2020.1: .......... done
pkg: lua script failed
Installing new pkgs...

Testing Host DNS response to pkg.FreeBSD.org
Testing nextcloud's SRV response to pkg.FreeBSD.org
Testing nextcloud's DNSSEC response to pkg.FreeBSD.org

Installing plugin packages:
- nextcloud-php74...
- php74-pecl-imagick-im7...
- php74-bcmath...
- php74-gmp...
- nginx...
- mysql57-server...

Branch 12.2-RELEASE does not exist at https://github.com/freenas/iocage-plugin-nextcloud.git!
Using "master" branch for plugin, this may not work with your RELEASE

nextcloud successfully upgraded!
 

liming

Cadet
Joined
Nov 20, 2020
Messages
2
ok...solve the issue

iocage console nextcloud to find mysql server didn't run.
Download the latest nextcloud zip file to replace origin html files and run occ upgrade again.
Nextcloud come back!
 

omid_1985

Dabbler
Joined
Aug 22, 2018
Messages
10
ok...solve the issue

iocage console nextcloud to find mysql server didn't run.
Download the latest nextcloud zip file to replace origin html files and run occ upgrade again.
Nextcloud come back!

Could you please explain more about what exactly you did to fix your issue?
I've done
1. iocage fetch (choose 12.2-RELEASE)
2. iocage upgrade -r 12.2-RELEASE nextcloud
And I have internal server error too.

"Download the latest nextcloud.zip" - From where? Have you done it inside the jail?
"replace origin html files" - Does this mean unzipping the nextcloud.zip and copy everything from ? to ?
"run occ upgrade again" - I assume after all above I need to type occ upgrade inside the jail?
 

omid_1985

Dabbler
Joined
Aug 22, 2018
Messages
10
Moved from scripted installation to official plugin as I already have reverse proxy and ACME package. Everything working again.
 
Last edited:

ManNorb

Cadet
Joined
Dec 23, 2020
Messages
6
@liming I would be very happy if could elaborate how you solved the issue with Nextcloud after the upgrade to Truenas. I got the same problem and don't want to reinstall the complete plugin.
 

ManNorb

Cadet
Joined
Dec 23, 2020
Messages
6
ok...solve the issue

iocage console nextcloud to find mysql server didn't run.
Download the latest nextcloud zip file to replace origin html files and run occ upgrade again.
Nextcloud come back!

@liming I would be very happy if could elaborate how you solved the issue with Nextcloud after the upgrade to Truenas. I got the same problem and don't want to reinstall the complete plugin
 

warriorcookie

Explorer
Joined
Apr 17, 2017
Messages
67
Not sure if you found the solution but here's how I fixed mine. Keep in mind I'm not using a plugin, just a Jail that I manually installed everything. This might not be completely accurate but should get you close enough to poke around and figure it out.

iocage upgrade -r 12.2-RELEASE nextcloud resulted in a 404 not found error. There's a freebsd issue that points to the wrong URL.

As per https://github.com/iocage/iocage/issues/1237#issuecomment-749516537
On the truenas/freenas host edit /usr/local/lib/python3.8/site-packages/iocage_lib/ioc_upgrade.py:

Code:
OLD
<         f_rel = f'{self.new_release.rsplit("-RELEASE")[0]}.0'
<         f = 'https://raw.githubusercontent.com/freebsd/freebsd' \
<             f'/release/{f_rel}/usr.sbin/freebsd-update/freebsd-update.sh'
---
NEW
>         f_rel = f'{self.new_release.split(".")[0]}'
>         f = f'https://raw.githubusercontent.com/freebsd/freebsd' \
>             f'/stable/{f_rel}/usr.sbin/freebsd-update/freebsd-update.sh'


trying iocage upgrade -r 12.2-RELEASE nextcloud now works.
Then on the nextcloud guest (iocage consoled nextcloud) pkg update && pkg upgrade

For me I use mariadb so after update run mariadb-upgrade (I actually needed mariadb-upgrade -u root -p)
Also, the socket location moved. In your nextcloud directory navigate to config directory and edit config.php
Code:
OLD
<    'dbhost' => 'localhost:/tmp/mysql.sock',
---
NEW
>    'dbhost' => 'localhost:/var/run/mysql/mysql.sock',


service apache24 restart
in your browser navigate to your nextcloud address and see if it's up.

If not, then try in your nextcloud directory:
sudo -u www php occ maintenance:repair (change www to whatever user has ownership of occ, might be www-data)
service apache24 restart

good luck.
 

ManNorb

Cadet
Joined
Dec 23, 2020
Messages
6
Not sure if you found the solution but here's how I fixed mine. Keep in mind I'm not using a plugin, just a Jail that I manually installed everything. This might not be completely accurate but should get you close enough to poke around and figure it out.

iocage upgrade -r 12.2-RELEASE nextcloud resulted in a 404 not found error. There's a freebsd issue that points to the wrong URL.

As per https://github.com/iocage/iocage/issues/1237#issuecomment-749516537
On the truenas/freenas host edit /usr/local/lib/python3.8/site-packages/iocage_lib/ioc_upgrade.py:

Code:
OLD
<         f_rel = f'{self.new_release.rsplit("-RELEASE")[0]}.0'
<         f = 'https://raw.githubusercontent.com/freebsd/freebsd' \
<             f'/release/{f_rel}/usr.sbin/freebsd-update/freebsd-update.sh'
---
NEW
>         f_rel = f'{self.new_release.split(".")[0]}'
>         f = f'https://raw.githubusercontent.com/freebsd/freebsd' \
>             f'/stable/{f_rel}/usr.sbin/freebsd-update/freebsd-update.sh'


trying iocage upgrade -r 12.2-RELEASE nextcloud now works.
Then on the nextcloud guest (iocage consoled nextcloud) pkg update && pkg upgrade

Hi and thanks for your reply!

I'm still stuck at upgrading my jail from 12.1 to 12.2 even after chaning the lines in /usr/local/lib/python3.8/site-packages/iocage_lib/ioc_upgrade.py

Still getting Branch 12.2-RELEASE does not exist at https://github.com/freenas/iocage-plugin-nextcloud.git! using master branch release.

And when trying to access nextcloud web I get :

Internal Server Error

The server encountered an internal error and was unable to complete your request.

Any other ideas ?
 

warriorcookie

Explorer
Joined
Apr 17, 2017
Messages
67
Hi and thanks for your reply!

I'm still stuck at upgrading my jail from 12.1 to 12.2 even after chaning the lines in /usr/local/lib/python3.8/site-packages/iocage_lib/ioc_upgrade.py

Still getting Branch 12.2-RELEASE does not exist at https://github.com/freenas/iocage-plugin-nextcloud.git! using master branch release.

And when trying to access nextcloud web I get :

Internal Server Error

The server encountered an internal error and was unable to complete your request.

Any other ideas ?

Sorry I don't use the plugin myself so I suspect there's additional issues I didn't experience.

During the course of trying to fix this I broke my freenas jail a couple times and had to restore snapshots to get back to square one with a working instance, albeit depreciated. Hopefully you can do the same?
 

Baenwort

Explorer
Joined
Feb 19, 2015
Messages
93
Hi and thanks for your reply!

I'm still stuck at upgrading my jail from 12.1 to 12.2 even after chaning the lines in /usr/local/lib/python3.8/site-packages/iocage_lib/ioc_upgrade.py

Still getting Branch 12.2-RELEASE does not exist at https://github.com/freenas/iocage-plugin-nextcloud.git! using master branch release.

This is because the maintainer of the nextcloud plugin instructions (what is contained at https://github.com/freenas/iocage-plugin-nextcloud.git ) have not created a 12.2-RELEASE branch. Now this is not necessarily a problem if the particular pkg doesn't have any breaking changes between releases or changes in dependencies.

If there is then someone will need to pull a change in and create a VERSION-RELEASE branch of both the install directions git (the one you linked) and the actual plug in steps in: https://github.com/ix-plugin-hub/iocage-plugin-index/ under the correct branch.

Basically the warning you are receiving indicates that either no-one has tested this particular release or that your plug in is being maintained by people who aren't using the VERSION-RELEASE branch strategy to indicate to people that the plug in has been tested against that particular release.
 

ManNorb

Cadet
Joined
Dec 23, 2020
Messages
6
I gave up with the plugin and created a standalone jail of version 12-2 and then installed nextcloud manually. Now I have an new working installation.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,974
It's easy enough to install the nextcloud package that I don't know why more users don't just go that route. It gets updated regularly and you're not bound by the constraints of the plugin.
 

microwave

Cadet
Joined
Jul 28, 2021
Messages
2
Hi,
Can anybody assist with the error below. After doing the following commends below in TrueNas
1. iocage fetch (choose 12.2-RELEASE)
2. iocage upgrade -r 12.2-RELEASE nextcloud
3. pkg update
4. pkg upgrade
I get the following error below...I used the TrueNAS Nextcloud Plugin.
Type:
pluginv2

NextCloud22-Err.jpg

MySQL is running logging to '/var/db/mysql/nextcloud.err'.
------------------------
2021-07-29T04:24:25.6NZ mysqld_safe Logging to '/var/db/mysql/nextcloud.err'.
2021-07-29T04:24:25.6NZ mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
2021-07-29T04:24:25.294990Z 0 [Warning] [MY-011069] [Server] The syntax '--master-info-repository' is deprecated and will be removed in a future release.
2021-07-29T04:24:25.294998Z 0 [Warning] [MY-011069] [Server] The syntax '--relay-log-info-repository' is deprecated and will be removed in a future release.
2021-07-29T04:24:25.295025Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2021-07-29T04:24:25.295154Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2021-07-29T04:24:25.295165Z 0 [Warning] [MY-011069] [Server] The syntax '--master-info-repository' is deprecated and will be removed in a future release.
2021-07-29T04:24:25.295169Z 0 [Warning] [MY-011069] [Server] The syntax '--relay-log-info-repository' is deprecated and will be removed in a future release.
2021-07-29T04:24:25.295178Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2021-07-29T04:24:25.295197Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2021-07-29T04:24:25.296197Z 0 [System] [MY-010116] [Server] /usr/local/libexec/mysqld (mysqld 8.0.25) starting as process 28361
2021-07-29T04:24:25.391541Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-07-29T04:24:27.445582Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-07-29T04:24:27.703876Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock
2021-07-29T04:24:28.434739Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-07-29T04:24:28.434885Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-07-29T04:24:28.817287Z 0 [System] [MY-010931] [Server] /usr/local/libexec/mysqld: ready for connections. Version: '8.0.25' socket: '/tmp/mysql.sock' port: 3306 Source distribution.
---------------------
 

microwave

Cadet
Joined
Jul 28, 2021
Messages
2
Hi it's me again.
Is there a way to restore the old Nextcloud in Truenas if there is no solution to the above error? I tried rolling back the snapshot in Truenas but it did not fix the error above. I would appreciate a very simple basic step by step of how to go about doing it. English is my second language so please no big words.
 
Top