From upgrade to upgrade, reforis seems to break?

root@turris:~# cat /etc/turris-version
7.1.3

Reforis is partially broken for me.

When I was runing TurrisOS 5, the automated upgrade to 6 somehow corrupted reforis and I posted Upgrade to Turris OS 6... no foris, other warnings etc... where to from here? - #16 by dcam

I then applied the medkit and got it working fresh on Turris OS 6 and since then, settings have hardly changed and the router has been healthy.

Now the 6 to 7 upgrade has happened, and I’ve got a similar story again, with partially broken Reforis displaying identical behaviour to what another user sees at Turris Omnia: reForis / Network Settings / WiFi - "An error occurred while fetching data."

As in the page by another user above, I see “An error occurred while fetching data.” when viewing wifi settings in Reforis.

I also see “An unknown API error occurred.” when viewing LAN settings or DNS settings or Guest Network settings in Reforis. Everything else seems ok in Reforis.

I haven’t managed to find any useful logs in /var/log that shed any light on the situation.

root@turris:~# opkg list-installed | grep reforis
reforis - 3.2.1-3.10-1
reforis-data-collection-plugin - 1.2.1-3.10-1
reforis-data-collection-plugin-l10n-cs - 1.2.1-3.10-1
reforis-diagnostics-plugin - 3.2.0-3.10-1
reforis-diagnostics-plugin-l10n-cs - 3.2.0-3.10-1
reforis-haas-plugin - 1.2.0-3.10-1
reforis-haas-plugin-l10n-cs - 1.2.0-3.10-1
reforis-l10n-cs - 3.2.1-3.10-1
reforis-l10n-de - 3.2.1-3.10-1
reforis-snapshots-plugin - 2.2.1-3.10-1
reforis-snapshots-plugin-l10n-cs - 2.2.1-3.10-1
reforis-storage-plugin - 1.2.0-3.10-1

Is there a way to turn on reforis logging so that the root of what is happening can be explored?

Are you using the automatic system update ?!

If you are only now making the switch from version 6 to 7, you are a bit behind. Version 7 is due out sometime in mid-2024. If you don’t make the transition between versions in time for when it happens, there will be major changes between versions that may crash the delayed update

The easiest route is to install a clean medkit of the current version + configure or defer some of your config files.

It’s possible that someone smarter than me will advise you another way.

1 Like

Maybe an obvious question, but did you reset the browser cache? Most browsers do it via Ctrl+F5.

peci1, Yeah that makes no difference, also tried Incognito window, all same behaviour.

JardaB, I don’t think I actually did anything to move from 6 to 7, think the router did it itself as part of its upgrades.

Looking at Early bird OS 7.0.0 I can see the same error “An unknown API error occurred.” in the early bird reports.

I had a bit of a look myself at the problem and the failure for wifi is in URL /reforis/api/wifi which is reporting a JSON validation problem and reports:

Log shows:
Mar 6 13:59:24 turris foris-controller[7627]: ERROR:foris_controller.message_router:Failed to validate output message.

Here’s a traceback reported by invocation of the URI:

Traceback (most recent call last): File “/usr/lib/python3.10/site-packages/foris_controller/message_router.py”, line 140, in process_message File “/usr/lib/python3.10/site-packages/foris_controller/message_router.py”, line 40, in wrapper File “/usr/lib/python3.10/site-packages/foris_controller/message_router.py”, line 76, in validate File “/usr/lib/python3.10/site-packages/foris_schema/validator.py”, line 282, in validate File “/usr/lib/python3.10/site-packages/jsonschema/validators.py”, line 314, in validate jsonschema.exceptions.ValidationError:

Failed validating “oneOf” in schema[“properties”][“data”][“properties”][“devices”][“items”]:
{“oneOf”: [

More info at jsonschema - JSON Schema Array Validation Woes Using oneOf - Stack Overflow

I had a look at the JSON causing the error and there are some oddities with the way it is, but these don’t seem to be the cause in any way:

  1. It uses True and False for boolean values instead of correctly using true and false, a JSON requirement.
  2. It uses single quotation marks instead of double quotation marks which is also a JSON requirement.

I looked at foris_schema/validator.py · master · Turris / Foris Controller / foris-schema · GitLab and line 282 from the stack trace above, and it is failing in:
Draft7Validator(mini_schema, format_checker=format_checker).validate(msg)

then I looked at jsonschema/jsonschema/validators.py at main · python-jsonschema/jsonschema · GitHub and it is failing at:

validator = Validator(
schema=cls.META_SCHEMA,
format_checker=format_checker,
)