Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Météo France integration fails #94839

Closed
Kolia56 opened this issue Jun 19, 2023 · 49 comments · Fixed by #94911
Closed

Météo France integration fails #94839

Kolia56 opened this issue Jun 19, 2023 · 49 comments · Fixed by #94911

Comments

@Kolia56
Copy link

Kolia56 commented Jun 19, 2023

The problem

Météo France integration have been failing to initialize for at least one day. It has been working before that. No change in HA version

What version of Home Assistant Core has the issue?

2023.3.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Météo France

Link to integration documentation on our website

https://www.home-assistant.io/integrations/meteo_france

Diagnostics information

I have been restarting HA. Here are various log events after startup

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.config_entries
Source: config_entries.py:1244 
First occurred: 07:24:59 (1 occurrences) 
Last logged: 07:24:59

Config entry 'Saint-Pierre-de-Jards - Centre (36) - FR' for meteo_france integration not ready yet: None; Retrying in background

Logger: homeassistant.components.meteo_france
Source: helpers/update_coordinator.py:215 
Integration: Météo-France (documentation, issues) 
First occurred: 07:21:11 (15 occurrences) 
Last logged: 07:37:52

Error requesting Météo-France alert for department 36 data: 502 Server Error: Bad Gateway for url: https://webservice.meteofrance.com/warning/currentphenomenons?token=__Wj7dVSTjV9YGu1guveLyDq0g7S7TfTjaHBTPTpO0kj8__&domain=36&depth=0

Additional information

No response

@home-assistant
Copy link

Hey there @hacf-fr, @oncleben31, @Quentame, mind taking a look at this issue as it has been labeled with an integration (meteo_france) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of meteo_france can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign meteo_france Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


meteo_france documentation
meteo_france source
(message by IssueLinks)

@gbrissard
Copy link

Hi,

Same issue on my HA installation. Note that at the time this integration started failing, Meteo France's website suffered a downtime but has since resumed normal operations.

@Kolia56
Copy link
Author

Kolia56 commented Jun 19, 2023

At the time of writing, still failing
image

@ThomPri78
Copy link

Same issue for me
Screenshot_2023-06-19-09-38-22-35_c3a231c25ed346e59462e84656a70e50

@Nsbx
Copy link

Nsbx commented Jun 19, 2023

The problem come from Meteo France, the call for Forecast works but the call to get current phenomenons return a 502 from the server.

We should wait ...

I could check later to edit the source code of the integration to avoid block everything if only one endpoint doesn't work

@bamnoru
Copy link

bamnoru commented Jun 19, 2023

Maybe an issu of the API :
hacf-fr/meteofrance-api#629

@Kolia56
Copy link
Author

Kolia56 commented Jun 19, 2023

I could check later to edit the source code of the integration to avoid block everything if only one endpoint doesn't work

Yeap that would be nice

@macfr76
Copy link

macfr76 commented Jun 19, 2023

Same issue here too, it appeared after upgrading to HA OS 10.3, it was working fine before.

Here are my version, running on RPI4 :
Home Assistant 2023.6.2
Supervisor 2023.06.2
Operating System 10.3
Interface utilisateur : 20230608.0 - latest

Edit : in fact, it was happening beforat some time, but not all time. Cf this image which shows the lack of information but not all time :
image

Meteo France is purple line.

@macfr76
Copy link

macfr76 commented Jun 19, 2023

The problem come from Meteo France, the call for Forecast works but the call to get current phenomenons return a 502 from the server.

We should wait ...

I could check later to edit the source code of the integration to avoid block everything if only one endpoint doesn't work

The issue is that when you restart HA, the integration does not start anymore.

@clementduveau
Copy link

clementduveau commented Jun 19, 2023

Issue is not linked to Home Assistant version. Not starting is normal: requests to the API fail in some cases.

I got this very interesting log line:

Error requesting Météo-France forecast for city Montpellier - Languedoc-Roussillon (34) - FR data: 404 Client Error: Not Found for url: https://webservice.meteofrance.com/forecast?token=__Wj7dVSTjV9YGu1guveLyDq0g7S7TfTjaHBTPTpO0kj8__&lat=43.6113&lon=3.8771&lang=fr
Error requesting Météo-France alert for department 34 data: 502 Server Error: Bad Gateway for url: https://webservice.meteofrance.com/warning/currentphenomenons?token=__Wj7dVSTjV9YGu1guveLyDq0g7S7TfTjaHBTPTpO0kj8__&domain=34&depth=0
Error requesting Météo-France alert for department 78 data: 502 Server Error: Bad Gateway for url: https://webservice.meteofrance.com/warning/currentphenomenons?token=__Wj7dVSTjV9YGu1guveLyDq0g7S7TfTjaHBTPTpO0kj8__&domain=78&depth=0

The 2 last 502 seems to indicate that this endpoint is deprecated. But the 404 actually works perfectly in browser.

See the issue opened in the python client: hacf-fr/meteofrance-api#629

@pingoo78
Copy link

Meteo France has informed on Twitter about an issue with their website and webservice since yesterday :
https://twitter.com/meteofrance/status/1670499993667395586

They said that the issue is solved since this morning but in fact, it's not true.
We can see on twitter many issue on their mobile application not working always.

I think, this is why we have issue with API.
Just need to wait.

@romain1206
Copy link

same problem for me
it's not working this day
i try restart home assistant

@Voileux78
Copy link

Thé same for me. Let s wait for météo France !

@Quentame
Copy link
Member

Météo-France seems to have modify/shut down the weather warning API from 18-06-2023 18:40:00+02:00 (Europe/Paris)

Error requesting Météo-France alert for department 69 data: 502 Server Error: Bad Gateway for url: https://webservice.meteofrance.com/warning/currentphenomenons?token=REDACTED&domain=69&depth=0

Will catch that for the next fix to prevent all the integration from failing.

If you don't reboot all other entities are working except the warning one.
If you reboot/has rebooted, it's too late, not integration for now.

@Quentame Quentame added this to the 2023.6.3 milestone Jun 19, 2023
@vingerha
Copy link
Contributor

vingerha commented Jun 20, 2023

Interesting info:

  • the error displayed in HA log shows below url and this one still works...., I changed the token because not sure if this is private.
    works: it gets the full json
https://webservice.meteofrance.com/forecast?token=__xxxxxxxxxyDq0g7S7TfTjaHBTPTpO0kj8__&lat=43.62&lon=6.97194&lang=fr

@Quentame
Copy link
Member

Nice finding @vingerha, thanks !

Did you get the API token this way ?

Hey, did some investigation following this article. Indeed it seems the API changed. I was able to retrieve the information. I had to:

From #92197 (comment)

Or else how ?

@Quentame
Copy link
Member

Source error:

Error setting up entry Lyon - Rhône-Alpes (69) - FR for meteo_france
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/meteo_france/__init__.py", line 94, in async_setup_entry
    await coordinator_forecast.async_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 262, in async_refresh
    await self._async_refresh(log_failures=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 242, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/meteo_france/__init__.py", line 69, in _async_update_data_forecast_forecast
    return await hass.async_add_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError

@ejalal
Copy link

ejalal commented Jun 20, 2023

There was an outage for the whole meteo france website a couple of days ago, so maybe they changed the limitations of the API

@pingoo78
Copy link

Nice finding @vingerha, thanks !

Did you get the API token this way ?

Hey, did some investigation following this article. Indeed it seems the API changed. I was able to retrieve the information. I had to:

From #92197 (comment)

Or else how ?

I have the same token, so I think the token is the same for all and generated for HA globally.

@Quentame
Copy link
Member

Quentame commented Jun 20, 2023

Everyone using the Météo-France API (including HA) is using the same HARDCODED token that was originally retrieve from the official Météo-France mobile app.

@Quentame
Copy link
Member

Fix provided in this PR #94911 🥳

Alert sensor will not be created if an error occurs at integration initialisation, further investigation is needed to make it work properly.
At least the weather and other sensors are working nicely.

@vingerha
Copy link
Contributor

vingerha commented Jun 20, 2023

Or else how ?

I found it directly vsible in the logs (not even in debug log)
and thanks for the other input.
Now that I have seen that the json has both daily as well as hourly data, I will re-raise my request to create two sensors for one city :) ... will see if I can provide a prototype when time permits.

