Problem with detecting switch ports of Mox Classic Wi-Fi 6 in mox.py
I'm having troubles setting up my Mox Classic Wi-Fi 6, that I just bought. The problem seems to be related to detecting switch ports.
Quick description of the the problem:
- reForis guide setup fails on load with HTTP response code 500.
- LuCI seems to be working fine, however if I go to "Network -> Interfaces", LuCI complains about the configuration in a modal and suggest only clicking "Continue" to fix the issue.
The problem seems to come from the Mox C (ethernet ports switch). When I remove the module reForis loads fine, and when I re-insert the module and do a factory reset to properly detect the new module I fallback to the problem described above.
Stacktrace of the problem:
2024-04-21 14:01:56: (../src/mod_fastcgi.c.449) FastCGI-stderr:[2024-04-21 14:01:56,455] ERROR in backend: Exception in backend occurred. (Controller error(s) has occured:
2024-04-21 14:01:56: (../src/mod_fastcgi.c.449) FastCGI-stderr:Traceback (most recent call last):
2024-04-21 14:01:56: (../src/mod_fastcgi.c.449) FastCGI-stderr: File "/usr/lib/python3.9/site-packages/foris_controller/message_router.py", line 117, in process_message
2024-04-21 14:01:56: (../src/mod_fastcgi.c.449) FastCGI-stderr: File "/usr/lib/python3.9/site-packages/foris_controller/module_base.py", line 61, in perform_action
2024-04-21 14:01:56: (../src/mod_fastcgi.c.449) FastCGI-stderr: File "/usr/lib/python3.9/site-packages/foris_controller_modules/web/__init__.py", line 75, in action_get_guide
2024-04-21 14:01:56: (../src/mod_fastcgi.c.449) FastCGI-stderr: File "/usr/lib/python3.9/site-packages/foris_controller/utils.py", line 113, in inner
2024-04-21 14:01:56: (../src/mod_fastcgi.c.449) FastCGI-stderr: File "/usr/lib/python3.9/site-packages/foris_controller_modules/web/handlers/openwrt.py", line 91, in get_guide
2024-04-21 14:01:56: (../src/mod_fastcgi.c.449) FastCGI-stderr: File "/usr/lib/python3.9/site-packages/foris_controller_backends/web/__init__.py", line 196, in get_guide
2024-04-21 14:01:56: (../src/mod_fastcgi.c.449) FastCGI-stderr: File "/usr/lib/python3.9/site-packages/foris_controller_backends/web/__init__.py", line 91, in _detect_recommended_workflow
2024-04-21 14:01:56: (../src/mod_fastcgi.c.449) FastCGI-stderr: File "/usr/lib/python3.9/site-packages/foris_controller_backends/web/__init__.py", line 72, in _get_configurable_ifaces
2024-04-21 14:01:56: (../src/mod_fastcgi.c.449) FastCGI-stderr: File "/usr/lib/python3.9/site-packages/turrishw/turrishw.py", line 44, in get_ifaces
2024-04-21 14:01:56: (../src/mod_fastcgi.c.449) FastCGI-stderr: File "/usr/lib/python3.9/site-packages/turrishw/mox.py", line 90, in get_interfaces
2024-04-21 14:01:56: (../src/mod_fastcgi.c.449) FastCGI-stderr:IndexError: list index out of range
2024-04-21 14:01:56: (../src/mod_fastcgi.c.449) FastCGI-stderr:
2024-04-21 14:01:56: (../src/mod_fastcgi.c.449) FastCGI-stderr:Internal error list index out of range('<class 'IndexError'>')
2024-04-21 14:01:56: (../src/mod_fastcgi.c.449) FastCGI-stderr:
2024-04-21 14:01:56: (../src/mod_fastcgi.c.449) FastCGI-stderr:)
I've look at the code and the problem seems to be related to the line switch_idxs = [i + 1 for i, s in enumerate(modules) if 'topaz' in s or 'peridot' in s]
, which returns empty array for switch_idxs
. For reference, the detected module names are:
modules: ['moxtet-pci.0', 'moxtet-unknown.1', 'moxtet-unknown.2', 'moxtet-unknown.3', 'moxtet-unknown.4', 'moxtet-unknown.5', 'moxtet-unknown.6', 'moxtet-unknown.7', 'moxtet-unknown.8']
module: moxtet-pci.0
module: moxtet-unknown.1
module: moxtet-unknown.2
module: moxtet-unknown.3
module: moxtet-unknown.4
module: moxtet-unknown.5
module: moxtet-unknown.6
module: moxtet-unknown.7
module: moxtet-unknown.8
I've tried to recompile the python module with the problematic line changed to switch_idxs = [i + 1 for i, s in enumerate(modules)]
(I know, probably totally wrong), however I failed - my expertise is Java, not Python.
I'm willing to help resolve this issue and open an MR, if someone is willing to give me a bit more information. Thanks!