Project

General

Profile

Demande #6364

/var plein sur drupal6

Added by Pierre-Louis Bonicoli about 2 months ago. Updated about 2 months ago.

Status:
Résolu
Priority:
Normale
Category:
-
Target version:
Start date:
02/27/2024
Due date:
% Done:

100%

Estimated time:
Difficulté:
2 Facile

Description

Depuis le 20 février, un très grand nombre de "strict warning" PHP apparaissent dans les logs :

(April) root@drupal6:~# df -h /var/
Filesystem                  Size  Used Avail Use% Mounted on
/dev/mapper/vg_drupal6-var  6.6G  6.3G     0 100% /var

(April) root@drupal6:~# ls -lh /var/log/apache2/www.april.org.error.log{,.1}
-rw-r----- 1 root adm 2.6G Feb 27 00:13 /var/log/apache2/www.april.org.error.log
-rw-r----- 1 root adm 2.1G Feb 26 06:27 /var/log/apache2/www.april.org.error.log.1

(April) root@drupal6:~# wc -l /var/log/apache2/www.april.org.error.log
2819608 /var/log/apache2/www.april.org.error.log

(April) root@drupal6:~# grep -vF "strict warning" /var/log/apache2/www.april.org.error.log | wc -l
2428

(April) root@drupal6:~# zcat /var/log/apache2/www.april.org.error.log.7.gz | grep "strict warning" |wc -l
0
(April) root@drupal6:~# zcat /var/log/apache2/www.april.org.error.log.6.gz | grep "strict warning" |wc -l
2933163

(April) root@drupal6:~# zcat /var/log/apache2/www.april.org.error.log.6.gz | grep -m 1 "strict warning" 
[Tue Feb 20 14:51:15.029366 2024] [:error] [pid 14265] [client <redacted>:60766] PHP Warning:  Duplicate entry &#039;2147483647&#039; for key &#039;PRIMARY&#039;\nquery: INSERT INTO watchdog\n    (uid, type, message, variables, severity, link, location, referer, hostname, timestamp)\n    VALUES\n    (0, &#039;php&#039;, &#039;%message in %file on line %line.&#039;, &#039;a:4:{s:6:\\&quot;%error\\&quot;;s:14:\\&quot;strict warning\\&quot;;s:8:\\&quot;%message\\&quot;;s:134:\\&quot;Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &amp;$form_state)\\&quot;;s:5:\\&quot;%file\\&quot;;s:75:\\&quot;/etc/drupal/6/sites/default/modules/views/handlers/views_handler_filter.inc\\&quot;;s:5:\\&quot;%line\\&quot;;i:0;}&#039;, 3, &#039;&#039;, &#039;https://www.april.org/april?amp=&amp;page=205,1,5,5,2,8,7,3,3&#039;, &#039;&#039;, &#039;<redacted>#039;, 1708437075) in /usr/share/drupal6/includes/database.mysql.inc on line 135


Related issues

Related to Admins - Demande #1919: Patcher le Drupal pour éviter de remplir la table watchdogFermé04/23/201704/24/2017

Actions
Related to Admins - Anomalie #3532: Le filesystem de la VM Drupal partie Mysql se remplit dangereusementFermé01/02/2019

Actions

History

#1

Updated by Pierre-Louis Bonicoli about 2 months ago

  • Status changed from Nouveau to En cours de traitement
  • Assignee set to Pierre-Louis Bonicoli
#2

Updated by Pierre-Louis Bonicoli about 2 months ago

J'ai appliqué le patch ci-dessous le temps de forcer deux fois de suite la rotation du fichier avec logrotate --force /etc/logrotate.d/apache2

(April) root@drupal6:~# git -C /srv/common/etc diff logrotate.d/apache2
diff --git a/etc/logrotate.d/apache2 b/etc/logrotate.d/apache2
index d82bc76..b38e3dc 100644
--- a/etc/logrotate.d/apache2
+++ b/etc/logrotate.d/apache2
@@ -1,6 +1,7 @@
-/var/log/apache2/*/*.log 
-/var/log/apache2/*_log
-/var/log/apache2/*.log {
+#/var/log/apache2/*/*.log 
+#/var/log/apache2/*_log
+#/var/log/apache2/*.log {
+/var/log/apache2/www.april.org.error.log {
        daily
        missingok
        rotate 14

#3

Updated by Pierre-Louis Bonicoli about 2 months ago

  • Status changed from En cours de traitement to Résolu
  • % Done changed from 0 to 100

La colonne wid de la table watchdog et de type int AUTO_INCREMENT=2147483648 a atteint sa valeur maximum.

Il n'y a que 100 lignes dans la table watchdog:

mysql> select count(*) from watchdog;
+----------+
| count(*) |
+----------+
|      100 |
+----------+
1 row in set (0.00 sec)

mysql> select wid from watchdog order by wid asc limit 1;
+------------+
| wid        |
+------------+
| 2147483548 |
+------------+
1 row in set (0.00 sec)

mysql> select wid from watchdog order by wid desc limit 1;
+------------+
| wid        |
+------------+
| 2147483647 |
+------------+
1 row in set (0.00 sec)

J'utilise cette commande mysqldump -p --no-data --compact drupal6 et cette query pour vérifier que wid n'est pas réutiliser dans une autre table et je réinitialise le compteur: TRUNCATE TABLE watchdog;

Une tâche cron de drupal ne conserve que les 100 dernières entrées de la table watchdog. Cette tâche cron est exécutée tous les jours à minuit (cf /etc/cron.d/drupal6).

Si je comprends bien la doc drupal, on ne peut pas choisir d'exclure les warnings des logs.

#4

Updated by Pierre-Louis Bonicoli about 2 months ago

  • Related to Demande #1919: Patcher le Drupal pour éviter de remplir la table watchdog added
#5

Updated by Pierre-Louis Bonicoli about 2 months ago

  • Related to Anomalie #3532: Le filesystem de la VM Drupal partie Mysql se remplit dangereusement added

Also available in: Atom PDF