Bug 10913 - Switch SqueezeCenter to another port if 9000 is in use
: Switch SqueezeCenter to another port if 9000 is in use
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Misc
: 7.3.2
: PC Windows XP
: -- normal (vote)
: 7.3.3
Assigned To: Michael Herger
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-30 11:48 UTC by Spies Steven
Modified: 2009-09-08 09:22 UTC (History)
4 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Spies Steven 2009-01-30 11:48:42 UTC
If SqueezeCenter is installed on a system that already has port 9000 in use SqueezeCenter should switch to using another port without user intervention.

Steps to reproduce:
1 Start with a system that has software using port 9000, I used Twonky.
2 Install SqueezeCenter.
3 Notice that after SqueezeCenter installs it is still trying to use port 9000 even though it is already in use and is blocked by Twonky.

I have been told this used to work in previous versions of SqueezeCenter but I am not sure if this was a function of the installer or SqueezeCenter itself.
Comment 1 Spies Steven 2009-01-30 11:55:04 UTC
Just wanted to note that links to the web interface such as the one in SlimTray should be updated to the new port as well if not done already.
Comment 2 Michael Herger 2009-02-02 00:25:09 UTC
There's code in the Windows installer to do this. But for some reason that change is ignored when SC is started for the first time. Maybe it's just a malformatted prefs file. This needs to be fixed in 7.3.3

That said I was wondering whether we should move the port changing code to SC itself. Would be platform independant and would work post-install too. Imagine some WHS user was enabling Twonky _after_ SC installation. This might be post 7.3.x.
Comment 3 Michael Herger 2009-02-02 07:35:37 UTC
Steven - do you see this with any installer or only my "special" installer for WHS?
Comment 4 Spies Steven 2009-02-02 08:42:21 UTC
I see this behavior with both the "special" installer and the standard exe installer for Windows.  I have not investigated this on Mac OS X.

Supposedly support does get calls about this issue now and then and the solution has been to edit the prefs file.

Dan, do you care to comment?
Comment 5 Michael Herger 2009-02-02 08:53:13 UTC
Just to be clear: the port is only change during initial setup. Once SC has been run, there's no more automatic port change, even if port 9000 is being used by someone else.

Can you still confirm you see this fail on _initial_ setup? I only was able to reproduce with the build I did last week. 

BTW: the fallback port we were using (9010) is used by Twonky, too. Thus I'd like to move the port used to be dynamically defined at SC startup.
Comment 6 Spies Steven 2009-02-02 09:00:06 UTC
As far as I can tell this fails with initial setup with both the special installer and the Windows exe.  To be clear this was tested on a HP EX485 WHS in a factory default state that already has Twonky installed and running.

Is there anything else I can do to help?
Comment 7 Spies Steven 2009-02-02 09:09:20 UTC
Wait, 9010 is used by Twonky too?  Maybe the port is being changed by SC after all.  I'll take another look when I get a chance.
Comment 8 Chris Owens 2009-02-02 09:19:29 UTC
Michael notes this functionality should be working via our installer.  Dean states this functionality should be moved into SC.  Mickey to check with IANA about getting another port designated for us.
Comment 9 Mickey Gee 2009-02-02 10:30:23 UTC
Dean suggests reserving ports 9011 and 9012. I'll see about getting them.
Comment 10 Spies Steven 2009-02-02 10:38:31 UTC
Link to the port request form http://www.iana.org/cgi-bin/usr-port-number.pl
Comment 11 Dan Evans 2009-02-02 11:46:06 UTC
So from the bug meeting this morning my understanding is this:

* SC currently has port detection live and working that looks for 3483 & 9000
* If there's a conflict on 3483 we notify the user
* If there's a conflict on 9000 the installer attempts a one-time change to use port 9010 to see if that fixes the problem?

What's being proposed is to change our port dynamically to try to find a working port?

Separately we're investigating acquiring a dedicated port (9011 or 9012) to avoid this trouble altogether.

Am I close?
Comment 12 Michael Herger 2009-02-02 13:34:12 UTC
> Am I close?

As close as you can get :-)
Comment 13 Michael Herger 2009-02-04 02:31:46 UTC
change 24864 - try harder if our httpport is busy. Go through a list of alternative ports before giving up.
Comment 14 Spies Steven 2009-02-04 15:40:35 UTC
Michael, SqueezeCenter still seems to be trying to use port 9000 with a system with Twonky installed.  Perhaps I am not looking in the right place to check for the port.

I started with an HP Windows Home Server that had Twonky 5 already installed and running.  I then installed SC 7.3.3 24866 using the msi Add-in.  After the install finished I checked the server.prefs file and it listed httpport: 9000.

Is this the correct place to check what port SqueezeCenter is using?  Is there another way to see if the port has changed?
Comment 15 Michael Herger 2009-02-05 00:19:02 UTC
Ooops... checked it in to 7.4 only... will backport.
Comment 16 Michael Herger 2009-02-05 00:23:48 UTC
change 24887 - backport change 24864 from 7.4.

Steven - when testing this, look at the log for lines like the following:

[09-02-05 09:21:09.2610] Slim::Web::HTTP::openport (219) Can't setup the listening port 9000 for the HTTP server: Address already in use
[09-02-05 09:21:09.2619] Slim::Web::HTTP::openport (239) Previously configured port 9000 was busy - we're now using port 9001 instead
Comment 17 Spies Steven 2009-02-09 16:26:16 UTC
Sorry Michael, this is still not working for me on the HP Windows Home Server  with Twonky installed and running.  I tried with both the 7.3 and 7.4 nightly msi.  After install SqueezeCenter is still trying to use port 9000 and is listed as such in the server.prefs file.
Comment 18 Michael Herger 2009-02-09 22:02:41 UTC
server.log?
Comment 19 Michael Herger 2009-02-09 22:03:34 UTC
could you please tell me how exactly you proceeded to reproduce this? Step-by-step.
Comment 20 Michael Herger 2009-02-10 04:59:16 UTC
Steven - testing on the WHS again it's indeed failing. Could you run another test on a different machine? 

I wonder what's special about the WHS: by default we don't bind our service to some specific IP address. If I do so, then the port would be detected as busy and SC would fall back to a different port. But leaving the host empty SC fails to see port 9000 is used by Twonky. I'm a bit puzzled.
Comment 21 Michael Herger 2009-02-10 08:34:50 UTC
change 24957 - try connecting to our httpport before setting it up. This should more reliably detect other processes using the same port.
Comment 22 Spies Steven 2009-02-10 11:01:49 UTC
Thanks Michael, that last change seems to have done it!

Verified fixed with SqueezeCenter Version: 7.3.3 - 24957
Comment 23 James Richardson 2009-06-17 09:36:43 UTC
This bug has been fixed in the 7.3.3 release version of SqueezeCenter!

If you haven't already. please download the new version from http://www.logitechsqueezebox.com/support/download-squeezecenter.html 

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.