Files
wekan/docs/Features/Admin-Panel/Problems/Filesystem-integrity.md
T
Lauri Ojansivu c66af0e134 Docs: Admin Panel / Problems (Files to Performance): what each feature is, how to use it, how its numbers are calculated, how it works, and its commits.
File status, Filesystem integrity, Impersonation Report, Instrumentation,
Large boards, Login problems, Migrations, Offices, Password length and
Performance now each say what the feature is, where to read more, how to use
it, how its numbers are calculated, how it is implemented, and link the
commits that built it.

Corrected from the code: the file status scan limits are 100,000 records per
collection and 250,000 versions, not 20,000; the snap's FerretDB default is
OpLog with polling as the fallback, not polling only; the Password length
table has 25 rows a page.

Thanks to xet7 !
2026-11-22 17:59:12 +02:00

7.5 KiB

Admin Panel / Problems / Filesystem integrity

What it is

Whether this server stopped cleanly, what crashed it, and whether the continuous backup failed - plus the read-only file status checks. It is the place an administrator looks after an unexpected outage: a crash, a quick restart without a clean stop, an uncaught error or a broken backup stream each leave a row here. Address: /admin/problems/integrity. Site administrators only.

Read more

How to use it

Read what happened

  1. Sign in as a site administrator and open Admin Panel → Problems → Filesystem integrity.
  2. Read the table, newest first: Date and time, Category, Name, Severity, Action, Source, Username, IPv4, Location, IPv6, Location, Attempts and Detail. 10 rows a page; the search box filters as you type.
  3. To acknowledge or clear the stream, open Problems → Summary, tick the row for Filesystem integrity and press Acknowledge or Clear.

Check the files

  1. At the top of the pane press Check files and history, Check file types and extensions or Check missing and untracked files - the same checks as on the Files Report and Recovery panes.
  2. Cancel check stops one while it runs; Download status summary saves the result when one has finished. They change no file and no record. See File-status.md.

Read the rows without a browser

  • GET /api/admin/problems/integrity (REST API).

How the numbers are calculated

From server/lib/uptimeWatch.js:

  • A heartbeat is written every minute (HEARTBEAT_MS = 60,000 ms) with cleanShutdown: false; SIGTERM or SIGINT writes cleanShutdown: true.
  • At the next start, the time down is now minus the last heartbeat. The threshold is three heartbeats, DOWNTIME_THRESHOLD_MS = 180,000 ms (3 minutes): a gap longer than two heartbeats is a real gap, not a slow write.
    • no previous heartbeat: first run, not recorded;
    • a clean-shutdown mark: clean stop, not recorded;
    • no mark and down for less than 3 minutes: a quick restart, low;
    • no mark and down for 3 minutes or more: a crash, high.
  • The minutes in the Detail are the time down divided by 60,000 and rounded.
  • Attempts is the row's count: rows that repeat are folded into one summary row whose count grows (server/lib/eventLogFold.js).
  • Rows older than EVENTLOG_RETENTION_DAYS (default 90; 0 keeps them) are deleted daily (models/eventLog.js).

The daily file scan (models/lib/fileIntegrity.js) runs once every 24 hours, does not start or continue while CPU is at 60 % or more, pauses 50 ms between files plus 20 ms per megabyte of the file, and stops after 15 minutes to continue the next day.

How it works in WeKan

The rows are the integrity stream of the eventlog collection:

Name Severity Recorded when Written by
DowntimeBleed (category availability) high the previous run left no clean-shutdown mark and the server was down for more than three minutes: a crash server/lib/uptimeWatch.js
DowntimeBleed (category availability) low no clean-shutdown mark, but back within three minutes: a quick restart server/lib/uptimeWatch.js
CrashBleed (category crash) critical an uncaught exception or an unhandled promise rejection, with its message server/lib/uptimeWatch.js
ContinuousBackup (category backup) high the continuous backup stream failed server/continuousBackup.js

The heartbeat is the heartbeat document of the IntegrityKeys collection (models/fileIntegrity.js), and classifyPreviousRun in server/lib/uptimeWatch.js is the whole decision. A clean stop and a first run are not recorded. A database that is only momentarily unreachable is not a crash (isTransientDatabaseError in server/00processErrors.js): it is recorded on Database problems instead.

The daily scan of stored files (same name, size, modification time, md5, sha256 and sha512, signed with ed25519; server/lib/fileIntegrityScan.js) and the hourly change history audit (server/lib/historyIntegrityScan.js) report what they find to the Security Report, as StorageBleed and HistoryIntegrity, not to this stream. They can be turned off with WEKAN_INTEGRITY_SCAN=false and WEKAN_HISTORY_INTEGRITY_SCAN=false; WEKAN_INTEGRITY_PRIVATE_KEY supplies the signing key instead of one generated and kept in the database.

The table is the same read-only event table as the other streams (Security Report), rendered by eventStreamReport in client/components/settings/adminProblems.jade.

Tests: tests/fileIntegrity.test.cjs (drives classifyPreviousRun), tests/restartIsNotACrash.test.cjs, tests/databaseDnsRestart.test.cjs and tests/integrityBaselineForgottenOnDelete.test.cjs.

Commits