OPNsense Forum

English Forums => Tutorials and FAQs => Topic started by: bfoss on March 19, 2022, 12:32:48 am

Title: Questions regarding potential errors during update process
Post by: bfoss on March 19, 2022, 12:32:48 am
Hi there, I've been working on a method to upgrade OPNsense offline through the provided `opnsense-update` CLI tool using local update files. I've gotten it to work successfully, but it does throw some exceptions and failures during the process that leave me wondering if I should be concerned or not.

Note: These errors only occur during subsequent reboots during the upgrade process and I don't see them again following the final reboot.

I'll list the issues I'm seeing during initial reboots below and I'm hoping someone can chime in on whether or not these are expected or should be addressed.

- `pkg` is upgraded and then fails to execute the lua script:

Code: [Select]
New version of pkg detected; it needs to be installed first.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
         pkg: 1.12.0_1 -> 1.16.3_1

Number of packages to be upgraded: 1
[1/1] Upgrading pkg from 1.12.0_1 to 1.16.3.1...
[1/1] Extracting pkg-1.16.3_1: .......... done
pkg-static: Failed to execute lua script: [string "-- args: etc/pkg.conf.sample..."]:12: attempt to call a nil value (field 'stat')

- While checking package integrity, there are conflicting packages between the new version and previous version:

One example:
Code: [Select]
- php74-sockets-7.4.28 conflicts with php73-sockets-7.3.20 on /usr/local/etc/php/ext-20-sockets.ini

- There are missing packages during package extraction:

One example:
Code: [Select]
[100.177] Extracting brotli-1.0.9,1: .........brotli-1.0.7_2,1: missing file /usr/local/lib/libbrotlicommon.so.1.0.7
done
brotli-1.0.7_2,1: missing file /usr/local/lib/libbrotlidec.so.1.0.7
brotli-1.0.7_2,1: missing file /usr/local/lib/libbrotlienc.so.1.0.7
brotli-1.0.7_2,1: missing file /usr/local/share/licenses/brotli-1.0.7_2,1/LICENSE
brotli-1.0.7_2,1: missing file /usr/local/share/licenses/brotli-1.0.7_2,1/brotli-1.0.7_2,1/MIT
brotli-1.0.7_2,1: missing file /usr/local/share/licenses/brotli-1.0.7_2,1/catalog.mk

- There are uncaught errors while extracting packages of plugins I already have installed:

Code: [Select]
[175/177] Upgrading os-nginx from 1.19 to 1.26...
[175/177] Extracting os-nginx-1.26: .......... done
Starting configd.

Fatal error: Uncaught Error: Class 'Phalcon\Validation\Validator' not found in /                                                                                                                                                                             usr/local/opnsense/mvc/app/models/OPNsense/Base/Validators/NetworkValidator.php:                                                                                                                                                                             41
Stack trace:
#0 [internal function]: unknown()
#1 [internal function]: Phalcon\Loader->autoLoad('OPNsense\\Base\\V...')
#2 [internal function]: spl_autoload_call('OPNsense\\Base\\V...')
#3 /usr/local/opnsense/mvc/script/run_migrations.php(52): ReflectionClass->__con                                                                                                                                                                             struct('OPNsense\\Base\\V...')
#4 {main}
  thrown in /usr/local/opnsense/mvc/app/models/OPNsense/Base/Validators/NetworkV                                                                                                                                                                             alidator.php on line 41

Notice: Undefined variable: field_rfcls in /usr/local/opnsense/mvc/app/models/OP                                                                                                                                                                             Nsense/Base/BaseModel.php on line 150

Notice: Trying to get property 'name' of non-object in /usr/local/opnsense/mvc/a                                                                                                                                                                             pp/models/OPNsense/Base/BaseModel.php on line 150

Fatal error: Uncaught OPNsense\Base\ModelException: class  of wrong type in mode                                                                                                                                                                             l definition in /usr/local/opnsense/mvc/app/models/OPNsense/Base/BaseModel.php:1                                                                                                                                                                             50
Stack trace:
#0 /usr/local/opnsense/mvc/app/models/OPNsense/Base/BaseModel.php(196): OPNsense                                                                                                                                                                             \Base\BaseModel->getNewField('OPNsense\\Base\\F...')
#1 /usr/local/opnsense/mvc/app/models/OPNsense/Base/BaseModel.php(267): OPNsense                                                                                                                                                                             \Base\BaseModel->parseXml(Object(SimpleXMLElement), NULL, Object(OPNsense\Base\F                                                                                                                                                                             ieldTypes\ContainerField))
#2 /usr/local/opnsense/mvc/app/models/OPNsense/Base/BaseModel.php(328): OPNsense                                                                                                                                                                             \Base\BaseModel->parseXml(Object(SimpleXMLElement), Object(SimpleXMLElement), Ob                                                                                                                                                                             ject(OPNsense\Base\FieldTypes\ContainerField))
#3 [internal function]: OPNsense\Base\BaseModel->__construct()
#4 /usr/local/opnsense/mvc/script/run_migrations.php(55): ReflectionClass->newIn                                                                                                                                                                             stance()
#5 {main}
  thrown in /usr/local/opnsense/mvc/app/models/OPNsense/Base/BaseModel.php on li                                                                                                                                                                             ne 150
Reloading plugin configuration
Configuring system logging...
Fatal error: Uncaught Error: Call to undefined method Phalcon\Logger\Adapter\Sys                                                                                                                                                                             log::error() in /usr/local/opnsense/mvc/app/library/OPNsense/Core/Backend.php:95
Stack trace:
#0 /usr/local/etc/inc/legacy_bindings.inc(41): OPNsense\Core\Backend->configdRun                                                                                                                                                                             ('template reload...', false)
#1 /usr/local/etc/inc/system.inc(605): configd_run('template reload...')
#2 /usr/local/etc/rc.configure_plugins(45): system_syslogd_start(true)
#3 {main}
  thrown in /usr/local/opnsense/mvc/app/library/OPNsense/Core/Backend.php on lin                                                                                                                                                                             e 95
Reloading template OPNsense/Nginx: configd not running!

And

Code: [Select]
[176/177] Upgrading os-dyndns from 1.22 to 1.27_3...
[176/177] Extracting os-dyndns-1.27_3: .......... done
Starting configd.
Reloading plugin configuration
Configuring system logging...
Fatal error: Uncaught Error: Call to undefined method Phalcon\Logger\Adapter\Syslog::error() in /usr/local/opnsense/mvc/app/library/OPNsense/Core/Backend.php:95
Stack trace:
#0 /usr/local/etc/inc/legacy_bindings.inc(41): OPNsense\Core\Backend->configdRun('template reload...', false)
#1 /usr/local/etc/inc/system.inc(605): configd_run('template reload...')
#2 /usr/local/etc/rc.configure_plugins(45): system_syslogd_start(true)
#3 {main}
  thrown in /usr/local/opnsense/mvc/app/library/OPNsense/Core/Backend.php on line 95
[177/177] Upgrading opnsense from 20.7 to 22.1.2...
[177/177] Extracting opnsense-22.1.2: .......... done

My gut tells me that version mismatches during reboots is causing the majority of these errors since they seem to go away after the final reboot and the upgrade completes, but a sanity check would be greatly appreciated.

Thanks in advance! Also, let me know if you want any more details from my end.
Title: Re: Questions regarding potential errors during update process
Post by: bfoss on March 22, 2022, 05:46:56 pm
I'm going to move forward assuming that these errors are expected during upgrade reboots and that I shouldn't be worried since the upgrade seems to work fine on the final boot. If anyone sees this down the road and feels differently, please chime in. Thanks!