From 8dea7438aed17946511d0b5288bc41e027a3e24c Mon Sep 17 00:00:00 2001 From: DerLinkman Date: Tue, 23 May 2023 11:30:53 +0200 Subject: [PATCH] Update Common Problems (Hyperscan Rspamd) --- .../debug-common_problems.de.md | 51 ++++++++++++++++++- .../debug-common_problems.en.md | 51 ++++++++++++++++++- 2 files changed, 100 insertions(+), 2 deletions(-) diff --git a/docs/troubleshooting/debug-common_problems.de.md b/docs/troubleshooting/debug-common_problems.de.md index 486585d07..fd77c8c79 100644 --- a/docs/troubleshooting/debug-common_problems.de.md +++ b/docs/troubleshooting/debug-common_problems.de.md @@ -88,5 +88,54 @@ Wenn `dhparams.pem` fehlt, können Sie es mit Bash openssl dhparam -out data/assets/ssl/dhparams.pem 4096 ``` +## Rspamd meldet: cannot open hyperscan cache file /var/lib/rspamd/{...}.hs: compiled for a different platform -[^1]: [netcat](https://linux.die.net/man/1/nc), [nmap](https://linux.die.net/man/1/nmap), [openssl](https://wiki.openssl.org/index.php/Manual:S_client(1)), [telnet](https://linux \ No newline at end of file +Bei einer Migration von mailcow auf ein anderes System (meistens mit einer anderen CPU) kann es unter umständen passieren, dass Rspamd meldet er könne einige (evtl. alle) `.hs` Dateien nicht laden, da diese für eine andere Plattform (CPU) kompiliert wurden. + +Dies hängt mit Hyperscan[^2] zusammen einer Intel Technik zum vorkompilieren von regex schemata, welche Rspamd einsetzt. + +Diese Funktion bringt einen erheblichen Performance Boost mit sich und ist deswegen stark in Rspamd verankert. + +Um diesen Fehler zu beheben müssen alle `.hs` und `.hsmp` Dateien aus dem Rspamd Verzeichnis gelöscht werden: + +=== "docker compose (Plugin)" + + ``` bash + cd MAILCOW_ROOT # Meistens /opt/mailcow-dockerized + docker compose exec rspamd-mailcow bash + rm -rf /var/lib/rspamd/*.hs + rm -rf /var/lib/rspamd/*.hsmp + ``` + +=== "docker-compose (Standalone)" + + ``` bash + cd MAILCOW_ROOT # Meistens /opt/mailcow-dockerized + docker-compose exec rspamd-mailcow bash + rm -rf /var/lib/rspamd/*.hs + rm -rf /var/lib/rspamd/*.hsmp + ``` + +Anschließend Rspamd neustarten mit: + +=== "docker compose (Plugin)" + + ``` bash + docker compose restart rspamd-mailcow + ``` + +=== "docker-compose (Standalone)" + + ``` bash + docker-compose restart rspamd-mailcow + ``` + +Nun kompiliert Rspamd die besagten Regex Maps wieder neu mit Hyperscan. + +!!! warning "Achtung" + Das originale Hyperscan funktioniert (Stand Mai 2023) **NUR** auf x86. ARM64 wird voraussichtlich **nicht** offiziell von Intel supported[^3] + + +[^1]: [netcat](https://linux.die.net/man/1/nc), [nmap](https://linux.die.net/man/1/nmap), [openssl](https://wiki.openssl.org/index.php/Manual:S_client(1)), [telnet](https://linux.die.net/man/1/telnet), etc. +[^2]: [Hyperscan](https://github.com/intel/hyperscan) +[^3]: [Status für Hyperscan auf ARM64](https://github.com/intel/hyperscan/pull/287#issuecomment-746558138) diff --git a/docs/troubleshooting/debug-common_problems.en.md b/docs/troubleshooting/debug-common_problems.en.md index be3433205..5e992327a 100644 --- a/docs/troubleshooting/debug-common_problems.en.md +++ b/docs/troubleshooting/debug-common_problems.en.md @@ -88,5 +88,54 @@ If `dhparams.pem` is missing, you can generate it with openssl dhparam -out data/assets/ssl/dhparams.pem 4096 ``` +## Rspamd reports: cannot open hyperscan cache file /var/lib/rspamd/{...}.hs: compiled for a different platform -[^1]: [netcat](https://linux.die.net/man/1/nc), [nmap](https://linux.die.net/man/1/nmap), [openssl](https://wiki.openssl.org/index.php/Manual:S_client(1)), [telnet](https://linux.die.net/man/1/telnet), etc. \ No newline at end of file +When migrating mailcow to another system (usually with a different CPU), Rspamd may report that it cannot load some (possibly all) `.hs` files because they were compiled for a different platform (CPU). + +This is related to Hyperscan[^2], an Intel technique for precompiling regex schemas that Rspamd uses. + +This feature provides a significant performance boost and is therefore heavily embedded in Rspamd. + +To fix this bug, all `.hs` and `.hsmp` files must be deleted from the rspamd directory: + +=== "docker compose (Plugin)" + + ``` bash + cd MAILCOW_ROOT # Usually /opt/mailcow-dockerized + docker compose exec rspamd-mailcow bash + rm -rf /var/lib/rspamd/*.hs + rm -rf /var/lib/rspamd/*.hsmp + ``` + +=== "docker-compose (Standalone)" + + ``` bash + cd MAILCOW_ROOT # Usually /opt/mailcow-dockerized + docker-compose exec rspamd-mailcow bash + rm -rf /var/lib/rspamd/*.hs + rm -rf /var/lib/rspamd/*.hsmp + ``` + +Restart Rspamd afterwards: + +=== "docker compose (Plugin)" + + ``` bash + docker compose restart rspamd-mailcow + ``` + +=== "docker-compose (Standalone)" + + ``` bash + docker-compose restart rspamd-mailcow + ``` + +Now Rspamd recompiles the said regex maps again with Hyperscan. + +!!! warning + The original Hyperscan works (as of May 2023) **ONLY** on x86. ARM64 is **not** expected to be officially supported by Intel[^3] + + +[^1]: [netcat](https://linux.die.net/man/1/nc), [nmap](https://linux.die.net/man/1/nmap), [openssl](https://wiki.openssl.org/index.php/Manual:S_client(1)), [telnet](https://linux.die.net/man/1/telnet), etc. +[^2]: [Hyperscan](https://github.com/intel/hyperscan) +[^3]: [Status for Hyperscan on ARM64](https://github.com/intel/hyperscan/pull/287#issuecomment-746558138) \ No newline at end of file