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

Synology Integration does not work reliable for DS413J, is often unavailable #119099

Closed
BoneheadFraggle opened this issue Jun 7, 2024 · 12 comments · Fixed by #119169
Closed

Synology Integration does not work reliable for DS413J, is often unavailable #119099

BoneheadFraggle opened this issue Jun 7, 2024 · 12 comments · Fixed by #119169

Comments

@BoneheadFraggle
Copy link

BoneheadFraggle commented Jun 7, 2024

The problem

Since HA 2024.6, one of my Synology NAS is often unavailable.
It has worked fine for years up until now, and nothing is changed on the NAS.

I have two NAS, one still works great with HA (NAS02 / DS213j) while the other one (NAS01 / DS413j) keeps showing all entities as unavailable for a period of time, then they work for a while and then it starts over.

One thing that differs between the two is the DSM version.

NAS01 (problem)
DS413j
DSM 6.2.4-25556 Update 7 (no updates available)

NAS02 (ok)
DS213j
DSM 7.1.1-42962 Update 6 (no updates available)

The "connectivity" looks like this since HA 2024.6:

image

It looks a bit like #115062, but that one seems to be solved.

What version of Home Assistant Core has the issue?

core-2024.6.0

What was the last working version of Home Assistant Core?

core-2024.5.x

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Synology DSM

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

This line is appearing often:

`2024-06-07 09:12:39.103 ERROR (MainThread) [homeassistant.components.synology_dsm.coordinator] Error fetching nas01 SynologyDSMCentralUpdateCoordinator data: Error communicating with API: {'api': None, 'code': -1, 'reason': 'Unknown', 'details': 'TimeoutError'}`

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Jun 7, 2024

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

Code owner commands

Code owners of synology_dsm 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 synology_dsm Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


synology_dsm documentation
synology_dsm source
(message by IssueLinks)

@bdraco
Copy link
Member

bdraco commented Jun 7, 2024

I believe thats one of the ones with the old slower Marvell chips. Maybe 30s is even too low for it when its under load. Synology's API internals are very poorly optimized. We ended up bumping up the timeout a bit ago, but maybe its not enough. Maybe we need to go to 40s

@bdraco
Copy link
Member

bdraco commented Jun 7, 2024

What does the startup time look like ?

System -> Settings -> Repairs -> 3 dots in the upper right -> Integration startup time

@BoneheadFraggle
Copy link
Author

BoneheadFraggle commented Jun 7, 2024

image

The general load on NAS01 is ~5% CPU except during backups where it peaks at 100%, illustrated with fill(previous) below

image

@bdraco
Copy link
Member

bdraco commented Jun 7, 2024

We increased it to 30 in #116836

I'm hesitant to increase it more without splitting the timeout in the library so we have a lower connect timeout and a higher read timeout as we might get into a predicament where we block startup for too long if we increase it anymore

@bdraco
Copy link
Member

bdraco commented Jun 7, 2024

I think we could set the connect timeout to 15 and the read/write timeout to 40s and be ok

https://github.com/mib1185/py-synologydsm-api/blob/b6166f77504f9d705b6b77cd458e39e21e44d892/src/synology_dsm/synology_dsm.py#L70

But we would need a change in the library to be able to pass both

@bdraco
Copy link
Member

bdraco commented Jun 7, 2024

@bdraco
Copy link
Member

bdraco commented Jun 7, 2024

aiohttp.ClientTimeout(total=40, connect=15) would probably fix this.

Since the lib already knows about aiohttp sessions, I think it would be ok to accept a ClientTimeout object as the timeout or a float/int

@bdraco
Copy link
Member

bdraco commented Jun 7, 2024

I'm not the codeowner here so above it just my suggestion. Let's wait for one of the codeowners to respond before proceeding

@mib1185
Copy link
Contributor

mib1185 commented Jun 7, 2024

Hi @bdraco
Your suggestion sounds reasonable and I'm happy to implement it - since I'm on a business trip next week, I can care about it earliest the week after.

@mib1185
Copy link
Contributor

mib1185 commented Jun 8, 2024

i found some spare time in between preparing for the business trip 🙈

@BoneheadFraggle
Copy link
Author

Feedback: Seems to work 100% now (HA 2024.6.2).

Thank you very much!

@github-actions github-actions bot locked and limited conversation to collaborators Jul 11, 2024
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.

4 participants