@mbo18
Copy link
Contributor

mbo18 commented Jun 20, 2023

Now that I have seen that the json has both daily as well as hourly data, I will re-raise my request to create two sensors for one city :) ... will see if I can provide a prototype when time permits.

There was this PR: #44422
Unfortunately it has been forgotten and is now closed

@yukadmz
Copy link

yukadmz commented Jun 20, 2023

Hello,

I have the same problem here !
Capture d’écran 2023-06-20 à 16 55 01

@marcbernis
Copy link

Hello,
and Thanks for your support.
My first time on applying a PR,
How do I appy Fix provided in this PR 94911?

@SNoof85
Copy link
Contributor

SNoof85 commented Jun 20, 2023

Hello, and Thanks for your support. My first time on applying a PR, How do I appy Fix provided in this PR 94911?

Just wait for next release of HA where the PR is included.

@newbeetle59
Copy link

Hello,
and Thanks for your support.
My first time on applying a PR,
How do I appy Fix provided in this PR 94911?

Browse to the /homeassistant/components/meteo_france folder on your system, find the file init.py (make a backup, just in case), replace with init.py file provided by Quentame in #94911, finally restart HomeAssistant. That’s it !

@vingerha
Copy link
Contributor

vingerha commented Jun 21, 2023

@Quentame I am not sure if I was supposed to be able to but I 'approved' the PR, seems a bit odd that I can do this...let's see. In any case, code change looks simple and along what I would expect ...and it works :)

@ablyes
Copy link

ablyes commented Jun 21, 2023

I looked for a while in ssh this folder meteo_france or components.
I can't find it.
I have home assistant installed in VM on synology nas.
May be this makes my folder organization different ?
Somebody to help me please ?

@mbo18
Copy link
Contributor

mbo18 commented Jun 21, 2023

Just wait for 2023.6.3 or you may break your HA

@ablyes
Copy link

ablyes commented Jun 21, 2023

I'm a big guy :)
I would patch if the release is not planned for today.

@Quentame
Copy link
Member

@Quentame I am not sure if I was supposed to be able to but I 'approved' the PR, seems a bit odd that I can do this...let's see. In any case, code change looks simple and along what I would expect ...and it works :)

Of course you can, anyone can (and should 😉) review PRs and comments/request changes/approve, but always with kindness 😌

I haven't seen when it changes but now PRs need an HA member approval, but still, your review is usefull, and maybe one day you will be promoted to an HA member !


Just wait for 2023.6.3 or you may break your HA

I will patch if the release is not planned for today.

Indeed, nowadays patch releases seems to be bigger but less often.

@vingerha
Copy link
Contributor

Nah, am not a dev nor willing to become one on this level. Just trying to see where I can help and possibly increase functional value for the end-user

@sebaurel
Copy link

sebaurel commented Jun 21, 2023

Hello,
and Thanks for your support.
My first time on applying a PR,
How do I appy Fix provided in this PR 94911?

Browse to the /homeassistant/components/meteo_france folder on your system, find the file init.py (make a backup, just in case), replace with init.py file provided by Quentame in #94911, finally restart HomeAssistant. That’s it !

Hello,
Sorry, but i can't found the folder to :

➜  / find / -name "*component*"
find: /proc/361/task/361/fdinfo: Permission denied
find: /proc/361/fdinfo: Permission denied
/share/apcupsd-3.14.14/platforms/darwin/component.plist
/config/custom_components
➜  / find / -name "*meteo*"
/root/.oh-my-zsh/plugins/meteor
/root/.oh-my-zsh/plugins/meteor/meteor.plugin.zsh
/root/.oh-my-zsh/plugins/meteor/_meteor
find: /proc/361/task/361/fdinfo: Permission denied
find: /proc/361/fdinfo: Permission denied

I use a Raspberry

@newbeetle59
Copy link

Hello,
and Thanks for your support.
My first time on applying a PR,
How do I appy Fix provided in this PR 94911?

