Erreur cron10 Unsupported operand types: string * int

Bonjour

Depuis la dernière mise à jour debian, j’ai une erreur cron10.

2024-09-17 21:40:06	Metar_infos	Erreur sur la fonction cron10 du plugin : Unsupported operand types: string * int	Log Metar_infos	8
0623|[Tue Sep 17 21:29:48.179526 2024] [php:error] [pid 2047278:tid 2047278] [client 192.168.1.53:58632] PHP Fatal error:  Uncaught TypeError: Unsupported operand types: string * int in /var/www/html/plugins/Metar_infos/3rdparty/Metar.php:1080\nStack trace:\n#0 /var/www/html/plugins/Metar_infos/3rdparty/Metar.php(520): Metar->get_clouds()\n#1 /var/www/html/plugins/Metar_infos/3rdparty/Metar.php(1511): Metar->parse()\n#2 /var/www/html/plugins/Metar_infos/3rdparty/Metar.php(520): Metar->get_trends()\n#3 /var/www/html/plugins/Metar_infos/core/ressources/MetarData.php(329): Metar->parse()\n#4 /var/www/html/plugins/Metar_infos/core/class/Metar_infos.class.php(317): Taf_GetData()\n#5 /var/www/html/plugins/Metar_infos/core/class/Metar_infos.class.php(433): Metar_infos->getInformations()\n#6 /var/www/html/core/class/DB.class.php(250): Metar_infos->postSave()\n#7 /var/www/html/core/class/eqLogic.class.php(1053): DB::save()\n#8 /var/www/html/core/ajax/eqLogic.ajax.php(501): eqLogic->save()\n#9 {main}\n  thrown in /var/www/html/plugins/Metar_infos/3rdparty/Metar.php on line 1080
0624|[Tue Sep 17 21:29:50.602345 2024] [php:error] [pid 2020687:tid 2020687] [client 192.168.1.53:58636] PHP Fatal error:  Uncaught TypeError: Unsupported operand types: string * int in /var/www/html/plugins/Metar_infos/3rdparty/Metar.php:1080\nStack trace:\n#0 /var/www/html/plugins/Metar_infos/3rdparty/Metar.php(520): Metar->get_clouds()\n#1 /var/www/html/plugins/Metar_infos/3rdparty/Metar.php(1511): Metar->parse()\n#2 /var/www/html/plugins/Metar_infos/3rdparty/Metar.php(520): Metar->get_trends()\n#3 /var/www/html/plugins/Metar_infos/core/ressources/MetarData.php(329): Metar->parse()\n#4 /var/www/html/plugins/Metar_infos/core/class/Metar_infos.class.php(317): Taf_GetData()\n#5 /var/www/html/plugins/Metar_infos/core/class/Metar_infos.class.php(433): Metar_infos->getInformations()\n#6 /var/www/html/core/class/DB.class.php(250): Metar_infos->postSave()\n#7 /var/www/html/core/class/eqLogic.class.php(1053): DB::save()\n#8 /var/www/html/core/ajax/eqLogic.ajax.php(501): eqLogic->save()\n#9 {main}\n  thrown in /var/www/html/plugins/Metar_infos/3rdparty/Metar.php on line 1080
0625|[Tue Sep 17 21:29:53.198593 2024] [php:error] [pid 2047279:tid 2047279] [client 192.168.1.53:58634] PHP Fatal error:  Uncaught TypeError: Unsupported operand types: string * int in /var/www/html/plugins/Metar_infos/3rdparty/Metar.php:1080\nStack trace:\n#0 /var/www/html/plugins/Metar_infos/3rdparty/Metar.php(520): Metar->get_clouds()\n#1 /var/www/html/plugins/Metar_infos/3rdparty/Metar.php(1511): Metar->parse()\n#2 /var/www/html/plugins/Metar_infos/3rdparty/Metar.php(520): Metar->get_trends()\n#3 /var/www/html/plugins/Metar_infos/core/ressources/MetarData.php(329): Metar->parse()\n#4 /var/www/html/plugins/Metar_infos/core/class/Metar_infos.class.php(317): Taf_GetData()\n#5 /var/www/html/plugins/Metar_infos/core/class/Metar_infos.class.php(433): Metar_infos->getInformations()\n#6 /var/www/html/core/class/DB.class.php(250): Metar_infos->postSave()\n#7 /var/www/html/core/class/eqLogic.class.php(1053): DB::save()\n#8 /var/www/html/core/ajax/eqLogic.ajax.php(501): eqLogic->save()\n#9 {main}\n  thrown in /var/www/html/plugins/Metar_infos/3rdparty/Metar.php on line 1080
0626|[Tue Sep 17 21:29:57.897317 2024] [php:error] [pid 2020193:tid 2020193] [client 192.168.1.53:58638] PHP Fatal error:  Uncaught TypeError: Unsupported operand types: string * int in /var/www/html/plugins/Metar_infos/3rdparty/Metar.php:1080\nStack trace:\n#0 /var/www/html/plugins/Metar_infos/3rdparty/Metar.php(520): Metar->get_clouds()\n#1 /var/www/html/plugins/Metar_infos/3rdparty/Metar.php(1511): Metar->parse()\n#2 /var/www/html/plugins/Metar_infos/3rdparty/Metar.php(520): Metar->get_trends()\n#3 /var/www/html/plugins/Metar_infos/core/ressources/MetarData.php(329): Metar->parse()\n#4 /var/www/html/plugins/Metar_infos/core/class/Metar_infos.class.php(317): Taf_GetData()\n#5 /var/www/html/plugins/Metar_infos/core/class/Metar_infos.class.php(433): Metar_infos->getInformations()\n#6 /var/www/html/core/class/DB.class.php(250): Metar_infos->postSave()\n#7 /var/www/html/core/class/eqLogic.class.php(1053): DB::save()\n#8 /var/www/html/core/ajax/eqLogic.ajax.php(501): eqLogic->save()\n#9 {main}\n  thrown in /var/www/html/plugins/Metar_infos/3rdparty/Metar.php on line 1080
0627|[Tue Sep 17 21:33:59.108313 2024] [php:error] [pid 2019051:tid 2019051] [client 192.168.1.53:58782] PHP Fatal error:  Uncaught TypeError: round(): Argument #1 ($num) must be of type int|float, string given in /var/www/html/core/class/cmd.class.php:1744\nStack trace:\n#0 /var/www/html/core/class/cmd.class.php(1744): round()\n#1 /var/www/html/core/class/eqLogic.class.php(920): cmd->toHtml()\n#2 /var/www/html/core/ajax/object.ajax.php(163): eqLogic->toHtml()\n#3 /var/www/html/core/ajax/object.ajax.php(209): jeeAjax_objectToHtml()\n#4 {main}\n  thrown in /var/www/html/core/class/cmd.class.php on line 1744

