Persistent "Unexpected Contents" Warning on templates.xml

Don

Member
Licensed customer
I am receiving repeated email notifications from the automatic file health check reporting 1 file with unexpected contents. The file in question is:

src/addons/XF/_data/templates.xml

The health check has been flagging this same file on every single run for at least the past several days, as shown in the File Health Check Results log in my ACP. There are never any missing files, only this one file with unexpected contents, every time.

I have already restored the file from a clean XenForo installation package. The flag returned immediately on the next health check run, which suggests the file is being actively rewritten by the system itself, likely by an addon rebuild process rather than being the result of manual editing, file corruption, or malicious alteration.

Since this appears to be normal system behavior rather than an actual problem, the repeated email notifications are unnecessary. I have two questions:
  1. Is there a way to whitelist or acknowledge this specific file so it no longer triggers the health check alert?
  2. Is there a way to suppress the email notification for health check failures independently of disabling the health check itself? I would like the checks to continue running, but without being emailed about a known non-issue on every cycle.
Any guidance would be appreciated. Thank you.
 
which suggests the file is being actively rewritten by the system itself
You can check if the file is being changed by doing a checksum on the original from the setup files and once XF has reported unexpected contents. Before you faff around with that though, check the file sizes: if they're different then the files are different for sure and no need for a checksum check. MD5summer is good for generating these checksums.

 
Recap: I have been receiving repeated email notifications from the automatic file health check reporting one file with unexpected contents. The file in question is src/addons/XF/_data/templates.xml. This has been flagging on every single health check run for several days with no missing files, only this one file every time.

I restored the file from a clean XenForo installation package. The flag returned immediately on the next health check run, so something is actively rewriting the file after every restoration.

I ran MD5 comparisons. The hash of the file on my server did not match the hash of the same file from a fresh XenForo download package. However I subsequently discovered that XenForo actually uses SHA256 for its health check, not MD5.

Looking at the hashes.json file located in src/addons/XF/, I found the expected hash for the file:

Expected SHA256 in hashes.json: 99790d6c49d5ba04f3508f9678d8f25c3198c0ae7ead685be90867797bcc77dc

Running sha256sum on the actual file on my server returned: 3c8aefaa8799c8eeee6aec4bae62763da9141d029d3146ed4bd6f404cb4bbb4b

They do not match, confirming the file has been modified after hashes.json was last written.

When I trigger a manual health check in ACP and watch the progress steps, the names of addons flash across the screen during the check, including addons that I had disabled before running the test. This suggests that disabled addons are still participating in some process during the health check.

Looking at the file in my file manager, the templates.xml in src/addons/XF/_data/ is 2,585,338 bytes. A fresh templates.xml from a clean XenForo package is much smaller. This suggests the file on my server contains merged addon template data rather than just the core XenForo templates.

I believe XenForo is intentionally rebuilding and merging addon template data into this file whenever addons are installed, uninstalled, enabled, or disabled. If that is the case, the file will always differ from the fresh version and the health check flag may be a false positive caused by the merged addon data not being accounted for in hashes.json.

Is it normal for src/addons/XF/_data/templates.xml to contain merged addon data, making it significantly larger than the fresh file?

If so, should hashes.json be updated automatically to reflect the current state of the file after a rebuild?

Is there a way to regenerate hashes.json to match the current state of all files so the health check passes cleanly?

If this is expected behavior, is there a way to suppress the health check email notification for this specific file?

I am running XenForo 2.3.9 with several addons installed including XFA Who Read This Content, SV StandardLib, Andy AdminStatistics, Andy RegisterEmail, and Andy MediaWidth1200.

Any insight would be appreciated. Thank you.
 
I ran MD5 comparisons. The hash of the file on my server did not match the hash of the same file from a fresh XenForo download package. However I subsequently discovered that XenForo actually uses SHA256 for its health check, not MD5.
That XF uses a different hashing method is irrelevant. You're simply comparing two files so could use any hashing method to check if they're the same or not. That they're different is your clue as to what's going on and need to concentrate on why it's being changed. Perhaps open a support ticket about this.
 
FIxed. The answer is always there if you look in the right place. Andy B. suggested that I upload a new copy of tempates.xml from the download package. I had overlooked it previously in the _data folder. Overwriting the corrupt file fixed the problem. Thanks, Andy and others who responded.
 
Back
Top Bottom