Log erreur divers

Bonjour Bison,

A la suite de la mise en place d’un système de log perso de gestion d’erreurs, plus ‹ exhaustifs › que celui de jeedom à l’origine ( declare(strict_types=1); ) ,

J’ai qq remontée de messages qui n’ont visiblement pas d’impact sur l’usage mais permettent de ‹ nettoyer › les codes par sécurité ( PHP 8.2 et suivant devient très rigide :slight_smile: )

Je te communique pour info ce qui concerne solcast (petit prob’ de clef de tableau vide)

0010|[PROCESS: jeeCron.php_1824320] ***** PHP ERROR : solcast.class.php - LIGNE 1604 : Undefined array key 3 *****
0011|[PROCESS: jeeCron.php_1824320] ***** PHP ERROR : solcast.class.php - LIGNE 1604 : Trying to access array offset on value of type null *****

Bonjour,
J’ai ça aussi chaque nuit dans http.error:

0222|[Wed Mar 19 00:05:07.973549 2025] [php7:notice] [pid 571873:tid 571873] [client 192.168.1.147:51764] PHP Notice:  Trying to access array offset on value of type null in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1982
...
0251|[Wed Mar 19 00:05:07.977802 2025] [php7:notice] [pid 571873:tid 571873] [client 192.168.1.147:51764] PHP Notice:  Trying to access array offset on value of type null in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1983

Sur les lignes de log 222 à 251. Debian 11, Jeedom 4.4.19, plugin en beta du 2025-03-16 21:27:33

Hello @m.georgein,

Est-ce qu’il n’y a des soucis que sur la ligne 1604 ? Pas sur la 1595 par exemple ? ça n’a pas bien de sens après première analyse …

Tient d’ailleurs il y a une boulette, c’est le même if :sweat_smile:

Salut @jpty,

Est-ce que tu peux rajouter cette ligne dans le fichier stp pour me dire si c’est OK après cette nuit ?

Entre les lignes 1987 et 1998 :

    (string)$dataProd = '';

Donc avoir ça :

    $dataProduction = '';
    (string)$dataProd = '';
    $nbZones = 0;

Bonjour,

Pour les messages d’erreur Trying to access array offset on value of type null, à mon avis c’est plutôt $array_pv_reliability qui n’est pas une array mais null.

Je regarde pour ajouter des tests/message.
Comme c’est dans toHtml() il faut aussi que la tuile soit affichée lors du reset à 0h05.
Je ne l’ai pas eu la nuit passée. Le PC qui affiche était éteint.

1 « J'aime »

Mouais c’est un peu pour ça que je voulais que tu tests si possible parce que je voyais pas trop pourquoi ce message sur les 2 lignes indiquées mais on a pas les même lignes alors que j’ai la même version que toi sur ma prod …

Je ne t’avais donné qu’un exemple de lignes, mais il en avait d’autres ::frowning: en fait le message est trompeur, l’important c’est « Undefined array key 3 » qui fait probablement référence aux lignes 1121-1122 avec [$j]

Ces erreurs ne sont pas des erreurs syntaxiques ‹ statique ›, mais généré dynamiquement par le code quand il ‹ tourne ›.

Sur les anciennes versions de PHP une foule de typage était affectés plus ou moins par défaut mais cela change de plus en plus avec les nouvelles versions pour obliger à plus de rigueur.
Un peu dur pour les devs mais beaucoup de bug ‹ flou › ou ‹ aléatoire › :wink: en moins à l’avenir.

En d’autres termes, dans ton cas, tu peux essayer des trucs comme

  1. !isset($array_pv[$d][‹ estimate10 ›][$j])
  2. $xxxxx = $array_pv[$d][‹ estimate10 ›][$j] ?? null;

Si tu veux t’amuser, il suffit de mettre

<?php
declare(strict_types=1);

en tête de tes codes et tu verras ta propre tête blanchir vite fait !!!

Perso je l’ai fait sur l’ensemble de mes codes PHP et de mes plugins,

