Page 1 of 2

Why won't my server stay up?

PostPosted: Thu Jun 09, 2011 6:51 pm
by eggsyntax
Hi,

I really love Subsonic, and have a server installed. Everything works fine, and I can access it both locally and remotely, both via the web and via an iPhone app. The problem is that the server becomes inaccessible after a period ranging from a couple of hours to 24 hours, and has to be restarted. If anyone can clue me in as to what's going on, I'd really really appreciate it!

The error message thrown by Chrome is: "Oops! Google Chrome could not connect to 192.168.0.111:4040"; on Safari it's "Safari can’t open the page “http://192.168.0.111:4040/” because Safari can’t connect to the server “192.168.0.111”." I can still connect to my web server with no problem (eg I can load 192.168.0.111 in a browser).

When I look at the logs, I see a bunch of warnings thrown, eg:
Code: Select all
[2011-06-09 02:59:25,757] WARN JaudiotaggerParser - Failed to find cover art tag in /Volumes/Music/The Wiyos/Hat Trick/._01 Intro.m4a
org.jaudiotagger.audio.exceptions.CannotReadException: This file does not appear to be an Mp4  file
        at org.jaudiotagger.audio.mp4.Mp4InfoReader.read(Mp4InfoReader.java:68)
        at org.jaudiotagger.audio.mp4.Mp4FileReader.getEncodingInfo(Mp4FileReader.java:41)
        at org.jaudiotagger.audio.generic.AudioFileReader.read(AudioFileReader.java:104)
        at org.jaudiotagger.audio.AudioFileIO.readFile(AudioFileIO.java:285)
        at org.jaudiotagger.audio.AudioFileIO.read(AudioFileIO.java:148)

.....[I can post the rest of the stack trace if desired]

but the log continues, first with messages like:

Code: Select all
[2011-06-09 03:00:00,189] INFO SearchService - Starting to create search index.
[2011-06-09 03:00:02,381] INFO SearchService - Created search index with 1000 entries.


and then with hourly messages like:

Code: Select all
[2011-06-09 11:41:19,180] INFO NetworkService - Successfully forwarding port 4040.
[2011-06-09 12:41:22,234] INFO NetworkService - Successfully forwarding port 4040.
[2011-06-09 13:41:25,286] INFO NetworkService - Successfully forwarding port 4040.



So what's going on? I'm totally baffled.

Problem Description: Server goes down in some way I don't understand
Troubleshooting Steps: Restarting server solves the problem, but it just goes down again after a few hours
Playback Application and version: web interface or iphone app; problem is the same either way.
Subsonic Version: 4.4 (build 2169) – February 6, 2011
Server Version: jetty-6.1.x, java 1.6.0_24, Mac OS X (83.9 MB / 97.9 MB)
Hardware Platform: iMac, OS X Snow Leopard
Java Memory Limit: Not sure how to find this out on a Mac.
Problem Filename: n/a

ffmpeg -i: Doesn't seem to be available under OS X

Last 10 lines of log, post-restart:
Code: Select all
[6/9/11 2:44:58 PM EDT]   INFO   DaoHelper   Checking database schema.
[6/9/11 2:44:59 PM EDT]   INFO   DaoHelper   Done checking database schema.
[6/9/11 2:44:59 PM EDT]   INFO   SearchService   Automatic index creation scheduled to run every 1 day(s), starting at Fri Jun 10 03:00:00 EDT 2011
[6/9/11 2:45:00 PM EDT]   INFO   PodcastService   Automatic Podcast update scheduled to run every 24 hour(s), starting at Thu Jun 09 14:50:00 EDT 2011
[6/9/11 2:45:03 PM EDT]   INFO   NetworkService   Successfully forwarding port 4040.
[6/9/11 2:45:06 PM EDT]   INFO   VersionService   Resolved local Subsonic version to: 4.4
[6/9/11 2:45:06 PM EDT]   INFO   VersionService   Resolved latest Subsonic final version to: 4.4
[6/9/11 2:45:06 PM EDT]   INFO   VersionService   


Any help would be HUGELY appreciated. I've tried running some Google searches and scanning this forum and haven't found anything that seems to apply. I'm a programmer, so I'm not a COMPLETE idiot about most computer stuff ;)

I'll check this topic regularly, and will provide any other requested info as quickly as I can.

Thanks again :)

PostPosted: Fri Jun 10, 2011 3:31 am
by GJ51
Try increasing the memory allocation for Subsonic in the control panel. If you have a large collection increase the default 100mb to 256mb.

Thanks

