Synology: constant reconfiguration required

Hi everybody,

I haven’t had any issues with Synology DSM prior to this; I switched to this third-party addon for some time, but because it was unusably unreliable, I switched back to the native integration.

Now, each time a synology gets shut down, then boots back up, I get this

I have two DSs, one for backups only (WOL every day, backup, power off via HA integration button press) and one for daily use (WOL in the morning, regular use, power off in the evening via HA button press).

So both these devices require reconfiguration each and every day. I do use 2FA, but I did so previously as well (no change in user account and/or authentication), so I don’t see why this should suddenly happen.

The relevant logs for one of the DSs

Logger: homeassistant
Quelle: components/synology_dsm/common.py:103
Erstmals aufgetreten: 06:39:37 (1 Vorkommnisse)
Zuletzt protokolliert: 06:39:37

Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/synology_dsm/coordinator.py", line 46, in _async_wrap
    return await func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/synology_dsm/coordinator.py", line 140, in _async_update_data
    await self.api.async_update()
  File "/usr/src/homeassistant/homeassistant/components/synology_dsm/common.py", line 332, in async_update
    await self._update()
  File "/usr/src/homeassistant/homeassistant/components/synology_dsm/common.py", line 338, in _update
    await self.dsm.update(self._with_information)
  File "/usr/local/lib/python3.12/site-packages/synology_dsm/synology_dsm.py", line 437, in update
    await asyncio.gather(*update_methods)
  File "/usr/local/lib/python3.12/site-packages/synology_dsm/api/dsm/information.py", line 30, in update
    raw_data = await self._dsm.get(self.API_KEY, "getinfo")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/synology_dsm/synology_dsm.py", line 238, in get
    return await self._request("GET", api, method, params, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/synology_dsm/synology_dsm.py", line 328, in _request
    return await self._request(request_method, api, method, params, False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/synology_dsm/synology_dsm.py", line 310, in _request
    url, params, kwargs = await self._prepare_request(api, method, params, **kwargs)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/synology_dsm/synology_dsm.py", line 270, in _prepare_request
    raise SynologyDSMNotLoggedInException
synology_dsm.exceptions.SynologyDSMNotLoggedInException: {'api': None, 'code': -1, 'reason': 'Unknown', 'details': 'Not logged in. You have to do login() first.'}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/synology_dsm/common.py", line 103, in async_login
    await self.dsm.login()
  File "/usr/local/lib/python3.12/site-packages/synology_dsm/synology_dsm.py", line 193, in login
    raise switcher.get(
synology_dsm.exceptions.SynologyDSMLogin2SARequiredException: {'api': 'SYNO.API.Auth', 'code': 403, 'reason': 'One time password not specified', 'details': 'Two-step authentication required for account: me'}

This clearly shows that the one time password is causing this (last line of quoted output), but why does this suddenly happen? Again, no change in user configuration beforehand. Everything worked fine. Now it doesn’t and I don’t see why.

Thank you in advance for your ideas :slight_smile:

One things I see different then from my situation is that you seem to have two step authentication setup for ‘me’ … I only have this for my admin access

Thank you.

The user “me” is just a placeholder for the actual home assistant account I set up for this. According to the docs, 2FA should be supported by the synology integration. I don’t have any accounts without 2FA and would prefer to keep it that way, unless there is a good reason to change it,

Just noting that it says “required for account” … As I donot have this messages I can only respond to what I see here :slight_smile:

When I sign in on the DS, I get a checkbox “trust this computer”, so on my desktop PC, I don’t have to enter the 2FA code, only username and password.

Perhaps this checkbox is missing / there is another way to activate it? Before I checked that box, I had to enter the 2FA code on my PC as well (of course). Seems like Home Assistant needs to somehow check this box so that it is recognized as a trusted client as well…?

Tried it from my dev/test-HAOS…zero questions, just user/pwd and no ssl stuff, I do know that my HA is setup loosly so maybe that makes it easier to accept?

Hi there,

I have a very similar setup with two Synology DSM.
I am also using 2FA, which worked in the past w/o problems, altough I shutdown my DSM every night, like you do as well.

I cannot say exactly, when the issue starts, maybe a couple of month ago.
Now it seem I am asked to reconfigure (providing credentials plus OTP) every time the DSM has started.

Having said that, I wonder if no one has any solution yet?

Best regards
hassfo

same problem here.