Sonos making thousands of SMB3 connections to Synology

  • 27 January 2022
  • 66 replies
  • 2537 views


Show first post
This topic has been closed for further comments. You can use the search bar to find a similar topic, or create a new one by clicking Create Topic at the top of the page.

66 replies

Userlevel 7
Badge +22

Sonos seems to prioritize problems by the number of folks complaining to them so unless a bunch of folks with your hardware/problem complain it isn’t likely to top the list.

It would be an interesting experiment to see how your setup would respond to using an SMB gateway between the NAS and your Sonos. I’d say use a Raspberry Pi but they are about impossible to find and priced way too high due to the chip shortage. Maybe another SMB capable system instead? Same basic setup.

SMB v1 Gateway  https://stan-miller.livejournal.com/357.html

Userlevel 1
Badge +1

Hi @Chewbucka,

 

I ask that you please reach out to our customer care team for some live troubleshooting, as our engineers are looking to investigate any cases where this issue persists after the 14.4 update.

I’ve replied back to the customer care rep yesterday with the same information posted here, but haven’t heard back yet.

Userlevel 1
Badge +1

Also, as an FYI, I’m only seeing connections from one speaker. The connections are up to 565 active sessions. I do have songs from the NAS queued up on this speaker, but not playing. I’ve just cleared the queue on the speaker with all the connections to see if that helps.

Userlevel 1
Badge +1

I’ve run an SMB gateway my pi to the NAS but it didn’t work. I tried various versions of samba.

Userlevel 1
Badge +1

Just checked and I’m at 1095 connections to the NAS. Before, the connections would just continue growing unchecked. I’ll let you know if the number goes back down by itself over time.

Userlevel 7
Badge +22

That is sounding more and more like a NAS issue. 

While playing with the Pi as a gateway I connected it to several different data sources from a Windows PC to Linux systems and with different protocols with no issues.

Userlevel 1
Badge +1

I would have much more than 218 connections I just set the deadtime global in samba to kill anything older than 3 days.

Userlevel 1
Badge +1

I have installed 14.8 and so far, things seem to be better. I’m not seeing the connections staying open like before and the SMB1 connections stopped over a month ago. How does it look for everyone else? The SMB service on my Synology is still running 4.10.18-0434.

Userlevel 1
Badge +1

For my particular use case, I have various songs on my NAS that I then create sonos playlists and then these are triggered by home automation. Rather than connect to the root music share that has many thousands of songs, I now have a new folder for sonos that I put the songs I need to play on the speakers and nothing else. Connecting to this sonos only share seems to have helped since there are now just a dozen songs or less at any one time.

If you’re wanting to have access to your entire library and you can’t modify the smb.conf file to close stale connections, you can go into the Synology Control Panel, File Services, SMB, Advanced Settings, Others, and then check the box next to “Disable multiple connections from the same IP address”. This keeps the connections from getting out of control, but does introduce an issue where the first song of the playlist won’t play and you have to hit play a second time before the music will start playing.

Userlevel 1
Badge +1

Yeah this was the original problem whereby the max connections was too low, and then you wind up skipping songs if you are just doing a shuffle.  But the bigger issue when you set max connections to a low value is that the music library scan fails, so I was having a problem updating it until I set the maxconnections to a higher number like 500.  A deadtime of 3 days and maxcon 500 seems to avoid problems at least for me.

 

Userlevel 1
Badge +1

No I still have 218 connections to my Music share from 5 Sonos devices running 14.8.

 

Userlevel 1
Badge +1

Which version of samba are you using and can you send the global config section?

Userlevel 1
Badge +1

Update: I mirrored my NAS to a rasperry pi via NFS, and then served that to the sonos via smb, in effect creating a 2nd smb server, and the problem still happens very quickly and is easily reproducible. So 99% sure it is a problem with Sonos.

 

Userlevel 1
Badge +1

I’d prefer to use your settings billfor since doing the single connection breaks things.

What are the settings in your smb.conf file that you’re using? I’ll see if there’s a way to modify this on the Synology so that it persists across a reboot. Typically, you aren’t supposed to modify config files from the CLI, but there’s no GUI settings to update the deadtime and max connections.

Userlevel 1
Badge +1

In the [global] section ,

deadtime=4320

max smbd processes = 500

 

and in the section for the specific share,

max connections = 400

 

On my old NAS, even though the max connections is technically per share, my NAS autogenerates the smb.conf from another config, so I had to make all my max connections 400.

 

Also in [global] you could try adding:

socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=524288 SO_SNDBUF=524288

 

But I don’t think it makes a difference and it might cause other issues, so best to leave it alone unless you want to experiment.

 

 

Userlevel 4
Badge +4

Interesting, I have two Linux servers running serving music to Sonos via SMB and I have no issues at all. What version of the Samba are you using?

Userlevel 1
Badge +1

 

root@ix4-300d:/usr/local/samba/bin# /usr/local/samba/sbin/smbd --version
Version 4.9.3
root@ix4-300d:/usr/local/samba/bin# smbstatus | grep Music | wc -l
400
^^ no kidding

