MetersToHA icon indicating copy to clipboard operation
MetersToHA copied to clipboard

Plus de remontée depuis fin septembre

Open hayvan96 opened this issue 1 year ago • 9 comments

Bonjour, après la dernière mise à jour, tout remontait normalement, mais depuis à peu près une semaine, plus rien.

Quand je regarde les logs, j'ai ça :

2025-10-05 08:38:39,157 : OK : Connexion au site Veolia Eau Ile de France 
2025-10-05 08:38:39,222 : OK : Waiting for Password. 
2025-10-05 08:38:39,247 : OK : Waiting for Email 
2025-10-05 08:38:39,420 : OK : Type Email 
2025-10-05 08:38:39,930 : OK : Type Password.Falling back to sending keystrokes. 
2025-10-05 08:38:39,944 : OK : Waiting for submit button. 
2025-10-05 08:38:39,945 : ~~ : Wait before clicking (1.0s). 
2025-10-05 08:38:41,047 : OK : Click on submit button. 
2025-10-05 08:38:41,558 : OK : Remove temporary download file '/config/historique_jours_litres.csv'. 
2025-10-05 08:38:41,586 : WW :  Traceback (most recent call last): -   File "MetersToHA/apps/meters_to_ha/meters_to_ha.py", line 4192, in doWork -     veolia_file = crawler.get_veolia_idf_file() -                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -   File "MetersToHA/apps/meters_to_ha/meters_to_ha.py", line 1671, in get_veolia_idf_file -     self.__wait.until( -   File "/usr/lib/python3.12/site-packages/selenium/webdriver/support/wait.py", line 129, in until -     value = method(self._driver) -             ^^^^^^^^^^^^^^^^^^^^ -   File "/usr/lib/python3.12/site-packages/selenium/webdriver/support/expected_conditions.py", line 217, in _predicate -     return _element_if_visible(driver.find_element(*locator)) -                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -   File "/usr/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 926, in find_element -     return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"] -            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -   File "/usr/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 458, in execute -     self.error_handler.check_response(response) -   File "/usr/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py", line 232, in check_response -     raise exception_class(message, screen, stacktrace) - selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Unable to locate an element with the xpath expression //span[contains(text(), 'Alertes de consommation') or contains(text(), 'Contrats') or contains(text(), 'consulter l\'historique') or contains(translate(text(), "CLH", "clh"), "consulter l\'historique")] because of the following error: - SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//span[contains(text(), 'Alertes de consommation') or contains(text(), 'Contrats') or contains(text(), 'consulter l\'historique') or contains(translate(text(), "CLH", "clh"), "consulter l\'historique")]' is not a valid XPath expression. -   (Session info: chrome=140.0.7339.185); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#invalidselectorexception -
2025-10-05 08:38:41,586 : WW :  Encountered error -> Retrying once
2025-10-05 08:38:42,922 : OK : Connexion au site Veolia Eau Ile de France 
2025-10-05 08:39:13,007 : EE :  Message: Failed, page timeout (timeout=30)
2025-10-05 08:39:13,084 : OK : Close Browser 
2025-10-05 08:39:13,087 : OK : Close Display 
2025-10-05 08:39:13,088 : EE :  Ended with error : // re-run with '--display' option if you can

hayvan96 avatar Oct 05 '25 06:10 hayvan96

A regarder le log, je me demande si c'est ce commit qui pose problème https://github.com/mdeweerd/meterstoha/commit/367c6b987e11cb26f236de917412a0b47b128bbe @mdeweerd j'ai tenté d'utiliser git_version en entrant soit un tag, soit un hash d'un commit, pour utiliser l'addon sans ce dernier commit, mais ça ne marche manifestement que pour des branches. Et comme l'addon recharge la dernière version git au redémarrage, difficile de forcer sur une version donnée.

hayvan96 avatar Oct 12 '25 09:10 hayvan96

Je peux tout à fait mettre la version git dans la config et la vérifier dans la trace du module:

git checkout 367c6b9
Note: switching to '367c6b9'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

Ce qui compte principalement, c'est le code - l'addon (système sous docker) peut ne pas être cette version là ce qui n'est généralement pas grave.

Il y a des indices à travers les captures d'écran?

Image

Perso j'ai eu des données sans interruption depui le 8 septembre.

mdeweerd avatar Oct 12 '25 19:10 mdeweerd

voici ce que j'ai : m2h_exec.log

