Storage tab not working when one of the drives is faulty
Summary
While troubleshooting an issue with my SSD storage, I noticed that the "Storage" tab in reForis shows only an error:
An error occurred while fetching data.
In DevTool, I see that both requests GET /reforis/storage/api/settings
and GET /reforis/storage/api/state
failed with 500 Internal Server Error.
The response body says:
Error:
Remote Exception: Internal error Can't get UUID for device '/dev/sda1'. Command 'blkid /dev/sda1' has failed! (Retval=2 for ['blkid', '/dev/sda1'])('<class 'LookupError'>')
Extra:
{"module": "storage", "action": "get_state", "kind": "request"}
Trace:
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/foris_controller_backends/storage/__init__.py", line 52, in get_state
File "/usr/lib/python3.7/site-packages/foris_controller_backends/cmdline/__init__.py", line 171, in _trigger_and_parse
File "/usr/lib/python3.7/site-packages/foris_controller_backends/cmdline/__init__.py", line 154, in _run_command_and_check_retval
foris_controller.exceptions.BackendCommandFailed: Retval=2 for ['blkid', '/dev/sda1']
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/foris_controller/message_router.py", line 117, in process_message
File "/usr/lib/python3.7/site-packages/foris_controller/module_base.py", line 61, in perform_action
File "/usr/lib/python3.7/site-packages/foris_controller_modules/storage/__init__.py", line 20, in action_get_state
File "/usr/lib/python3.7/site-packages/foris_controller/utils.py", line 113, in inner
File "/usr/lib/python3.7/site-packages/foris_controller_modules/storage/handlers/openwrt.py", line 23, in get_state
File "/usr/lib/python3.7/site-packages/foris_controller_backends/storage/__init__.py", line 61, in get_state
LookupError: Can't get UUID for device '/dev/sda1'. Command 'blkid /dev/sda1' has failed! (Retval=2 for ['blkid', '/dev/sda1'])
When I run blkid
on my router:
root@turris:~# blkid /dev/sda1
root@turris:~# echo $?
2
Steps To Reproduce
- Get your router into the state when
/dev/sda1
is mounted but the HW is faulty - Log into reForis web interface
- Click on "Storage" in the left sidebar
Expected Result
- Storage web interface is rendered.
- The page indicates there is a problem with the
sda1
device.
Actual Result
The page says "An error occurred while fetching data."