Un gros boulot mais au vu des sueurs froides rétrospectives que j’ai eu, je ne regrette pas les heures passées.

J’ajoute ma pierre à l’édifice. J’ai tout plein d’erreurs dans le log cron_execution

7579|PHP Notice:  Undefined offset: 1 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1117
7580|PHP Notice:  Trying to access array offset on value of type null in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1117
7581|PHP Notice:  Trying to access array offset on value of type null in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1117
7582|PHP Notice:  Undefined offset: 1 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1116
7583|PHP Notice:  Trying to access array offset on value of type null in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1116
7584|PHP Notice:  Trying to access array offset on value of type null in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1116
7585|PHP Notice:  Undefined offset: 1 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1117
7586|PHP Notice:  Trying to access array offset on value of type null in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1117
7587|PHP Notice:  Trying to access array offset on value of type null in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1117
7884|PHP Notice:  Undefined offset: 0 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7885|PHP Notice:  Trying to access array offset on value of type null in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7886|PHP Notice:  Trying to access array offset on value of type null in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7887|PHP Notice:  Undefined offset: 1 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7888|PHP Notice:  Undefined index: pv_estimate10 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7889|PHP Notice:  Trying to access array offset on value of type null in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7890|PHP Notice:  Undefined offset: 1 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7891|PHP Notice:  Undefined index: pv_estimate90 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7892|PHP Notice:  Trying to access array offset on value of type null in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7893|PHP Notice:  Undefined offset: 1 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7894|PHP Notice:  Undefined offset: 2 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7895|PHP Notice:  Undefined offset: 2 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7896|PHP Notice:  Undefined offset: 2 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7897|PHP Notice:  Undefined offset: 2 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7898|PHP Notice:  Undefined offset: 2 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7899|PHP Notice:  Undefined offset: 2 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7900|PHP Notice:  Undefined offset: 3 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7901|PHP Notice:  Undefined offset: 3 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7902|PHP Notice:  Undefined offset: 3 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7903|PHP Notice:  Undefined offset: 3 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7904|PHP Notice:  Undefined offset: 3 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7905|PHP Notice:  Undefined offset: 3 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7906|PHP Notice:  Undefined offset: 4 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7907|PHP Notice:  Undefined offset: 4 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7908|PHP Notice:  Undefined offset: 4 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7909|PHP Notice:  Undefined offset: 4 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7910|PHP Notice:  Undefined offset: 4 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7911|PHP Notice:  Undefined offset: 4 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7912|PHP Notice:  Undefined offset: 5 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7913|PHP Notice:  Undefined offset: 5 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7914|PHP Notice:  Undefined offset: 5 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7915|PHP Notice:  Undefined offset: 5 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7916|PHP Notice:  Undefined offset: 5 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7917|PHP Notice:  Undefined offset: 5 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7918|PHP Notice:  Undefined offset: 6 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7919|PHP Notice:  Undefined offset: 6 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7920|PHP Notice:  Undefined offset: 6 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7921|PHP Notice:  Undefined offset: 6 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7922|PHP Notice:  Undefined offset: 6 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7923|PHP Notice:  Undefined offset: 6 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7924|PHP Notice:  Undefined offset: 7 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7925|PHP Notice:  Undefined offset: 7 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7926|PHP Notice:  Undefined offset: 7 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7927|PHP Notice:  Undefined offset: 8 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7928|PHP Notice:  Undefined offset: 8 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7929|PHP Notice:  Undefined offset: 8 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7930|PHP Notice:  Undefined offset: 9 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7931|PHP Notice:  Undefined offset: 9 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7932|PHP Notice:  Undefined offset: 9 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7933|PHP Notice:  Undefined offset: 10 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7934|PHP Notice:  Undefined offset: 10 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7935|PHP Notice:  Undefined offset: 10 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7936|PHP Notice:  Undefined offset: 11 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7937|PHP Notice:  Undefined offset: 11 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7938|PHP Notice:  Undefined offset: 11 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7939|PHP Notice:  Undefined offset: 12 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7940|PHP Notice:  Undefined offset: 12 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7941|PHP Notice:  Undefined offset: 12 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7942|PHP Notice:  Undefined offset: 13 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7943|PHP Notice:  Undefined offset: 13 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7944|PHP Notice:  Undefined offset: 13 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7945|PHP Notice:  Undefined offset: 14 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7946|PHP Notice:  Undefined offset: 14 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7947|PHP Notice:  Undefined offset: 14 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7948|PHP Notice:  Undefined offset: 15 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7949|PHP Notice:  Undefined offset: 15 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7950|PHP Notice:  Undefined offset: 15 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7951|PHP Notice:  Undefined offset: 16 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7952|PHP Notice:  Undefined offset: 16 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7953|PHP Notice:  Undefined offset: 16 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7954|PHP Notice:  Undefined offset: 17 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7955|PHP Notice:  Undefined offset: 17 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7956|PHP Notice:  Undefined offset: 17 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7957|PHP Notice:  Undefined offset: 18 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7958|PHP Notice:  Undefined offset: 18 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7959|PHP Notice:  Undefined offset: 18 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7960|PHP Notice:  Undefined offset: 19 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7961|PHP Notice:  Undefined offset: 19 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7962|PHP Notice:  Undefined offset: 19 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7963|PHP Notice:  Undefined offset: 20 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7964|PHP Notice:  Undefined offset: 20 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7965|PHP Notice:  Undefined offset: 20 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7966|PHP Notice:  Undefined offset: 21 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7967|PHP Notice:  Undefined offset: 21 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7968|PHP Notice:  Undefined offset: 21 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7969|PHP Notice:  Undefined offset: 22 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7970|PHP Notice:  Undefined offset: 22 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7971|PHP Notice:  Undefined offset: 22 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7972|PHP Notice:  Undefined offset: 22 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7973|PHP Notice:  Undefined offset: 22 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7974|PHP Notice:  Undefined offset: 22 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7975|PHP Notice:  Undefined offset: 23 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7976|PHP Notice:  Undefined offset: 23 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7977|PHP Notice:  Undefined offset: 23 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7978|PHP Notice:  Undefined offset: 23 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7979|PHP Notice:  Undefined offset: 23 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7980|PHP Notice:  Undefined offset: 23 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7981|PHP Notice:  Undefined offset: 1 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7982|PHP Notice:  Trying to access array offset on value of type null in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7983|PHP Notice:  Trying to access array offset on value of type null in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7984|PHP Notice:  Undefined offset: 1 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7985|PHP Notice:  Undefined index: pv_estimate10 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7986|PHP Notice:  Trying to access array offset on value of type null in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7987|PHP Notice:  Undefined offset: 1 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7988|PHP Notice:  Undefined index: pv_estimate90 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7989|PHP Notice:  Trying to access array offset on value of type null in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7990|PHP Notice:  Undefined offset: 1 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7991|PHP Notice:  Undefined offset: 2 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7992|PHP Notice:  Undefined offset: 2 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7993|PHP Notice:  Undefined offset: 2 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7994|PHP Notice:  Undefined offset: 2 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
7995|PHP Notice:  Undefined offset: 2 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7996|PHP Notice:  Undefined offset: 2 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
7997|PHP Notice:  Undefined offset: 3 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7998|PHP Notice:  Undefined offset: 3 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
7999|PHP Notice:  Undefined offset: 3 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8000|PHP Notice:  Undefined offset: 3 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8001|PHP Notice:  Undefined offset: 3 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8002|PHP Notice:  Undefined offset: 3 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8003|PHP Notice:  Undefined offset: 4 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8004|PHP Notice:  Undefined offset: 4 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8005|PHP Notice:  Undefined offset: 4 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8006|PHP Notice:  Undefined offset: 4 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8007|PHP Notice:  Undefined offset: 4 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8008|PHP Notice:  Undefined offset: 4 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8009|PHP Notice:  Undefined offset: 5 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8010|PHP Notice:  Undefined offset: 5 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8011|PHP Notice:  Undefined offset: 5 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8012|PHP Notice:  Undefined offset: 5 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8013|PHP Notice:  Undefined offset: 5 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8014|PHP Notice:  Undefined offset: 5 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8015|PHP Notice:  Undefined offset: 6 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8016|PHP Notice:  Undefined offset: 6 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8017|PHP Notice:  Undefined offset: 6 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8018|PHP Notice:  Undefined offset: 6 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8019|PHP Notice:  Undefined offset: 6 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8020|PHP Notice:  Undefined offset: 6 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8021|PHP Notice:  Undefined offset: 7 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8022|PHP Notice:  Undefined offset: 7 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8023|PHP Notice:  Undefined offset: 7 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8024|PHP Notice:  Undefined offset: 8 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8025|PHP Notice:  Undefined offset: 8 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8026|PHP Notice:  Undefined offset: 8 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8027|PHP Notice:  Undefined offset: 9 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8028|PHP Notice:  Undefined offset: 9 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8029|PHP Notice:  Undefined offset: 9 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8030|PHP Notice:  Undefined offset: 10 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8031|PHP Notice:  Undefined offset: 10 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8032|PHP Notice:  Undefined offset: 10 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8033|PHP Notice:  Undefined offset: 11 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8034|PHP Notice:  Undefined offset: 11 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8035|PHP Notice:  Undefined offset: 11 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8036|PHP Notice:  Undefined offset: 12 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8037|PHP Notice:  Undefined offset: 12 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8038|PHP Notice:  Undefined offset: 12 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8039|PHP Notice:  Undefined offset: 13 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8040|PHP Notice:  Undefined offset: 13 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8041|PHP Notice:  Undefined offset: 13 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8042|PHP Notice:  Undefined offset: 14 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8043|PHP Notice:  Undefined offset: 14 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8044|PHP Notice:  Undefined offset: 14 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8045|PHP Notice:  Undefined offset: 15 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8046|PHP Notice:  Undefined offset: 15 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8047|PHP Notice:  Undefined offset: 15 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8048|PHP Notice:  Undefined offset: 16 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8049|PHP Notice:  Undefined offset: 16 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8050|PHP Notice:  Undefined offset: 16 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8051|PHP Notice:  Undefined offset: 17 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8052|PHP Notice:  Undefined offset: 17 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8053|PHP Notice:  Undefined offset: 17 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8054|PHP Notice:  Undefined offset: 18 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8055|PHP Notice:  Undefined offset: 18 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8056|PHP Notice:  Undefined offset: 18 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8057|PHP Notice:  Undefined offset: 19 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8058|PHP Notice:  Undefined offset: 19 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8059|PHP Notice:  Undefined offset: 19 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8060|PHP Notice:  Undefined offset: 20 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8061|PHP Notice:  Undefined offset: 20 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8062|PHP Notice:  Undefined offset: 20 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8063|PHP Notice:  Undefined offset: 21 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8064|PHP Notice:  Undefined offset: 21 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8065|PHP Notice:  Undefined offset: 21 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8066|PHP Notice:  Undefined offset: 22 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8067|PHP Notice:  Undefined offset: 22 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8068|PHP Notice:  Undefined offset: 22 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8069|PHP Notice:  Undefined offset: 22 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8070|PHP Notice:  Undefined offset: 22 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8071|PHP Notice:  Undefined offset: 22 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8072|PHP Notice:  Undefined offset: 23 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8073|PHP Notice:  Undefined offset: 23 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1097
8074|PHP Notice:  Undefined offset: 23 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8075|PHP Notice:  Undefined offset: 23 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1098
8076|PHP Notice:  Undefined offset: 23 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8077|PHP Notice:  Undefined offset: 23 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1099
8078|PHP Notice:  Undefined offset: 0 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1116
8079|PHP Notice:  Trying to access array offset on value of type null in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1116
8080|PHP Notice:  Trying to access array offset on value of type null in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1116
8081|PHP Notice:  Undefined offset: 1 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1116
8082|PHP Notice:  Trying to access array offset on value of type null in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1116
8083|PHP Notice:  Undefined index: percent in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1117
8084|PHP Notice:  Undefined offset: 1 in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1117
8085|PHP Notice:  Trying to access array offset on value of type null in /var/www/html/plugins/solcast/core/class/solcast.class.php on line 1117
8086|PHP Notice:  Undefined offset: 2 in 