Done Sun Oct 12 21:40:44 CEST 2025
Sun Oct 12 21:48:53 CEST 2025
python3  MetersToHA/apps/meters_to_ha/meters_to_ha.py  -l /config --screenshot --keep-output -c "/m2h_config.json" --veolia -r
X connection to :0 broken (explicit kill or server shutdown).
Traceback (most recent call last):
  File "//MetersToHA/apps/meters_to_ha/meters_to_ha.py", line 4192, in doWork
    veolia_file = crawler.get_veolia_idf_file()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "//MetersToHA/apps/meters_to_ha/meters_to_ha.py", line 1671, in get_veolia_idf_file
    self.__wait.until(
  File "/usr/lib/python3.12/site-packages/selenium/webdriver/support/wait.py", line 129, in until
    value = method(self._driver)
            ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/selenium/webdriver/support/expected_conditions.py", line 217, in _predicate
    return _element_if_visible(driver.find_element(*locator))
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 926, in find_element
    return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 458, in execute
    self.error_handler.check_response(response)
  File "/usr/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py", line 232, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Unable to locate an element with the xpath expression //span[contains(text(), 'Alertes de consommation') or contains(text(), 'Contrats') or contains(text(), 'consulter l\'historique') or contains(translate(text(), "CLH", "clh"), "consulter l\'historique")] because of the following error:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//span[contains(text(), 'Alertes de consommation') or contains(text(), 'Contrats') or contains(text(), 'consulter l\'historique') or contains(translate(text(), "CLH", "clh"), "consulter l\'historique")]' is not a valid XPath expression.
  (Session info: chrome=140.0.7339.185); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#invalidselectorexception


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "//MetersToHA/apps/meters_to_ha/meters_to_ha.py", line 4216, in doWork
    veolia_file = crawler.get_veolia_idf_file()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "//MetersToHA/apps/meters_to_ha/meters_to_ha.py", line 1559, in get_veolia_idf_file
    self.__wait.until(
  File "/usr/lib/python3.12/site-packages/selenium/webdriver/support/wait.py", line 138, in until
    raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: Failed, page timeout (timeout=30)


Done Sun Oct 12 21:49:30 CEST 2025

screenonexception1.png:

Image

screenonexception2.png

Image

hayvan96 avatar Oct 12 '25 19:10 hayvan96

Je suis tout de même intrigué par l'erreur qui indique une expression Xpath incorrecte, je suis le seul à aboutir à cette erreur ?

et je n'arrive pas vraiment à retourner sur une version antérieure, quand je vise un git version, il ne semble rechercher que des branches existantes, donc je n'arrive pas à avoir la version juste avant le commit introduisant le Xpath indiqué dans mon log :(

hayvan96 avatar Oct 17 '25 05:10 hayvan96

La page de login semble curieuse

screen_on_exception2.png.html

Quels logs ou details puis-je fournir pour avancer sur l'investigation ?

hayvan96 avatar Oct 18 '25 19:10 hayvan96

J'ai la même erreur exactement dans le m2h_exec.log depuis début octobre au moins. La dernière remontée de données correcte est du 28 septembre.

alexh3o avatar Oct 30 '25 08:10 alexh3o

J'ai la même erreur exactement dans le m2h_exec.log depuis début octobre au moins. La dernière remontée de données correcte est du 28 septembre.

Je viens de vérifier, pour ma part c'est le 27 septembre

hayvan96 avatar Oct 30 '25 09:10 hayvan96

Bonjour, Update à HA 2025.11, mais toujours la même erreur ; @alexh3o ton compte est celui d'un particulier ou bailleur/syndic ?

2025-11-15 02:20:30,827 : OK : Remove temporary download file '/config/historique_jours_litres.csv'. 
2025-11-15 02:20:30,864 : WW :  Traceback (most recent call last): -   File "//MetersToHA/apps/meters_to_ha/meters_to_ha.py", line 4192, in doWork -     veolia_file = crawler.get_veolia_idf_file() -                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -   File "//MetersToHA/apps/meters_to_ha/meters_to_ha.py", line 1671, in get_veolia_idf_file -     self.__wait.until( -   File "/usr/lib/python3.12/site-packages/selenium/webdriver/support/wait.py", line 129, in until -     value = method(self._driver) -             ^^^^^^^^^^^^^^^^^^^^ -   File "/usr/lib/python3.12/site-packages/selenium/webdriver/support/expected_conditions.py", line 217, in _predicate -     return _element_if_visible(driver.find_element(*locator)) -                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -   File "/usr/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 926, in find_element -     return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"] -            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -   File "/usr/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 458, in execute -     self.error_handler.check_response(response) -   File "/usr/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py", line 232, in check_response -     raise exception_class(message, screen, stacktrace) - selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Unable to locate an element with the xpath expression //span[contains(text(), 'Alertes de consommation') or contains(text(), 'Contrats') or contains(text(), 'consulter l\'historique') or contains(translate(text(), "CLH", "clh"), "consulter l\'historique")] because of the following error: - SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//span[contains(text(), 'Alertes de consommation') or contains(text(), 'Contrats') or contains(text(), 'consulter l\'historique') or contains(translate(text(), "CLH", "clh"), "consulter l\'historique")]' is not a valid XPath expression. -   (Session info: chrome=140.0.7339.185); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#invalidselectorexception -
2025-11-15 02:20:30,864 : WW :  Encountered error -> Retrying once

hayvan96 avatar Nov 15 '25 21:11 hayvan96

Hello, c'est un compte particulier

alexh3o avatar Nov 16 '25 14:11 alexh3o

Bonsoir, pour ma part, syndic (volontaire), donc pas lié au type de compte. @mdeweerd , quels logs ou tests peut-on fournir ou faire pour aider à la résolution ? merci

hayvan96 avatar Dec 04 '25 20:12 hayvan96