Cannot connect to Synology DSM

I am trying to install the Synology DSM integration. I have a DS413 running DSM 6.2.4-25556. Initially, HA recognized the presence of the NAS and invited me to configure the integration. I was unable to get it working, so I chose to ignore the device. I have since tried to manually configure a few times with no luck. I haven’t found any HA documentation that tells me which port to use, so I’ve tried 5000 without SSL and 5001 with it. These are the ports that work to connect to the web interface.

Here is the log message when not using SSL:

2021-05-07 17:49:15 ERROR (MainThread) [homeassistant.components.synology_dsm.config_flow] {‘api’: ‘SYNO.Core.System.Utilization’, ‘code’: 1055, ‘reason’: ‘Unknown’, ‘details’: {‘err_key’: ‘’, ‘err_line’: 883, ‘err_msg’: ‘Transmition failed.’, ‘err_session’: ‘’}}

Any help?

Thanks!

At first glance you seem to be having the same issue as described here.

That issue was closed for inactivity after two PR’s for the Synology component were removed. You could open an issue on Github referencing the previous issue if you determine they are indeed the same.

On a secondary install of HA I was able to link my DS920+ running DSM 6.2.4-25556 without issue. If you haven’t done so already, try updating to the latest version of HomeAssistant before setting up the integration.

System Health

version: core-2021.4.6
installation_type: Home Assistant Core
dev: false
hassio: false
docker: false
virtualenv: true
python_version: 3.8.5
os_name: Linux
os_version: 5.8.0-50-generic
arch: x86_64
timezone: UTC

Thanks Thomas,

I’m running the latest HA, core-2021-5.1, running Home Assistant OS 5.13 in a VirtualBox VM.

How do I get the “System Health” output you show?

I’ll look at the issue on Github, but I’m not confident that I’m qualified to determine if I have exactly the same issue.

Art

Config > Info

are you using a login account for the integration that has administrator privileges in DSM? It doesn’t have to have access to anything (apps, remote services, DSM login, etc), but the account must be in the administrator group.

It’s been a while since I configured this integration, but I believe you just use the HTTP URL and port configured in DSM. This is port 5000 by default.

1 Like

System Health

Version core-2021.5.1
Installation Type Home Assistant OS
Development false
Supervisor true
Docker true
Virtual Environment false
Python Version 3.8.9
Operating System Family Linux
Operating System Version 5.4.109
CPU Architecture x86_64
Timezone America/New_York

Yes, account has admin privs. I can log into the web interface via browser using that account. HTTP on 5000 and HTTPS on 5001 both work fine that way. HA fails both ways.

does the account have 2FA enabled by chance?

If there’s nothing further to go on, try enabling debug logging for the synologydsm component. That might shed some more light on what’s going on.

No, I never set up 2FA.

That should be synology_dsm, yes? I did that, and there is nothing more in the log than the error in config_flow. I tried making it synology_dsm.config_flow: debug, and still I see no DEBUG entries in the log.

Here is the entry in configuration.yaml:

logger:
default: info
logs:
homeassistant.components.synology_dsm.config_flow: debug

The indentation is correct in the file, BTW. I don’t know how to force it to show in this post. And yes, I did remember to restart HA after editing the file.

Remove the .config_flow and try again, that should give you everything that’s happening with DSM

That is what I tried first. No entries in the log at all. It is as if there is no debug tracing in that code. I tried synologydsm as well as synology_dsm, both with and without config_flow. Four combinations. The only entry in the log in all cases was the same error message as shown in my first post on this topic.

I considered the possibility that HA cannot reach the NAS on my network, so I brought up the HA terminal app and I can ping the NAS both by name and by IP from there.

Maybe if I set up Wireshark on the VM host I can look at the traffic …

OK. I set up Wireshark on the HA VM host. I can see the traffic between HA and the NAS. And when I attempt to configure the Synology DSM integration without SSL, I see HA make these requests:

  1. GET /webapi/query.cgi?api=SYNO.API.Info&version=1&method=query HTTP/1.1
  2. GET /webapi/auth.cgi?account=xxxx&passwd=yyyy&enable_device_token=yes&device_name=homeassistant …
  3. GET /webapi.entry.cgi?api=SYNO.DSM.Info&version=2&method=getinfo&_sid=…
  4. GET /webapi/entry.cgi?api=SYNO.Core.System.Utilization&version=1&method=get&_sid=…

(account=xxxx and passwd=yyyy are correct in the capture, obfuscated here.)

Each GET is followed by some number of data exchange packets in both directions and an HTTP/1.1 200 OK from the NAS.

Interesting, all of the data exchanges for the first 3 GETs use port 5000 on the NAS. But after the data exchange and OK that follows the 4th GET, HA sends FIN,ACK to the NAS on port 2049, the NAS responds from port 2049 with FIN,ACK, then HA sends ACK to the NAS on port 2049.

And that’s it. Then I see the error message in the integration configuration dialog.

So … HA definitely is reaching the NAS, and it looks like the integration setup begins, but it doesn’t complete successfully. And there are NO debug messages in the HA log.

(Deepl translator)
If the problem is still current. Also had problems with connecting to the current admin. Solution with me had been to create new admin user and port 5001 and there was a connection.

1 Like

Sorry, but why does the integration require administrator access? What if I just want to be able to monitor the temperature of the system? Or how much free space I have on a volume? Or just be able to wrote the the storage?

I’m not saying suggesting you’re responsible for this, of course, I’m just generally curious on if this is a DSM limitation or a limitation by the integration.

Limitation of the Synology DSM API. Read here: Synology DSM - Home Assistant

Must have missed that. Sorry. Thanks!