Salut,

Heu, c’est avec le mode « invente des erreurs même si y’en a pas » ?? :scream::sob:

Quelle version tu as ?

La dernière stable


C’est des warning, hein. tout marche bien sinon

8 casts ajoutés et un retour de strpos() testé pour la classe principale et le desktop de mon plugin-weatherforecast pour reobtenir l’affichage et le refresh.
Est-il possible d’ « adoucir » le comportement en signalant les erreurs et en continuant l’exécution au lieu de les avoir une par une ?

Le plus gros prob, à mon avis, de cette option c’est que le gestionnaire d’erreur de Jeedom ne remonte pas la majorité de ses messages comme des erreurs et donc ils ne sont pas facilement identifiables. A titre d’exemple voilà la liste des messages d’erreurs (souvent fatales) que j’ai identifié :

private $errorPatterns = array(
		'TypeError:',
		'ArgumentCountError:',
		'ValueError:',
		'DivisionByZeroError:',
		'Division by zero',
		'Error:',
		'Parse error:',
		'Fatal error:',
		'Notice:',
		'Warning:',
		'Deprecated:',
		'Uncaught Exception',
		'Exception thrown',
		'Undefined variable',
		'Undefined array key',
		'Trying to access array offset',
		'Cannot assign',
		'Cannot use object',
		'Object of class',
		'Call to undefined function',
		'Call to undefined method',
		'Cannot declare class',
		'Class not found',
		'Interface not found',
		'Trait not found',
		'Undefined constant',
		'null given',
		'expects parameter',
		'must be of type',
		'syntax error'
	);