Browse to the /homeassistant/components/meteo_france folder on your system, find the file init.py (make a backup, just in case), replace with init.py file provided by Quentame in #94911, finally restart HomeAssistant. That’s it !

Hello, Sorry, but i can't found the folder to :

➜  / find / -name "*component*"
find: /proc/361/task/361/fdinfo: Permission denied
find: /proc/361/fdinfo: Permission denied
/share/apcupsd-3.14.14/platforms/darwin/component.plist
/config/custom_components
➜  / find / -name "*meteo*"
/root/.oh-my-zsh/plugins/meteor
/root/.oh-my-zsh/plugins/meteor/meteor.plugin.zsh
/root/.oh-my-zsh/plugins/meteor/_meteor
find: /proc/361/task/361/fdinfo: Permission denied
find: /proc/361/fdinfo: Permission denied

I use a Raspberry

Hi, sorry but I used the path that you can see in Quentame #94911 and it worked for me. That said it is quite strange that you cannot find HomeAssistant folders structure … Are you sure to search directly from the host (not using the terminal inside HomeAssistant) ?

@elmr91

This comment was marked as spam.

@elmr91
Copy link

elmr91 commented Jun 21, 2023

@Quentame, reviewer has requested a cosmetic change "Please don't use multi-line ternary" on #94911

PR is on hold:
auto-merge was automatically disabled
Pull request was converted to draft

@Quentame
Copy link
Member

Quentame commented Jun 21, 2023

@Quentame, reviewer has requested a cosmetic change "Please don't use multi-line ternary" on #94911

I saw thanks, please don't spam.

Plus, other PR are marked for the next fix and needs reviews

@sebaurel
Copy link

sebaurel commented Jun 21, 2023

@newbeetle59 Hi, sorry but I used the path that you can see in Quentame #94911 and it worked for me. That said it is quite strange that you cannot find HomeAssistant folders structure … Are you sure to search directly from the host (not using the terminal inside HomeAssistant) ?

I use putty, login in root ! so strange !
image

@newbeetle59
Copy link

@newbeetle59 Hi, sorry but I used the path that you can see in Quentame #94911 and it worked for me. That said it is quite strange that you cannot find HomeAssistant folders structure … Are you sure to search directly from the host (not using the terminal inside HomeAssistant) ?

I use putty, login in root ! so strange ! image

I see, you are using command line inside home assistant, I suppose this why you cannot see the folders, using embedded home assistant command line will not allow you to see the folders and sub folders even with root privileges. It depends on how you installed home assistant but without full control of the host machine, you might have to wait for PR approval and new HA update as some other users have already mentioned in previous posts.

@ablyes
Copy link

ablyes commented Jun 21, 2023

How can we patch in our case ?
For instance, when you install from on a virtual machine that runs on Synology NAS.
I don't know the others samples, but i think the solution will be the same.

@X-dark
Copy link

X-dark commented Jun 21, 2023

Please move your discussion elsewhere, this has nothing to do with the issue

@Enoril
Copy link

Enoril commented Jun 22, 2023

The integration restarted working suddenly on my side (without any update). Seems it was a meteo france server issue ? (so long to fix ! oo)

Only Weather alert sensor is missing currently.

@Kolia56
Copy link
Author

Kolia56 commented Jun 22, 2023

Yes it is back on my side as well, weather alert sensor state is currently unknown

@marcbernis
Copy link

marcbernis commented Jun 22, 2023 via email

@newbeetle59
Copy link

Yes indeed it works because the url (phenomenon) is back alive although it doesn’t show anything interesting in strings… But the changes are still needed in order to avoid the issue to be back if something goes wrong again with Meteo France’s api.

@vingerha
Copy link
Contributor

vingerha commented Jun 22, 2023

@Quentame not sure how else to reach you so misusing this for one question (do point me elsewhere to discuss). Since the json provides both daily and hourly information, why not create both weather sensors at the same time.... I am sure that you know this is highly saught after. I would not mind spending a bit of time on the dev side but if it gets rejects already at this stage of an 'idea' then I'd rather not spend the effort :)

@tof92130
Copy link

The integration is working again.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.