PostPosted: Fri Jun 10, 2011 12:14 pm
by eggsyntax
Thanks, Gary -- just increased the memory available to java in the info.plist file to 256MB and restarted the server. I'll keep an eye on it throughout the day and report back.

Thanks!

PostPosted: Sat Jun 11, 2011 1:33 am
by eggsyntax
So far so good!

PostPosted: Sat Jun 11, 2011 2:23 am
by GJ51
Glad to hear it's working. It seems that more Subsonic users have much larger libraries than was originally anticipated when the program was first released. With memory and hard drive space getting cheaper and cheaper, you should be able to stay ahead of the demands of the library as it grows. If 256 seems to be getting low, just bump it up to 384 or 512. You can open the icon tray Control Panel from time to time to check on how much memory is being used.

PostPosted: Sat Jun 11, 2011 2:35 am
by eggsyntax
Yeah, my collection's about to hit 400GB...I do some DJing, so I have at least a vague excuse ;)

I'll bump it up as necessary. Thanks again for the advice. Incidentally, based on a forum search, the only way I found to increase JVM memory for subsonic was to edit /Applications/Subsonic.app/Contents/Info.plist -- is there another way that you know of? It's a shame; many users may find that a bit beyond their comfort zone; I wish there were a way to edit it in the Subsonic GUI.

PostPosted: Sat Jun 11, 2011 3:04 am
by GJ51
In the windows version there is a tray icon that you can use to access the Subsonic Control Panel. Once there you can edit the ports that SS uses and the memory setting.

PostPosted: Sat Jun 11, 2011 3:09 am
by eggsyntax
Hmm, yeah, there's not such a thing that I've seen on the Mac version. A fair number of settings accessible through the web GUI, but not JVM stuff that I've seen. In any case, I'm certainly happy enough to edit the Info.plist file. Thanks again for all your help.

PostPosted: Sat Jun 11, 2011 3:35 am
by Kirk
Based on a response to my tutorial thread on how to increase the memory limit, it looks like that's the accepted method for increasing it on Mac systems.

I don't have one so I wasn't of much help writing that part of the tutorial. :roll: Personally I don't think Mac or Windows have any business being on a production server.

-Kirk

PostPosted: Sat Jun 11, 2011 3:53 am
by GJ51
Uh-oh, I think I resemble that remark ... :oops:

I'm pretty content with my Windows based network. We run Server 08 R2 as the domain controller and run SharePoint and SQL on it. We also use WHS 2011 to back up all our workstations and the Server 08 box.

I primarily kept expanding our home network as a hobby starting in 1983, and my son took a real interest as he got older so we just kept rolling with what we had. It's allowed hin to become a pretty good tech at 16, being proficient with Server 08, Active Directory, webdesign (his major site averages 20,000 hits a month), C++. C#, Java (he took a Java course in school this year and after the first semester the teacher had him teach the rest of the course), he is a guest speaker on multiple podcasts, and consults for several non-profits and runs about 8 websites for various organizations.

But I agree, he's led a sheltered life and I really should move him on to other platforms to broaden his base a bit before he gets to college.

What server options do you think we should look at?

PostPosted: Sat Jun 11, 2011 10:21 pm
by supra92
Hi Gary,

Considering much of what you described of your son's interests and work-related endeavours, it sounds like something that would do dual-duty in expanding horizons whilst also arming him with "business-useful" skills that would actually be applicable, if so desired, in future professional efforts would be a nice choice.

Towards that end, I think it would be tough to go wrong with RHEL - Red Hat Enterprise Linux. Not that there's anything absolutely special about Red Hat per se, but Linux as a whole is obviously a server OS that has stood the test of time and RHEL is by far the leading distro when it comes to enterprise installations. Getting solidly acquainted with RHEL would do a nice job of exposing him to the *NIX platform as a whole, to Linux more specifically as an OS family, and to the most likely distro he'll encounter in his future business life.

The best part is that he doesn't have to shell out any $$ right now to have full access -- since RHEL (and all Linux distros) are based on the GNU GPL, the code is fully available and thus can be redistributed for free by anyone who removes the RedHat-specific language and icons and etc. You've likely heard of the two main RHEL clones: Scientific Linux, and CentOS. CentOS, until recently, was the more popular of the two with the larger install base... but that project has become derailed of late. Scientific Linux, on the other hand, is primarily worked on and distributed by the CERN and Fermilab entities, which is reassuring both in terms of stability and longevity of releases/support.

http://www.scientificlinux.org is the SL homepage, and in March they released Scientific Linux 6, which is based on the "upstream vendor"s RHEL6. I use this for my own primary servers here at the house, including the one on which Subsonic runs. I've run SL for years and while it's not as "bleeding-edge" as Fedora Linux (which is the 'testbed' for most features that wind up in RHEL), I don't really want bleeding-edge for my Subsonic or other servers -- just something that's stable, solid, reliable, and for which I can go get updates myself on certain packages for which I desire more-recent versions. JW Player comes to mind... :-)

Lots of options, certainly, but a modest endorsement here for Scientific Linux 6 (and by extension RHEL 6). He can even install Subsonic on it to compare Windows vs. Linux installation/configuration methods directly.

PostPosted: Sat Jun 11, 2011 11:34 pm
by GJ51
Thank you so much for the feedback. We just set up a box that we are going to use for *nix, whichever one we decide on. I will certainly look at both, but I'm inclined to lean toward the scientific version myself as it would be considered mainstream at the acedemic level and be able to give him a platform to get his feet wet.

Thanks again for the tip.

EDIT: Junior agrees with SL6. :D SL 6 it is!

PostPosted: Sun Jun 12, 2011 3:25 pm
by GJ51
One more question. Which version of Subsonic is preferable to install on Linix? Should I use the Red Hat/Fedora installer, the Stand-alone version, or the WAR version?

Any thoughts as to which version and why would be greatly appreciated.

Thanks.

PostPosted: Sun Jun 12, 2011 6:07 pm
by supra92
That's the other benefit of going with SL6 -- because it's a recompiled RHEL, and thus by extension based off Fedora, most everything that utilises the RPM scheme will work on SL6.

The short answer is that the standalone and Fedora installer ones take less to get up and going, but the WAR version gives you more flexibility by allowing you to run more than one app on the same port.

For my house, I run a website on 80, SSH on 8080 (because my co. blocks port 22 outbound), and then I have a custom-written album catalogue app that I wrote in .NET/C# but compiled to Java and running on Tomcat6, which runs on that same Linux server on 443. So I've used up 80, 8080, and 443. Since those are the only ports typically accessible to people from inside a corporate environment, I wanted Subsonic to run on one of those as well -- so the solution was utilise the WAR version of SS and deploy it to Tomcat6, alongside my album catalogue app.

If the above situation doesn't apply, then it's probably easier to simply use the built-in Jetty webserver that comes with SS, in which case I'd say use the Fedora installer. Caveat - I've never used that before, because I made the switch from the standalone SS to the Tomcat WAR SS before Sindre offered the RPM version... it should, however, behave just like the standalone version except with the nicer "service subsonic start/stop/restart" method instead of manually killing a Linux process (PID) and executing a shell script to start it up.

Quick summary:

1. Standalone Subsonic
-- start up by executing $SUBSONIC_HOME/standalone/subsonic.sh
-- stop by doing ps aux - grep subsonic, and killing the subsonic PID
-- edit port, etc. via that same subsonic.sh script
-- SS dominates the port you assign it and no other app can use it

2. Fedora installer
-- start up via "service subsonic start" command
-- stop via "service subsonic stop" command
-- edit port, etc. via editing /etc/sysconfig/subsonic file
-- SS dominates the port you assign it and no other app can use it

3. Tomcat WAR
-- ensure Tomcat6 is installed and functional, then shut it down
-- drop the SS WAR file into $TOMCAT_HOME/webapps
-- start up Tomcat6, and it auto unpacks the WAR file and deploys SS
-- SS is started/stopped via the Tomcat6 admin webpage (or by "service tomcat6 stop" if stopping tomcat entirely)
-- SS is just one of many apps that can run on that assigned port, as Tomcat is a java servlet container


Apologies for the long-winded reply - for now, I'd say roll with the Fedora installer and see how it goes. It should definitely be the easiest one to use, and if you want it to start up every time you boot up your server you can just do a "chkconfig --level 345 subsonic on" and you're all set. But you now understand the benefits of the WAR version should the need ever arise.

Cheers,
Supra92

PostPosted: Sun Jun 12, 2011 8:55 pm
by Kirk
Personally I find Red Hat\Fedora to be a pain in the ass, and I don't know of any companies that actually use those distro's...

Instead of starting at the pain-in-the-ass distributions, why not start with the simple distro that has a nice package manager? Debian \ Ubuntu is relatively simple to learn for anyone. From there, the stuff required on Red Hat isn't all that different, but on Debian you don't have to deal with RPM files and you get a nice package manager, dpkg \ aptitude.

Honestly, I work for a mid-sized IT department (~600 computers) at a high school. We use Ubuntu on production servers, such as our web server and MySQL server, without any problems. So anyone who says Ubuntu is not business grade... pfft. :roll:

-Kirk