J’ai fini par faire un prog qui surveille tous les logs et préfixe du mot [ERROR] toutes les lignes en erreurs et les affiche sur le dashboard principal. Comme ça plus besoin de les chercher :).

Une fois que l’on a compris la mécanique de ces erreurs (et de leur message … pas trés clair), les corriger va assez vite … :frowning:

Cette option php fait essentiellement remonter des erreurs de typage ou des absences d’init (en fait c’est pareil) qui PEUVENT poser problème dans CERTAINS cas de calcul.

Dans les anciennes versions de PHP, un mécanisme de cast par défaut était en place mais pour augmenter la fiabilité du langage cette tolérance est supprimée progressivement depuis la v8

A ma connaissance le seul moyen serait de créer un fichier « error_handler.php » à lancer dans le PHP.ini pour faire un ‹ try › des erreurs fatales.
Perso j’utilise « error_handler.php » pour afficher le nom du script et le N° de ligne responsable de l’erreur dans les message de PHP.

Exact , si tu n’actives pas l’option « declare(strict_types=1); » il y a de fortes chances que php ne remonte QUE des warnings (ou même rien, ce qui est le vrai problème) puisque le cast par défaut ‹ masque › généralement l’erreur.
Mais se mécanisme étant appelé à disparaitre, outre le fait que ce n’est pas trés sain, j’ai préféré passé tous mes code avec cette option et régler ce type de problème une fois pour toutes.