root@rpi4:~# smbd --version
Version 4.13.13-Debian

root@rpi4:~# smbstatus | grep Music | wc -l
50

It should use and maintain 5 connections only.

 

I’ve talked to friends and they have the same issue. You need to run 14.x not 13.x. S2 only.

Pretty easy to reproduce. Play from a share with a few thousand songs on it, scroll through album art in the queue to force connections, etc…

It’s most likely a connection pool issue.

 

 

Userlevel 7
Badge +22

Samba 4.9.5-Debian that ships with the  5.10.103-v7+ Raspberrian I have running and whatever OpenSuse 15.3 used, haven’t tried it on 15.4.

Userlevel 1
Badge +1

4.13.13 ships with bullseye

root@rpi4:~# lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye
root@rpi4:~# samba -V
Version 4.13.13-Debian

 

I had downloaded the source and built the latest 4.16 a few months ago, and had the same problem. Went back to older containerized versions and same problem. Given that my NAS is a 10 year old lenovo ix4 that has never had any problems with leaving open files with any other application, including the 13.x version of the sonos fw, I’m inclined to believe that this is a sonos problem. My library is 20,000 songs though, so it may be quantity. Not ruling out there is some global config that could be set to fix it though.

 

 

Userlevel 7
Badge +22

I really should update that Pi but since it just sits in the rack quietly running I hate to disturb it. I swapped power bricks a couple months ago so this is a low number.

pi@pi-3b-2:~ $ uptime
 17:05:56 up 65 days,  4:33,  2 users,  load average: 0.23, 0.40, 0.35

pi@pi-3b-2:~ $ lsb_release -a
No LSB modules are available.
Distributor ID:    Raspbian
Description:    Raspbian GNU/Linux 10 (buster)
Release:    10
Codename:    buster
 

Userlevel 4
Badge +4

Weird and interesting… as said, I have no issues here. I’m running Samba 4.9.5 and Samba 4.15.5 on two different machines and can’t reproduce this issue.

What exactly do you do? You mention a share with a few thousand tracks, do you have them all in the queue? I added approx. 1000 tracks to the queue, played it and scrolled through and had no issues. Also browsing through the library doesn’t create any excess connections that are not closed. 

Userlevel 1
Badge +1

After removing the queue from the speaker, no new persistent connections are made to the NAS, just the 565 that were there from before.

I’m also starting to see SMB1 connections, from several speakers, randomly showing up again even when the mobile app wasn’t running.

Warning

Connection

2022-04-02 08:11:30

SYSTEM

Host [192.168.22.120] failed to connect via [SMB] due to [SMB1 not permitted].

Warning

Connection

2022-04-02 08:11:30

SYSTEM

Host [192.168.22.115] failed to connect via [SMB] due to [SMB1 not permitted].

Warning

Connection

2022-04-02 08:11:30

SYSTEM

Host [192.168.22.120] failed to connect via [SMB] due to [SMB1 not permitted].

Warning

Connection

2022-04-02 08:11:30

SYSTEM

Host [192.168.22.118] failed to connect via [SMB] due to [SMB1 not permitted].

Warning

Connection

2022-04-02 08:11:30

SYSTEM

Host [192.168.22.115] failed to connect via [SMB] due to [SMB1 not permitted].

Warning

Connection

2022-04-02 08:11:30

SYSTEM

Host [192.168.22.118] failed to connect via [SMB] due to [SMB1 not permitted].

 

I’ve rebooted the speaker that had the 565 connections open to the NAS to see if they disconnect from the NAS. It would appear that if you have any songs from the NAS queued up on a speaker, it will slowly open persistent connections to the NAS.

I’ve reported this to support, but we haven’t done any additional troubleshooting at this time.

Userlevel 1
Badge +1

I haven’t noticed an issue with the speakers de-authing on the wifi so far. The only thing is the hundreds of connections, the SMB1 connections, and the continued connections to the NAS even after removing the music library which has the saved credentials. This should be a security concern since the credentials should not be able to be used once the connection to the music library is removed. I haven’t removed my playlist, that contains songs from the NAS, until they can get this fixed.

Userlevel 1
Badge +1

I load the entire NAS into the queue and just shuffle them. Music share is just the root of a bunch of folders with tracks.  So that’s about 19,000.

I’ve tried splitting the rooms, vs combining them and it has no effect on this problem.

I should point out that there was never a problem until 14.0 came out, and as I understand that changed the NAS protocol to SMB3. So that seems to suggest something related in that new feature.

 

It’s not a wifi issue because the problem occurs when everything is wired. How many connections do you have to your NAS that are reused properly?

 

 

 

 

 

 

Userlevel 1
Badge +1

The previous connections went away on their own and now another 361 connections have been made by the same speaker as before. This speaker is not currently the associated product and is a speaker that has a playlist queued up from Spotify so not sure why the speaker is still making persistent connections to the NAS.

I’ve reported this to support as well.