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

Freebox Revolution has no RAID #97652

Closed
Gonioul opened this issue Aug 2, 2023 · 20 comments · Fixed by #97696
Closed

Freebox Revolution has no RAID #97652

Gonioul opened this issue Aug 2, 2023 · 20 comments · Fixed by #97696
Assignees

Comments

@Gonioul
Copy link

Gonioul commented Aug 2, 2023

The problem

Freebox integration doesn't work anymore for my Freebox Revolution in 2023.08, looks for a RAID that doesn't exists.

What version of Home Assistant Core has the issue?

core-2023.8.0

What was the last working version of Home Assistant Core?

core-2023.7.3

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

Freebox

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 388, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/freebox/__init__.py", line 60, in async_setup_entry
    await router.update_all()
  File "/usr/src/homeassistant/homeassistant/components/freebox/router.py", line 86, in update_all
    await self.update_sensors()
  File "/usr/src/homeassistant/homeassistant/components/freebox/router.py", line 149, in update_sensors
    await self._update_raids_sensors()
  File "/usr/src/homeassistant/homeassistant/components/freebox/router.py", line 164, in _update_raids_sensors
    fbx_raids: list[dict[str, Any]] = await self._api.storage.get_raids() or []
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/freebox_api/api/storage.py", line 85, in get_raids
    return await self._access.get("storage/raid/")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/freebox_api/access.py", line 122, in get
    return await self._perform_request(self.session.get, end_url)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/freebox_api/access.py", line 114, in _perform_request
    raise HttpRequestError(err_msg)