1 « J'aime »

J’ai ajouté ça et je ne vois rien sur ma PROD (déjà en faisant un refresh de la page d’affichage des widgets du plugin)

image

C’est sensé envoyé plein de warning dans le http.error ?

Bonjour,
Oui, mais uniquement s’il y a des erreurs de type.
Et une par une. Php s’arrête dés qu’il y a une erreur.

Bon donc pas une bonne idée de tester en PROD. Le soucis c’est que depuis je ne sais trop quand, mon http.error est vide sur ma env 4.5 de test. Impossible de trouver pourquoi donc ça va être compliqué :expressionless:

Surtout dans les 3 logs jeedom ‹ xxxxx_execution ›, et/ou directement dans les blocs code s’il s’agit de scénario.
Mais ATTENTION, les erreurs fatales ne sont pas toujours signalées par le mot ERROR (puisque par définition, traité APRES le plantage) et donc peu visible

PS : EVITE LA PROD !!! sinon en plus des cheveux blancs tu vas me haïr :frowning:

1 « J'aime »

J’ai veillé en vain cette nuit pour surveiller les PHP Notice.
Il n’y en a pas eu.
Je pense que ca doit être uniquement dans les premiers jours de fonctionnement du plugin (ou de perte d’historique).
Je vérifie en créant un nouvel équipement et te tiens au courant.

