core: Synology DSM no longer working with 2FA authentication from 0.117.0b5
The problem
My Synology integration has stopped working since upgrading to 0.117.0b5. Everything has worked fine previously, but I know have no devices & no entities tied to the intregration.
Environment
- Home Assistant Core release with the issue: 0.117.0b5
- Last working Home Assistant Core release (if known): 0.116.4
- Operating environment (OS/Container/Supervised/Core): Supervised
- Integration causing this issue: SynologyDSM
- Link to integration documentation on our website: https://www.home-assistant.io/integrations/synology_dsm
Problem-relevant configuration.yaml
- platform: synology_dsm
host: <<IP_ADDRESS>>
username: !secret synology_username
password: !secret synology_password
Traceback/Error logs
Logger: homeassistant.config_entries
Source: components/synology_dsm/__init__.py:262
First occurred: 9:34:19 (2 occurrences)
Last logged: 9:35:47
Error setting up entry 192.168.1.221 for synology_dsm
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 234, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/usr/src/homeassistant/homeassistant/components/synology_dsm/__init__.py", line 168, in async_setup_entry
await api.async_setup()
File "/usr/src/homeassistant/homeassistant/components/synology_dsm/__init__.py", line 262, in async_setup
await self._hass.async_add_executor_job(
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/site-packages/synology_dsm/synology_dsm.py", line 160, in login
raise switcher.get(
synology_dsm.exceptions.SynologyDSMLogin2SAFailedException: {'api': 'SYNO.API.Auth', 'code': 404, 'reason': 'One time password authenticate failed', 'details': 'Two-step authentication failed, retry with a new pass code'}
Home Assistant has started!
Additional information
I have removed and re-added the integration several times, also tried adding via UI and via configuration, both show the same error.
I have tried creating an entirely new user in DSM, still the same result.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 3
- Comments: 37 (8 by maintainers)
ditto - restarted and everything came back!! YAY!!!
The programmers are confirmed AWESOME š
analyse of code changes:
with following change by commit 7469bd92664c8c
the affective call to login API (source) was changed so far that
device_idhas been replaced byotp_code, becauseentry.data.get("device_token")is no longer provided during setup ofSynoApi(), but later at callself.dsm.loginEDIT:
device_idis not replaced byotp_code, butotp_codeis additional set and filled withentry.data.get("device_token")Agreed; re-instated 2fA on Synology DSM, removed and re-installed this integration and provided the one time password and its working now. Thanks as itās vital for me to keep 2FA on this key assetā¦
Working fine here as well. Thx a lot!
Simone
Thanks guys on working on this, Iāve tested this and it works as expected now!
Fixed in 0.117.4 for me! Many Thanks.
Thanks all for looking into the issue, appreciate the efforts.
Iāll report the results one 0.117.3 is released
Same issue on 0.117.2, running hass.io on an Raspberry Pi 4.
All the synology entities are āunavailableā before i removed it. I tried to remove and add it again, now i see no entities. I just waited for the scan of 15 minutes but they still disappeared
2020-11-02 09:08:22 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 192.168.0.1 for synology_dsm Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 234, in async_setup result = await component.async_setup_entry(hass, self) # type: ignore File "/usr/src/homeassistant/homeassistant/components/synology_dsm/__init__.py", line 168, in async_setup_entry await api.async_setup() File "/usr/src/homeassistant/homeassistant/components/synology_dsm/__init__.py", line 262, in async_setup await self._hass.async_add_executor_job( File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.8/site-packages/synology_dsm/synology_dsm.py", line 160, in login raise switcher.get( synology_dsm.exceptions.SynologyDSMLogin2SAFailedException: {'api': 'SYNO.API.Auth', 'code': 404, 'reason': 'One time password authenticate failed', 'details': 'Two-step authentication failed, retry with a new pass code'}Same issue for me⦠The 0.117.2 donāt fix itā¦
Hi, same issue here after removing and re-adding the integration. Iām asked for the 2FA password, dialog says āconfiguration completedā but sensors are not created and error below shows up-
Simone
Hi,
I was browsing around, and I too have this EXACT same issue where I get the 2FA error. Iāve also did what @robearlam do and nothing works, and I also get the error below too:
* Error setting up entry myDSMserver.com for synology_dsm Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 234, in async_setup result = await component.async_setup_entry(hass, self) # type: ignore File "/usr/src/homeassistant/homeassistant/components/synology_dsm/__init__.py", line 168, in async_setup_entry await api.async_setup() File "/usr/src/homeassistant/homeassistant/components/synology_dsm/__init__.py", line 262, in async_setup await self._hass.async_add_executor_job( File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.8/site-packages/synology_dsm/synology_dsm.py", line 160, in login raise switcher.get( synology_dsm.exceptions.SynologyDSMLogin2SAFailedException: {'api': 'SYNO.API.Auth', 'code': 404, 'reason': 'One time password authenticate failed', 'details': 'Two-step authentication failed, retry with a new pass code'}Iāve posted this issue on HA forums too:
https://community.home-assistant.io/t/issues-with-synology-dsm-on-latest-hassio-0-117-0/240050
This seems to stem from how 0.117.0 deals with the synology DSM 2fa. Also I too am running the exact OS and Hardware that @robearlam is using funny enough.
The only thing different is I am using the surveillance station package on my DSM, and it was working on the older version before upgrading today.
If anyone has ideas, iām all ears, or need to test this.