Alert - Failed to check for alert HasUpdate

Description

I installed TN 12.0-U3, and shortly after the reboot the system provided a new alert:

Failed to check for alert HasUpdate: Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/middlewared/plugins/alert.py", line 740, in _run_source alerts = (await alert_source.check()) or [] File "/usr/local/lib/python3.8/site-packages/middlewared/alert/base.py", line 210, in check return await self.middleware.run_in_thread(self.check_sync) File "/usr/local/lib/python3.8/site-packages/middlewared/utils/run_in_thread.py", line 10, in run_in_thread return await self.loop.run_in_executor(self.run_in_thread_executor, functools.partial(method, *args, **kwargs)) File "/usr/local/lib/python3.8/site-packages/middlewared/utils/io_thread_pool_executor.py", line 25, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.8/site-packages/middlewared/alert/source/update.py", line 67, in check_sync path = self.middleware.call_sync("update.get_update_location") File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1254, in call_sync return self.run_coroutine(methodobj(*prepared_call.args)) File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1294, in run_coroutine return fut.result() File "/usr/local/lib/python3.8/concurrent/futures/_base.py", line 432, in result return self._get_result() File "/usr/local/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result raise self._exception File "/usr/local/lib/python3.8/site-packages/middlewared/plugins/update.py", line 411, in get_update_location os.makedirs(path, exist_ok=True) File "/usr/local/lib/python3.8/os.py", line 223, in makedirs mkdir(name, mode) OSError: [Errno 30] Read-only file system: '/var/db/system/update'
2021-05-03 12:55:34 (America/Los_Angeles)

Problem/Justification

None

Impact

None

SmartDraw Connector

Katalon Manual Tests (BETA)

Activity

Show:

Bug Clerk 
May 12, 2021 at 7:52 AM

Bug Clerk 
May 10, 2021 at 4:58 PM

Kevin Horton 
May 9, 2021 at 8:19 PM

I think I now understand what triggered these alerts and the sequence of events that lead here.

The server in question is used as a replication target, which lead to the main pool being set as a read-only file system. Originally the system dataset was on the freenas-boot pool, but I recently moved it to the main pool as the SSD that comprises the freenas-boot is getting too many write cycles. The root cause of the alerts was having the system dataset on a read-only file system.

Suggestion - the system should not allow the system dataset to be selected to a read-only file system. The system should also detect if the file system that holds the boot pool is later set to read-only.

Kevin Horton 
May 4, 2021 at 1:09 PM

Unfortunately, an attempt to create a debug results in the dialog:

[EFAULT] [EFAULT] Failed to generate debug file: mkdir: /var/db/system/ixdiagnose: Read-only file system

More info:
Error: Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/middlewared/job.py", line 367, in run
await self.future
File "/usr/local/lib/python3.8/site-packages/middlewared/job.py", line 405, in __run_body
rv = await self.middleware.run_in_thread(self.method, *([self] + args))
File "/usr/local/lib/python3.8/site-packages/middlewared/utils/run_in_thread.py", line 10, in run_in_thread
return await self.loop.run_in_executor(self.run_in_thread_executor, functools.partial(method, *args, **kwargs))
File "/usr/local/lib/python3.8/site-packages/middlewared/utils/io_thread_pool_executor.py", line 25, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/site-packages/middlewared/schema.py", line 977, in nf
return f(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/middlewared/plugins/system.py", line 785, in debug
raise CallError(debug_job.error)
middlewared.service_exception.CallError: [EFAULT] [EFAULT] Failed to generate debug file: mkdir: /var/db/system/ixdiagnose: Read-only file system

The debug that downloads has size zero.

The traceback complains about /var/db/system/ being read-only,

% ls -al /var/db | grep system
drwxr-xr-x 2 root wheel 2 Apr 4 19:54 system

root should be able to create a directory, but no other user. What user runs middleware?

/var/db/system is empty, which seems strange, as my other server, not yet updated to TN 12.0-U3, has many things in there

ls -al /var/db/system
total 2
drwxr-xr-x 2 root wheel 2 Apr 4 19:54 .
drwxr-xr-x 17 root wheel 1344 May 3 12:55 ..

iX-Tony 
May 4, 2021 at 12:37 PM

Thank you for the report, . Can you please attach a debug file to this ticket? To generate a debug file on TrueNAS CORE, log in to the TrueNAS web interface, go to System > Advanced, then click SAVE DEBUG and wait for the file to download to your local system.

Complete

Details

Assignee

Reporter

Labels

Components

Affects versions

Priority

More fields

Katalon Platform

Created May 4, 2021 at 3:53 AM
Updated July 6, 2022 at 8:58 PM
Resolved May 12, 2021 at 7:53 AM