Ligne 1080 = $observed[‹ height ›] = $this->convert_distance($found[5] * 100, ‹ FT ›); // convert feet to meters

		// Cloud cover observed
		elseif (isset($found[5]) and !empty($found[5])) {
			$observed['height'] = $this->convert_distance($found[5] * 100, 'FT'); // convert feet to meters

			// Cloud height
			if (is_null($this->result['cloud_height']) or $observed['height'] < $this->result['cloud_height']) {
				$this->set_result_value('cloud_height', $observed['height']);
			}

			if (isset($this->cloud_codes[$found[4]])) {
				$observed['amount'] = $found[4];
			}
		}

Antoine

Bonjour,

Il faut attendre nous sommes en train avec @Phpvarious de réécrire le plugin.

la version n’est pas loin mais il y a encore quelques bugs

3 « J'aime »

Ok, merci de ton retour. Si beaoin de betatester :wink:

Antoine

Bonsoir
Il y a une beta demain qui sort normalement
https://jealg.github.io/documentation/plugin-Metar_infos/fr_FR/changelog_beta

Merci de regarder si le problème est toujours d’actualité

Ne pas oublier de fournir ces informations pour que l’on puisse reproduire le problème,
il faut cliquer sur « Assistance » pour avoir ces données

Et aussi les logs en mode débug

1 « J'aime »

Bonsoir

Beta installée ce soir.
Sur équipement existant, quand je fais sauvegarder dans l’onglet commande:

[MySQL] Error code : 23000 (1062). Duplicate entry '148-TAF valide' for key 'unique' : INSERT INTO `cmd` SET `id` = :id, `logicalId` = :logicalId, `generic_type` = :generic_type, `eqType` = :eqType, `name` = :name, `order` = :order, `type` = :type, `subType` = :subType, `eqLogic_id` = :eqLogic_id, `isHistorized` = :isHistorized, `unite` = :unite, `configuration` = :configuration, `template` = :template, `display` = :display, `value` = :value, `isVisible` = :isVisible, `alert` = :alert

Dans lé log en débug:

[2024-09-20 20:24:46] DEBUG  : ┌───────── Création des commandes METAR si besoin (PostSave)
[2024-09-20 20:24:46] DEBUG  : │ ───▶︎ Création des commandes TAF si besoin (PostSave)
[2024-09-20 20:24:46] DEBUG  : │ Création Commande : TAF valide ── Type / SubType : info/binary ── LogicalID : tafvalide ── Template Widget / Ligne : core::default/1 ── Type de générique :  ── Icône :  ── Min/Max : default/default ── Ordre : 30 ── Unité :  ── Visibilité : default ── Historiser/Afficher les statistiques : /

J’ai recréé le même, il semble fonctionnel. Un moyen de garder l’existant ?

Tcho

Antoine

Tu as deux commandes avec le logicalId valide
Il faut supprimer la commande METAR valide et aussi TAF valide
Il faut les supprimer manuellement

Si non je le ferai lors de la prochaine mise à jour

J’ai eu l erreur hier sur ma beta mais comme je l avais pas mal touché j’ai cru que j’avais des bidouilles.
En regardant le vieux code il y avait deux commandes avec le même logicalId, je vais les supprimer lors de la mise à jour de demain

J’ai effacé toutes les commandes TAF* et METAR*, mais j’ai toujours:

[MySQL] Error code : 23000 (1062). Duplicate entry '148-TAF valide' for key 'unique' : INSERT INTO `cmd` SET `id` = :id, `logicalId` = :logicalId, `generic_type` = :generic_type, `eqType` = :eqType, `name` = :name, `order` = :order, `type` = :type, `subType` = :subType, `eqLogic_id` = :eqLogic_id, `isHistorized` = :isHistorized, `unite` = :unite, `configuration` = :configuration, `template` = :template, `display` = :display, `value` = :value, `isVisible` = :isVisible, `alert` = :alert

Je suis passé dans la partie équipement Observation (METAR) + Prévisions (TAF) à Observation (METAR), sauvegarde, puis retour Observation (METAR) + Prévisions (TAF), de nouveau sauvegarde. Maintenant cela semble ok.

Antoine

Le fait de changer d’observation tu as contourné l’erreur

j’ai reproduit l’erreur, un problème de minuscule et majuscule entre la nouvelle version beta et les anciennes versions du plugin

  • Avant : TAFvalide
  • Maintenant : tafvalide

je viens de pousser la correction, elle sera disponible demain

Pour info l’ensemble du changelog

1 « J'aime »

Ce sujet a été automatiquement fermé après 24 heures suivant le dernier commentaire. Aucune réponse n’est permise dorénavant.