Page 1 of 1

PHP error bei backup und awstats

Posted: Tue 13. Sep 2022, 15:12
by Henning
STOP - Bitte lesen Sie die nächsten Zeilen aufmerksam!

1) Bitte füllen Sie die unten stehende Beitragsvorlage vollständig aus!
2) Die Mitglieder dieses Forum stellen ihre wertvolle Zeit zur Verfügung, um zu helfen! Bitte stellen Sie im Gegenzug soviel Informationen wie möglich zur Verfügung und seien Sie in der Fehlerbeschreibung konkret. Beiträge die geringe Eigeninitiative zeigen werden wahrscheinlich keine guten Antworten erhalten!

Sie können diesen oberen Teil der Beitragsvorlage entfernen.
Die folgende Beitragsvorlage darf jedoch in keinem Fall entfernt werden.
---------------------------------------------------------------------------


Ich bin sicher, dass die Ursache des Problems bei KeyHelp liegt
(Probleme ohne KeyHelp-Bezug gehören ins Offtopic-Forum)
Denke ja

Server-Betriebssystem + Version
(z.B. Ubuntu 20.04)
Debian 11.5 64bit

Eingesetzte Server-Virtualisierung-Technologie
(z.B. keine, OpenVZ, KVM, XEN, etc.)
KVM (netcup)

KeyHelp-Version + Build-Nummer
(z.B. 22.0 - Build 2366)
22.2 build 2838

Problembeschreibung / Fehlermeldungen
Diese Einträge finden sich im php-error.log wieder:
[10-Jul-2022 03:08:24 Europe/Berlin] PHP Warning: preg_match(): Allocation of JIT memory failed, PCRE JIT will be disabled. This is likely caused by security restrictions. Either grant PHP permission to allocate executable memory, or set pcre.jit=0 in /home/keyhelp/www/keyhelp/core/Helper/IpAddress.php on line 158
[10-Jul-2022 03:08:25 Europe/Berlin] PHP Warning: file_put_contents(/etc/awstats/awstats.web1.conf): failed to open stream: Read-only file system in /home/keyhelp/www/keyhelp/cronjob/jobs/statistic.php on line 504
[10-Jul-2022 03:08:38 Europe/Berlin] PHP Warning: file_put_contents(/etc/awstats/awstats.web2.conf): failed to open stream: Read-only file system in /home/keyhelp/www/keyhelp/cronjob/jobs/statistic.php on line 504
[10-Jul-2022 03:08:49 Europe/Berlin] PHP Warning: preg_match(): Allocation of JIT memory failed, PCRE JIT will be disabled. This is likely caused by security restrictions. Either grant PHP permission to allocate executable memory, or set pcre.jit=0 in /home/keyhelp/www/keyhelp/core/Helper/IpAddress.php on line 158
[10-Jul-2022 03:08:49 Europe/Berlin] PHP Warning: preg_match(): Allocation of JIT memory failed, PCRE JIT will be disabled. This is likely caused by security restrictions. Either grant PHP permission to allocate executable memory, or set pcre.jit=0 in /home/keyhelp/www/keyhelp/core/Helper/IpAddress.php on line 158
[10-Jul-2022 03:08:50 Europe/Berlin] PHP Warning: preg_match(): Allocation of JIT memory failed, PCRE JIT will be disabled. This is likely caused by security restrictions. Either grant PHP permission to allocate executable memory, or set pcre.jit=0 in /home/keyhelp/www/keyhelp/core/Helper/IpAddress.php on line 158
[31-Jul-2022 00:00:02 Europe/Berlin] PHP Warning: chmod(): No such file or directory in /home/keyhelp/www/keyhelp/functions/functions.main.php on line 2821
[31-Jul-2022 00:00:02 Europe/Berlin] PHP Warning: rename(/home/keyhelp/keyhelp.backup/dumps/tmp.sql,/home/keyhelp/keyhelp.backup/dumps/keyhelp.sql): No such file or directory in /home/keyhelp/www/keyhelp/cronjob/jobs/01-maintenance.php on line 275
[04-Sep-2022 00:00:04 Europe/Berlin] PHP Warning: chmod(): No such file or directory in /home/keyhelp/www/keyhelp/functions/functions.main.php on line 2821
[04-Sep-2022 00:00:04 Europe/Berlin] PHP Warning: rename(/home/keyhelp/keyhelp.backup/dumps/tmp.sql,/home/keyhelp/keyhelp.backup/dumps/keyhelp.sql): No such file or directory in /home/keyhelp/www/keyhelp/cronjob/jobs/01-maintenance.php on line 275
Erwartetes Ergebnis
Das solche Einträge nicht entstehen. Das Log ist nicht gekürzt, die Fehler entstehen also nicht täglich sondern so, wie oben abgebildet 1:1.

Tatsächliches Ergebnis


Schritte zur Reproduktion
Ich denke, das passiert nachts, durch automatisierte Prozesse beim Backup und Erstellung der Statistiken.

Zusätzliche Informationen
(z.B. kürzlich durchgeführte Änderungen am Server, Auszüge aus Protokolldateien (/var/log/*, /var/log/keyhelp/php-error.log, etc.))
Nichts weiter getan.

Was kann ich tun, damit zukünftig solche Fehler wie oben nicht mehr passieren?
PCRE JIT will be disabled
Was hat das für Auswirkungen auf mein Produktivsystem?

Vielen Dank für eure Bemühungen im voraus.

Re: PHP error bei backup und awstats

Posted: Tue 13. Sep 2022, 15:47
by Alexander
Grüße, schau einmal in deinen Thread vom Sommer:

viewtopic.php?t=11538

Re: PHP error bei backup und awstats

Posted: Tue 13. Sep 2022, 15:47
by Blackmoon
Könnte dies auf dich zu treffen:
viewtopic.php?p=36525

Re: PHP error bei backup und awstats

Posted: Wed 14. Sep 2022, 08:28
by Henning
:roll: danke für den Hinweis.

Ich habe das jetzt nochmal eben gecheckt, meine aktuelle logrotate.service sieht wie folgt aus:
[Unit]
Description=Rotate log files
Documentation=man:logrotate(8) man:logrotate.conf(5)
ConditionACPower=true

[Service]
Type=oneshot
ExecStart=/usr/sbin/logrotate /etc/logrotate.conf

# performance options
Nice=19
IOSchedulingClass=best-effort
IOSchedulingPriority=7

# hardening options
# details: https://www.freedesktop.org/software/sy ... .exec.html
# no ProtectHome for userdir logs
# no PrivateNetwork for mail deliviery
# no ProtectKernelTunables for working SELinux with systemd older than 235
# no MemoryDenyWriteExecute for gzip on i686
PrivateDevices=true
PrivateTmp=true
ProtectControlGroups=true
ProtectKernelModules=true
ProtectSystem=full
RestrictRealtime=true

# Exception so that AWStats works without complaints
ReadWritePaths=/etc/awstats
Insbesondere letzteres fehlte ja am Anfang, steht aber weiterhin mit drin.