OPNsense Forum

Archive => 23.7 Legacy Series => Topic started by: Koldnitz on November 21, 2023, 01:22:24 AM

Title: reset tunables from cli
Post by: Koldnitz on November 21, 2023, 01:22:24 AM
My router stopped working.

I woke up Friday and it was bricked.

I was able to plug in my old router and upgrade it / migrate a backup so as not to lose a year's worth of tweaks but some stuff is still acting weird.

I noticed I can't go into the tunables page.

I am getting this error:

Fatal error: Uncaught TypeError: gettext(): Argument #1 ($message) must be of type string, array given in /usr/local/www/system_advanced_sysctl.php:122 Stack trace: #0 /usr/local/www/system_advanced_sysctl.php(122): gettext(Array) #1 {main} thrown in /usr/local/www/system_advanced_sysctl.php on line 122

Is there any way to reset all tunables from the cli (I cannot see trash icon in gui)

Thanks in advance,
Title: Re: reset tunables from cli
Post by: iMx on November 21, 2023, 08:38:40 AM
Backup XML, edit XML to remove what you want - or copy/paste the relevant parts from a Vanilla backup - restore XML?

...
  <sysctl>
    <item>
...
    </item>
  </sysctl>
.....


I'd recommend the automated Google Drive backup ;)
Title: Re: reset tunables from cli
Post by: franco on November 21, 2023, 09:34:09 AM
The error is pretty distinct and weird. It would suggest you added a tunable manually but the nesting is wrong albeit not breaking the XML format?

# pluginctl -g sysctl

Scan for "descr": [ which has a nested structure...


Cheers,
Franco
Title: Re: reset tunables from cli
Post by: Koldnitz on November 21, 2023, 12:44:41 PM
Franco, iMx

I used araxis merge to combine my configs.

I did noticed some of the formatting was a little janky at places (and high level I knew this might affect the xml), but for the most part everything seems to work.

I will check with pluginctl, but I am pretty sure it just as you say Franco.

Are there any tools that I could run the file through to check the formatting?

I still have all my backups worst case I mess with Araxis Merge and see about keeping source formatting / manually edit like iMx recommends.

Thanks for the help,
Title: Re: reset tunables from cli
Post by: franco on November 21, 2023, 01:33:11 PM
You'd have to open the file to see (or pluginctl will format the output for you but in JSON not XML). The descr elements should not have any children but it appears that that is the case. Depending on what elements they contain we can actually say what has been misplaced, but not from the warning itself.


Cheers,
Franco