Jump to content

Emby isn't closing used network ports.


anderbytes

Recommended Posts

DGMayor

I'm not a Linux user, but just wanted to say good find.  I'm sure Luke will get it squashed in no time.

Link to comment
Share on other sites

MSattler

I'm not a Linux user, but just wanted to say good find.  I'm sure Luke will get it squashed in no time.

 

So I guess it probably is an issue then.....

Link to comment
Share on other sites

anderbytes

Not a security issue... but related to performance, availability and stability, instead.

 

As long as I could read the feedbacks, only Linux users are experiencing this.... I don't even know if all Distros are impacted.

  • Like 1
Link to comment
Share on other sites

anderbytes

I'm seeing it in windows, although there could be other factors as well.

 

Uh oh... in Windows, too??

 

I guess its worse than I imagined

Link to comment
Share on other sites

runtimesandbox

I can confirm I suffered this issue in both Ubuntu 14.04.4 x64 and Debian 8.3 x64

 

As I mentioned in my other thread the issue is intermittent and for me takes sometime to reproduce. Ie I can go for a week + without any issues.

 

When it does occur I lose all access to the server via the external https url.

The local non https url still works fine.

 

Someone mentioned it maybe a firewall issue. I doubt this but for completeness my server is behind a pfsense firewall

Link to comment
Share on other sites

anderbytes

I can confirm I suffered this issue in both Ubuntu 14.04.4 x64 and Debian 8.3 x64

 

As I mentioned in my other thread the issue is intermittent and for me takes sometime to reproduce. Ie I can go for a week + without any issues.

 

When it does occur I lose all access to the server via the external https url.

The local non https url still works fine.

 

Someone mentioned it maybe a firewall issue. I doubt this but for completeness my server is behind a pfsense firewall

 

I'm not behind a firewall, and it happens to me.

 

Depending on your use (and if your restart your server often), you may take more or less time to notice the issue.

I guess it may be related on how you close your client. Sometimes I close the browser tab, other I sign out, other some crash happens... lots os variables.

 

Same thing to Android : several ways of closing (properly or not) the app and the connection.

 

Luke said he would do something to the next version of dev/beta.... Let's wait

Link to comment
Share on other sites

Redshirt

I just retested to make sure I wasn't lying when I said I was affected on windows.

 

I went through all my Android devices and Force Stopped any clients. Waited about 10 min and ran netstat with no arguments from the windows CL. 

Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    127.0.0.1:51109        GALACTICA:51110        ESTABLISHED
  TCP    127.0.0.1:51110        GALACTICA:51109        ESTABLISHED
  TCP    127.0.0.1:60926        GALACTICA:65001        ESTABLISHED
  TCP    127.0.0.1:65001        GALACTICA:60926        ESTABLISHED
  TCP    192.168.0.15:445       CAPRICA:60747          ESTABLISHED
  TCP    192.168.0.15:8096      192.168.0.18:44582     ESTABLISHED
  TCP    192.168.0.15:8096      192.168.0.18:59715     ESTABLISHED
  TCP    192.168.0.15:39901     5.39.92.137:43450      TIME_WAIT
  TCP    192.168.0.15:39901     5.39.92.137:50297      TIME_WAIT
  TCP    192.168.0.15:39901     S0106602ad06ef6bb:54826  TIME_WAIT
  TCP    192.168.0.15:39901     S0106602ad06ef6bb:55122  TIME_WAIT
  TCP    192.168.0.15:39901     16-235-201-31:42190    TIME_WAIT
  TCP    192.168.0.15:39901     16-235-201-31:42245    TIME_WAIT
  TCP    192.168.0.15:39901     16-235-201-31:42445    TIME_WAIT
  TCP    192.168.0.15:39901     16-235-201-31:42510    TIME_WAIT
  TCP    192.168.0.15:39901     37.60.74.211:61449     ESTABLISHED
  TCP    192.168.0.15:39901     37.220.35.196:51989    TIME_WAIT

192.168.0.18 is my Fire TV Stick.

 

Before I force stopped all the clients, 192.168.0.18 had over 3 dozen ports "ESTABLISHED". So the Android clients are holding ports open and requesting new ones endlessly in my situation.

Link to comment
Share on other sites

runtimesandbox

 

 

Depending on your use (and if your restart your server often), you may take more or less time to notice the issue.

 

I don't restart the server unless I have to. This being the main reason for a restart, otherwise its an update.

 

I mainly use either Kodi plugin or the web browser. I rarely use the android client as it does not work externally - however, I haven't tested this theory, but it seems to be after i attempt to use the android app (ie use it locally where it works) that I then get this issue. I will investigate further this week

Link to comment
Share on other sites

anderbytes

@@Luke, have you implemented that keep-alive adjust in the new latest stable ??

 

I've updated my Emby yesterday... and I'm still experiencing the ports-storm...

Just to know

Link to comment
Share on other sites

runtimesandbox

The only time i am seeing any issues with this is after I have attempted to use the android app for something. Its fine up to and including the point of using the android app. then 90% of the time its the day after that i run in to this issue.

Link to comment
Share on other sites

anderbytes

The only time i am seeing any issues with this is after I have attempted to use the android app for something. Its fine up to and including the point of using the android app. then 90% of the time its the day after that i run in to this issue.

 

