Notification Center: test messages work, but no rule ever fires (empty history) – cause was a crashed DB table (event_channel), fix inside
Environment: TS-464, QTS 5.2.10 (build 20260731), Notification Center 1.10.0.3331 (also tested 1.9.2.3163)
Symptoms
- Test e-mail and test push from “Service Account and Device Pairing” arrive fine
- No event notification rule ever sends anything, not even a brand-new rule with all events, all severity levels and push only
- “Notification Queue and History” stays completely empty
- A reboot, re-creating the rules and downgrading to 1.9.2.3163 (as suggested in the thread linked above) did not help
Diagnosis
The key information is in /var/log/nc.log (SSH). Every event produced this:
[Message] create [type=3] [level=2] [app=Security Center] ...
[DB] PROCEDURE nc.add_event does not exist: mysql_stmt_execute
[Message] not match any policy
So ncd receives the events, but can’t store them because the stored procedure add_event is missing in its internal MariaDB. As a result, no rule is ever evaluated. Opening the history page fails the same way (PROCEDURE nc.get_event does not exist).
You can confirm this without DB credentials:
sudo grep -a -c "add_event" /etc/config/nc/db/mysql/proc.MYD # 0 = missing
The startup section of nc.log shows why the procedure is missing:
[DB] initialize event tables
[DB] Table 'event_channel' is marked as crashed and should be repaired
[DB] initialize emitter procedures <- "initialize event procedures" is skipped
The MyISAM table event_channel was marked as crashed, so the event initialization aborts on every start, before it creates the event procedures. In my case the event tables (/etc/config/nc/db/nc/event*.MYD) had last been modified in October 2024, so notifications had silently been dead for almost two years. Rules, senders, receivers etc. live in other tables and were fine.
Fix (unofficial, at your own risk, back up first)
Note: qpkg_service stop NotificationCenter and /etc/init.d/nc.sh stop both returned without error but did not stop anything. Only force-stop worked. Always verify with ps.
sudo /etc/init.d/nc.sh force-stop
ps | grep -E "ncd|ncdb" | grep -v grep # must return nothing
# full backup of the NC config/database
sudo cp -a /etc/config/nc /share/CACHEDEV1_DATA/nc-config-backup
# move the old event tables out of the way (old event data only)
sudo mkdir /share/CACHEDEV1_DATA/nc-event-tables
sudo sh -c 'mv /etc/config/nc/db/nc/event* /share/CACHEDEV1_DATA/nc-event-tables/'
sudo /etc/init.d/nc.sh start
grep -i -E "initialize|crashed" /var/log/nc.log | tail -n 15
sudo grep -a -c "add_event" /etc/config/nc/db/mysql/proc.MYD # now 1
Run the mv inside sudo sh -c '...'. Otherwise your non-root shell expands the wildcard, which fails because you have no read permission on the directory.
After the restart the log showed initialize event tables and then initialize event procedures. ncd recreated the event tables cleanly. The rules immediately started working, the history fills again, and all existing rules and pairings were kept. Updating back to 1.10.0.3331 afterwards was no problem.
Alternative: /etc/init.d/nc.sh reset does force-stop, then deletes all of /etc/config/nc and starts again. That should also fix it, but you have to reconfigure all senders, pairings and rules afterwards.
Side note: If you use Gmail via Google sign-in (OAuth), also check the event log for “Authorization expired. Re-authorize the account”. That was a second, separate issue on my NAS.
Hope this saves someone the search. If anyone from QNAP reads this: the crashed table should be repaired during startup (myisam-recover-options is set but evidently didn’t help), or at least logged as an error and shown in the UI.