Bon pour mes erreurs, j’ai corrigé le code comme ça:

  • Lignes 1116 et 1117, je remplace
          $array_pv_reliability_avg[$i][$j]['ecart'] = (int) $array_pv_reliability_avg[$i][$j]['ecart'] + (int) $array_pv_reliability[$i][$j]['ecart'];
          $array_pv_reliability_avg[$i][$j]['percent'] = (int) $array_pv_reliability_avg[$i][$j]['percent'] + (int) $array_pv_reliability[$i][$j]['percent'];

par ça:

          $ecart = isset($array_pv_reliability[$i][$j]['ecart']) ? (int)$array_pv_reliability[$i][$j]['ecart'] : 0;
		  $percent = isset($array_pv_reliability[$i][$j]['percent']) ? (int)$array_pv_reliability[$i][$j]['percent'] : 0;

	      $array_pv_reliability_avg[$i][$j]['ecart'] = (isset($array_pv_reliability_avg[$i][$j]['ecart']) ? (int)$array_pv_reliability_avg[$i][$j]['ecart'] : 0) + $ecart;
		  $array_pv_reliability_avg[$i][$j]['percent'] = (isset($array_pv_reliability_avg[$i][$j]['percent']) ? (int)$array_pv_reliability_avg[$i][$j]['percent'] : 0) + $percent;

Et pour les lignes 1097, 1098, 1099, je remplace ça:

          $array_pv_sum[$i]['pv_estimate'][$j] = (int) $array_pv_sum[$i]['pv_estimate'][$j] + (int) $array_pv[$i]['estimate'][$j];
          $array_pv_sum[$i]['pv_estimate10'][$j] = (int) $array_pv_sum[$i]['pv_estimate10'][$j] + (int) $array_pv[$i]['estimate10'][$j];
          $array_pv_sum[$i]['pv_estimate90'][$j] = (int) $array_pv_sum[$i]['pv_estimate90'][$j] + (int) $array_pv[$i]['estimate90'][$j];

par ça:

          $array_pv_sum[$i]['pv_estimate'][$j] = (isset($array_pv_sum[$i]['pv_estimate'][$j]) ? (int)$array_pv_sum[$i]['pv_estimate'][$j] : 0) + (isset($array_pv[$i]['estimate'][$j]) ? (int)$array_pv[$i]['estimate'][$j] : 0);
          $array_pv_sum[$i]['pv_estimate10'][$j] = (isset($array_pv_sum[$i]['pv_estimate10'][$j]) ? (int)$array_pv_sum[$i]['pv_estimate10'][$j] : 0) + (isset($array_pv[$i]['estimate10'][$j]) ? (int)$array_pv[$i]['estimate10'][$j] : 0);
          $array_pv_sum[$i]['pv_estimate90'][$j] = (isset($array_pv_sum[$i]['pv_estimate90'][$j]) ? (int)$array_pv_sum[$i]['pv_estimate90'][$j] : 0) + (isset($array_pv[$i]['estimate90'][$j]) ? (int)$array_pv[$i]['estimate90'][$j] : 0);

Je laisse tourner pour voir si tout va bien et que je n’ai plus les anomalies

Yep je suis aussi sur le sujet en utilisant des Null Coalescing Operator (??)

EDIT : ça fonctionne pas, je tente avec des isset normaux …

Je viens de publier une bêta, vous pouvez regarder ce que ça donne svp ?