freebox_api.exceptions.HttpRequestError: Request failed (APIResponse: {"msg": "Erreur interne", "success": false, "error_code": "internal_error"}

Additional information

No response

@Gonioul
Copy link
Author

Gonioul commented Aug 2, 2023

Looks like this is the problem: #95242

@Skuair
Copy link

Skuair commented Aug 3, 2023

Same problem for me after updated to 2023.8.0 yesterday (same log).

@Gonioul you have to tag this issue with the label "integration: freebox" in order to alert integration owner automatically.

@home-assistant
Copy link

home-assistant bot commented Aug 3, 2023

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

Code owner commands

Code owners of freebox 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 freebox Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


freebox documentation
freebox source
(message by IssueLinks)

@Pierrodu21
Copy link

Same issue here after updating to 2023.8.0!

Can we give you more details to help with this issue?

Configuration failure
Log
Unavailable

@Pendragon
Copy link

That's a painful issue.
All services linked to the box are dead. Presence especially.

I would like to suggest a quickfix

In the file "/usr/src/homeassistant/homeassistant/components/freebox/router.py", line 164, in _update_raids_sensors
fbx_raids: list[dict[str, Any]] = await self._api.storage.get_raids() or []

Changed the code in
fbx_raids: list[dict[str, Any]] = []

I don't find /usr/src with ssh addon or vscode. Most probably due to docker containment.
I consider rolling back to 2023.7.3

@Write
Copy link

Write commented Aug 3, 2023

That's a painful issue. All services linked to the box are dead. Presence especially.

I would like to suggest a quickfix

In the file "/usr/src/homeassistant/homeassistant/components/freebox/router.py", line 164, in _update_raids_sensors fbx_raids: list[dict[str, Any]] = await self._api.storage.get_raids() or []

Changed the code in fbx_raids: list[dict[str, Any]] = []

I don't find /usr/src with ssh addon or vscode. Most probably due to docker containment. I consider rolling back to 2023.7.3

I tried your fix but it still throw an error, if you want to try :

Based on your answer to apply quickly the fix :

# enter the container
docker exec -it homeassistant /bin/bash 

# preview the change
sed 's|fbx_raids: list\[dict\[str, Any\]\] = await self._api.storage.get_raids() or \[\]|fbx_raids: list[dict[str, Any]] = []|g' /usr/src/homeassistant/homeassistant/components/freebox/router.py | diff /usr/src/homeassistant/homeassistant/components/freebox/router.py -

# apply the change
sed -i 's|fbx_raids: list\[dict\[str, Any\]\] = await self._api.storage.get_raids() or \[\]|fbx_raids: list[dict[str, Any]] = []|g' /usr/src/homeassistant/homeassistant/components/freebox/router.py

# reload freebox integration

@cyr-ius
Copy link
Contributor

cyr-ius commented Aug 3, 2023

I just submitted a fix via a PR
hoping that it will be taken quickly in the next version.

Raid APIs are marked as UNSTABLE at Free so not sure it works everywhere. In any case it does not work on my freebox POP

image

@cyr-ius
Copy link
Contributor

cyr-ius commented Aug 3, 2023

For those who want to take advantage of the 2023.8.0 version, just copy the freebox component folder as custom_component with the issue code fixed

https://github.com/cyr-ius/home-assistant/tree/Freebox---Enum-raid-disks/homeassistant/components/freebox

Because it is the holidays. The correction may not be merged immediately

@Pierrodu21
Copy link

Thanks @cyr-ius !

@Pendragon
Copy link

Pendragon commented Aug 3, 2023

Thanks @Write was able to fix it the dirty way on my installation thanks to your comment
image

Thanks @cyr-ius for the real correction

@Skuair
Copy link

Skuair commented Aug 3, 2023

Thanks @Write was able to fix it the dirty way on my installation thanks to your comment image

Thanks @cyr-ius for the real correction

How do you proceed to edit the source file in a Hassio installation? I suppose we cannot access the containers ?

Otherwise, method from @cyr-ius, by adding the integration as custom_component will overload the official one ? Or do I have somethyelse to do in HA ?

@Write
Copy link

Write commented Aug 3, 2023

Thanks @Write was able to fix it the dirty way on my installation thanks to your comment image
Thanks @cyr-ius for the real correction

How do you proceed to edit the source file in a Hassio installation? I suppose we cannot access the containers ?

Otherwise, method from @cyr-ius, by adding the integration as custom_component will overload the official one ? Or do I have somethyelse to do in HA ?

Yes, It'll overwrite the official one yes, nothing else to do appart from reloading the integration

Maybe it would be more easy for you to simply downgrade HA to 2023.7.3

EDIT : I was apparently wrong, look @Skuair post

@cyclope205
Copy link

hi, i uploaded the freebox folder on the patch, i added it to custom_components. I reloaded the integration, restarted home assistant, but the problem persists. I must have missed something.

@Skuair
Copy link

Skuair commented Aug 3, 2023

hi, i uploaded the freebox folder on the patch, i added it to custom_components. I reloaded the integration, restarted home assistant, but the problem persists. I must have missed something.

In fact, same for me, the integration loaded is the official one not the one in custom_components.

@Skuair
Copy link

Skuair commented Aug 3, 2023

OK, i found : according to the doc, you need to add a "version" property in the manifest.json of the custom_component (https://developers.home-assistant.io/docs/creating_integration_manifest/#version).

Example of mine:
image

Then, restart HA and it will work:
image

@cyclope205
Copy link

OK, j'ai trouvé : selon la doc, il faut ajouter une propriété "version" dans le manifest.json du custom_component ( https://developers.home-assistant.io/docs/creating_integration_manifest/#version ).

Exemple du mien : image

Ensuite, redémarrez HA et cela fonctionnera : image

did not work for me

@Skuair
Copy link

Skuair commented Aug 4, 2023

Create a folder "freebox" in /config/custom_components like the screenshot and add all files of https://github.com/cyr-ius/home-assistant/tree/Freebox---Enum-raid-disks/homeassistant/components/freebox inside.
Then, edit the manifest.json to add a version property like mine.
And finally, restart HA.
It worked for me.

@NeWoKiKi
Copy link

NeWoKiKi commented Aug 4, 2023

Hi,

I tried to add files and modify manifest.json adding version but after restarting HA it's still the official integration and not the custom one.
Did you change something else ?

Many thanks,

@cyclope205
Copy link

cyclope205 commented Aug 4, 2023

Create a folder "freebox" in /config/custom_components like the screenshot and add all files of https://github.com/cyr-ius/home-assistant/tree/Freebox---Enum-raid-disks/homeassistant/components/freebox inside. Then, edit the manifest.json to add a version property like mine. And finally, restart HA. It worked for me.

I followed your instructions but it still doesn't work. should we remove the official integration?

@cyr-ius
Copy link
Contributor

cyr-ius commented Aug 4, 2023

This Fix #97696 has been merged in 2023.8.1

@github-actions github-actions bot locked and limited conversation to collaborators Sep 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants