Update stuck at "Update in process"

Update from 22.1 to 22.2
Today i tried to update my instance from 22.1.x to 22.2.0. I always had problems with the update GUI and I end up doing a manual update with occ.sh.

This time I first tried with the GUI, but the installer got stuck at the step “deleting old files”. I searched for a solution and find out that I had to set the right ownership. Did it, but nothing changed.

Then I tried with with "occ upgrade” but it fails showing this:

Could not open input file: /usr/local/www/nextcloud/occ
ld-elf.so.1: /usr/local/lib/php/20190902/imagick.so: Undefined symbol "omp_pause_resource_all@VERSION"

Now it shows a white page with only “Update in process.” write in it.
And nextcloud is not working.

Nextcloud is running on freebsd on a truenas jail.
The webserver user is www.

ls -la of nextcloud folder

drwxr-x---   9 www   www    13 Oct 26 12:18 .
drwxr-xr-x   6 root  wheel   7 Sep  7 01:23 ..
drwxr-xr-x  13 www   www    13 Oct 24 19:31 apps
drwxr-xr-x  48 www   www    48 Aug 26 15:25 apps-pkg
drwxr-xr-x   2 www   www     7 Oct 26 12:18 config
drwxrwx---  14 www   www    18 Aug 31 08:11 data
-rw-r--r--   1 www   www    57 Oct 26 12:18 index.php
-rw-r--r--   1 www   www    57 Oct 26 12:18 public.php
-rw-r--r--   1 www   www    57 Oct 26 12:18 remote.php
drwxr-xr-x   4 www   www     8 Sep  7 01:23 resources
-rw-r--r--   1 www   www    57 Oct 26 12:18 status.php
drwxr-xr-x   2 www   www     2 Oct 26 12:18 themes
drwxr-xr-x   2 www   www     4 Sep  7 01:23 updater

The output of updater.log:

2021-10-26T10:20:43+0000 rcjZBjgyqi [info] rollbackChanges("9")
2021-10-26T10:20:43+0000 rcjZBjgyqi [info] unlink .step
2021-10-26T10:20:43+0000 rcjZBjgyqi [info] rollbackChanges - step >= 7
2021-10-26T10:20:43+0000 rcjZBjgyqi [info] end of  rollbackChanges()
2021-10-26T10:20:44+0000 vLeb7ZCRIh [info] request to updater
2021-10-26T10:20:44+0000 vLeb7ZCRIh [info] currentStep()
2021-10-26T10:20:44+0000 vLeb7ZCRIh [info] POST request for step "9"
2021-10-26T10:20:44+0000 vLeb7ZCRIh [info] startStep("9")
2021-10-26T10:20:44+0000 vLeb7ZCRIh [info] deleteOldFiles()
2021-10-26T10:20:44+0000 vLeb7ZCRIh [error] POST request failed with other exception
2021-10-26T10:20:44+0000 vLeb7ZCRIh [error] Exception: Exception
Message: core/shipped.json is not available
Code:0
Trace:
#0 /usr/local/www/nextcloud/updater/index.php(1385): Updater->deleteOldFiles()
#1 {main}
File:/usr/local/www/nextcloud/updater/index.php
Line:925

2021-10-26T10:20:44+0000 vLeb7ZCRIh [info] rollbackChanges("9")
2021-10-26T10:20:44+0000 vLeb7ZCRIh [info] unlink .step
2021-10-26T10:20:44+0000 vLeb7ZCRIh [info] rollbackChanges - step >= 7
2021-10-26T10:20:44+0000 vLeb7ZCRIh [info] end of  rollbackChanges()
2021-10-26T10:32:47+0000 ZBqAisDQQX [info] request to updater
2021-10-26T10:32:47+0000 ZBqAisDQQX [info] currentStep()
2021-10-26T10:32:47+0000 ZBqAisDQQX [info] POST request for step "9"
2021-10-26T10:32:47+0000 ZBqAisDQQX [info] startStep("9")
2021-10-26T10:32:47+0000 ZBqAisDQQX [info] deleteOldFiles()
2021-10-26T10:32:47+0000 ZBqAisDQQX [error] POST request failed with other exception
2021-10-26T10:32:47+0000 ZBqAisDQQX [error] Exception: Exception
Message: core/shipped.json is not available
Code:0
Trace:
#0 /usr/local/www/nextcloud/updater/index.php(1385): Updater->deleteOldFiles()
#1 {main}
File:/usr/local/www/nextcloud/updater/index.php
Line:925

2021-10-26T10:32:47+0000 ZBqAisDQQX [info] rollbackChanges("9")
2021-10-26T10:32:47+0000 ZBqAisDQQX [info] unlink .step
2021-10-26T10:32:47+0000 ZBqAisDQQX [info] rollbackChanges - step >= 7
2021-10-26T10:32:47+0000 ZBqAisDQQX [info] end of  rollbackChanges()
2021-10-26T10:33:50+0000 1TuiTyghIa [info] request to updater
2021-10-26T10:33:50+0000 1TuiTyghIa [info] currentStep()
2021-10-26T10:33:50+0000 1TuiTyghIa [info] POST request for step "9"
2021-10-26T10:33:50+0000 1TuiTyghIa [info] startStep("9")
2021-10-26T10:33:50+0000 1TuiTyghIa [info] deleteOldFiles()
2021-10-26T10:33:50+0000 1TuiTyghIa [error] POST request failed with other exception
2021-10-26T10:33:50+0000 1TuiTyghIa [error] Exception: Exception
Message: core/shipped.json is not available
Code:0
Trace:
#0 /usr/local/www/nextcloud/updater/index.php(1385): Updater->deleteOldFiles()
#1 {main}
File:/usr/local/www/nextcloud/updater/index.php
Line:925

2021-10-26T10:33:50+0000 1TuiTyghIa [info] rollbackChanges("9")
2021-10-26T10:33:50+0000 1TuiTyghIa [info] unlink .step
2021-10-26T10:33:50+0000 1TuiTyghIa [info] rollbackChanges - step >= 7
2021-10-26T10:33:50+0000 1TuiTyghIa [info] end of  rollbackChanges()

It seems it was an imagick problem.
I resoved updating the jail and the nextcloud plugin in freenas. After a restart i, managed to update with occ upgrade as usual.