opnsense / core

OPNsense GUI, API and systems backend
https://opnsense.org/
BSD 2-Clause "Simplified" License
3.36k stars 753 forks source link

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/etc/inc/rrd.inc #8043

Open Zeitkind opened 1 week ago

Zeitkind commented 1 week ago

Due to a hardware failure I have to replace one of my firewalls. OPNsense version still 24.1.10_8 aka 11.2, I made a fresh install from USB, set LAN and WAN so I could update to 24.1.10_8, installed the plugins I use, reboot, then tried to restore from backup.

Backup setting: no rrd, no encryption on source system Restore settings: all (default), exclude console setting (default) Import starts, then it switches to a (debug?) website with:

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/etc/inc/rrd.inc:622 Stack trace: #0 /usr/local/www/diag_backup.php(336): rrd_import() #1 {main} thrown in /usr/local/etc/inc/rrd.inc on line 622

Tried 3 times with different installations and 2 different backup-config.xml - same result. In the backup-xml the rrd part is just


  <rrddata>
  </rrddata>

i.e. no data, and rrd.inc has only 100 lines(?), so.. no idea. The import kinda succeeds, if I reboot, the system boots up with the right IP and settings, but I can't see if all data is restored. Any hints? Ideas?

OPNsense-bot commented 1 week ago

Thank you for creating an issue. Since the ticket doesn't seem to be using one of our templates, we're marking this issue as low priority until further notice.

For more information about the policies for this repository, please read https://github.com/opnsense/core/blob/master/CONTRIBUTING.md for further details.

The easiest option to gain traction is to close this ticket and open a new one using one of our templates.

Zeitkind commented 1 week ago

Additional info: Just tried to import the backup to a vanilla 24.7.8. Error stays, but now

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/etc/inc/rrd.inc:56 Stack trace: #0 /usr/local/www/diag_backup.php(337): rrd_import() #1 {main} thrown in /usr/local/etc/inc/rrd.inc on line 56

Looking into the code, that seems to be the part it looks for rrddata, so I tried simply removing the empty `

` in the config.xml and now restore works without an error.