From what I've tested... 90% of ports are from the Android App... and 10% from other connections.

 

Yesterday I did the following test:

- Close all clients (Web, TV, Android, etc...)

- Restart Emby Server

- check NETSTAT (no connections. OK)

- Run Android App, and do some browsing (I used 4G external connection, via https)

- check NETSTAT (connections are there, estabilished, OK)

- Disable 4G in phone

- check NETSTAT (same connections are there, and will be there forever...  :-(   )

 

If instead I close Emby App in Android and my 4G is on... the client managed to tell the server to close the ports.

If my network drops (or if I turn off 4G), server will never know when to close.

In theory... if a TV or desktop is connected and also loses connectivity abruptely... the same thing will happen with them.

 

 

@, Can you reproduce that?

Link to comment
Share on other sites

runtimesandbox

From what I've tested... 90% of ports are from the Android App... and 10% from other connections.

 

Yesterday I did the following test:

- Close all clients (Web, TV, Android, etc...)

- Restart Emby Server

- check NETSTAT (no connections. OK)

- Run Android App, and do some browsing (I used 4G external connection, via https)

- check NETSTAT (connections are there, estabilished, OK)

- Disable 4G in phone

- check NETSTAT (same connections are there, and will be there forever...  :-(   )

 

If instead I close Emby App in Android and my 4G is on... the client managed to tell the server to close the ports.

If my network drops (or if I turn off 4G), server will never know when to close.

In theory... if a TV or desktop is connected and also loses connectivity abruptely... the same thing will happen with them.

 

 

@, Can you reproduce that?

 

Will double check and confirm this when I get home tonight but I'm pretty sure thats what I was seeing before.

 

It tends to be only me that uses the android App. If I don't use it for a week + I have no issues with being able to get remote access

Link to comment
Share on other sites

runtimesandbox

This issue may be happening tome more frequently than I realised. I have had the server restart plugin installed restarting my server every 24 hours.

 

Will disable and see if the problem is more obvious 

Link to comment
Share on other sites

anderbytes

Any news on that?

 

If devs are watching this thread.... in which stable a fix can be expected?

I can't install beta because I installed Emby via OMV plugin system.

Link to comment
Share on other sites

runtimesandbox

So far no. 

I have turned off the server restart plugin but i am yet to experience the issue. The only thing I haven't done since the last restart was try to use the android app for anything.

 

I will watch something via the emby android app tonight and see how long it takes to become inaccessible 

Link to comment
Share on other sites

anderbytes

OK.

 

Just hope the devs are taking this seriously... even if Linux users aren't the mainstream users for Emby.

Link to comment
Share on other sites

runtimesandbox

OK.

 

Just hope the devs are taking this seriously... even if Linux users aren't the mainstream users for Emby.

 

Agreed

 

Have any of the devs been able to reproduce this?

Link to comment
Share on other sites

anderbytes

Agreed

 

Have any of the devs been able to reproduce this?

 

First thing is to summon them (@@ebr and @Luke) to the topic... :mellow:

 

I wish at least my posts #36 and #38 could be answered.

 

And the most important of all: even if one of them (@Redshirt) could reproduce the problem IN WINDOWS version of Emby (post #34).

 

Can't tell for sure if it is a specific ANDROID client-side issue. If it is the case, move the topic and please try to make a fix.

Edited by anderbytes
Link to comment
Share on other sites

runtimesandbox

Yep still having the issue. Again it only manifests after i use the android app. 

 

To confirm this I will not use an android app from any device for the next 2 weeks and will see if the issue appears 

Link to comment
Share on other sites

runtimesandbox

Well a quick update, I haven't used the android app for the last week and I so far have not experienced this issue

Link to comment
Share on other sites

anderbytes

Certainly there is an existing issue related to Android App and server sockets.

 

Each time Android app connects, there's a 50% chance that this connection gets broken somehow, leaving zombie sockets up, that use resources and won't be automatically liberated.

 

The easiest way to see this is to look at the number of open ports in server, comparing to how many devices are really connected.

 

Sometimes even with few ports open, somehow Android manages to make server "stutter"

 

That's really sad  :-(((

 

After next server stable, I'll be putting all my efforts in reporting Android sh** if they are still there.

Link to comment
Share on other sites

MSattler

Certainly there is an existing issue related to Android App and server sockets.

 

Each time Android app connects, there's a 50% chance that this connection gets broken somehow, leaving zombie sockets up, that use resources and won't be automatically liberated.

 

The easiest way to see this is to look at the number of open ports in server, comparing to how many devices are really connected.

 

Sometimes even with few ports open, somehow Android manages to make server "stutter"

 

That's really sad  :-(((

 

After next server stable, I'll be putting all my efforts in reporting Android sh** if they are still there.

 

Dust in the wind..... all we are is dust in the wind........

 

Inevitably this is what happens when a free product becomes a paid product.  There are not enough paid developers to keep up with demand, but to hire more developers mean the paid developers take in less cash.  This in turn then means that volunteer's are less likely to help for free, when they see the other guys making a ton of money off of it.

 

I see this as the future of Emby.  Power and greed corrupts, software development is no different than politics =)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...