(Solved) Same error as many 503

Need help? Post your questions here.

Moderator: moderators

(Solved) Same error as many 503

Postby HackitZ » Sun Aug 26, 2012 1:21 am

Hi everyone, let me first say i have been trying to figure this out for a few days and have read several pages about the login error page that is know as 503. I'm just looking foir a little help to actually get this up and running as i have never even seen the setup page or played with this before.

Let me first say i have tried to install this on an open media vault server.
The guide to install was posted on there forums and i have asked for help there and think it's more of a subsonic issue as the service runs, i just can't load the default page located at 192.168.1.136:4040

As I'm new too subsonic i figured it best if i start with the subsonic log file and if no experincied subsonic user can find any issue's in my log then maybe it's not the fault of subsonic.

log:
    root@MEDIA-SERVER:/# cat /var/subsonic/subsonic_sh.log
    23 [main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@5a8a0d5d: display name [org.springframework.context.support.ClassPathXmlApplicationContext@5a8a0d5d]; startup date [Fri Aug 24 22:13:42 EDT 2012]; root of context hierarchy
    [GC 3072K->368K(8896K), 0.0012620 secs]
    76 [main] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [applicationContext-deployer.xml]
    [GC 3437K->480K(8896K), 0.0016250 secs]
    [GC 3552K->544K(8896K), 0.0011100 secs]
    416 [main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@5a8a0d5d]: org.springframework.beans.factory.support.DefaultListableBeanFactory@58d9660d
    [GC 3616K->602K(11968K), 0.0014270 secs]
    430 [main] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@58d9660d: defining beans [service,org.springframework.remoting.rmi.RmiServiceExporter#0]; root of factory hierarchy
    451 [main] INFO org.mortbay.log - Logging to org.slf4j.impl.SimpleLogger(org.mortbay.log) via org.mortbay.log.Slf4jLog
    Using WAR file: /usr/share/subsonic/subsonic.war
    Extracting webapp to /var/subsonic/jetty/3060
    Using WAR file: /usr/share/subsonic/subsonic.war
    484 [main] INFO org.mortbay.log - jetty-6.1.x
    579 [main] WARN org.mortbay.log - Failed startup of context org.mortbay.jetty.webapp.WebAppContext@4f4db0e3{/,jar:file:/usr/share/subsonic/subsonic.war!/}
    java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:131)
    at java.util.jar.JarFile.<init>(JarFile.java:150)
    at java.util.jar.JarFile.<init>(JarFile.java:114)
    at org.mortbay.jetty.webapp.TagLibConfiguration.configureWebApp(TagLibConfiguration.java:171)
    at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1215)
    at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500)
    at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
    at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
    at org.mortbay.jetty.Server.doStart(Server.java:217)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
    at net.sourceforge.subsonic.booter.deployer.SubsonicDeployer.deployWebApp(SubsonicDeployer.java:131)
    at net.sourceforge.subsonic.booter.deployer.SubsonicDeployer.<init>(SubsonicDeployer.java:65)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
    at net.sourceforge.subsonic.booter.Main.<init>(Main.java:24)
    at net.sourceforge.subsonic.booter.Main.main(Main.java:63)
    596 [main] INFO org.mortbay.log - Started SelectChannelConnector@0.0.0.0:4040
    Subsonic running on: http://localhost:4040/
    644 [main] INFO org.springframework.remoting.rmi.RmiServiceExporter - Looking for RMI registry at port '9412'
    [GC 6746K->1106K(11968K), 0.0032020 secs]
    684 [main] INFO org.springframework.remoting.rmi.RmiServiceExporter - Could not detect RMI registry - creating new one
    714 [main] INFO org.springframework.remoting.rmi.RmiServiceExporter - Binding service 'SubsonicDeployerService' to RMI registry: RegistryImpl[UnicastServerRef [liveRef: [endpoint:[127.0.1.1:9412](local),objID:[0:0:0, 0]]]]
    [GC 2253K->1257K(18560K), 0.0018200 secs]
    [Full GC 1257K->1169K(18560K), 0.0311840 secs]
    root@MEDIA-SERVER:/#
Last edited by HackitZ on Tue Aug 28, 2012 2:14 am, edited 1 time in total.
HackitZ
 
Posts: 9
Joined: Sun Aug 26, 2012 1:14 am

Re: Same error as many 503

Postby hakko » Sun Aug 26, 2012 7:43 am

The error here is clearly written in the log: the Subsonic booter can't unzip the file containing the actual Subsonic server code. (java.util.zip.ZipException: error in opening zip file /usr/share/subsonic/subsonic.war)

Now this is a little weird if the /usr/share/subsonic/subsonic.war file is accessible, permissions are set, and it's not corrupted and everything.

Reading on forums like Stackoverflow for ideas brings up this one experience: "I've seen this exception before when whatever the JVM considers to be a temp directory is not accessible due to not being there or not having permission to write".

Now we don't know if this is the actual reason in your case (we only have the can't-unzip error message) but it's worth trying!

To set a different temp directory for Java to use instead of the typical "/tmp" or "/var/tmp" you could alter your subsonic.sh start script and add another -D parameter to the list like this:

Code: Select all
java -Djava.io.tmpdir=/path/to/tmpdir


But no guarantees that it'll work.. I'm just explaining how I would reason.
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Same error as many 503

Postby HackitZ » Sun Aug 26, 2012 3:59 pm

Thanks for the reply,
Let me first say I'm not an expert or even an advance user with linux.

so how do i add java -Djava.io.tmpdir=/path/to/tmpdir, can i just run this code in terminal?

or is it more involved?

Thanks again for the suggestion.
HackitZ
 
Posts: 9
Joined: Sun Aug 26, 2012 1:14 am

Re: Same error as many 503

Postby hakko » Sun Aug 26, 2012 4:19 pm

You have a shell file of some sort that starts Subsonic, right? Probably called subsonic.sh or something like that.

Now, if you open this file with a text editor it should contain an instruction like this:

Code: Select all
java -Xmx150m -cp Java/subsonic-booter-jar-with-dependencies.jar -Dsubsonic.httpsPort=0 -Dsubsonic.port=4040 -Dsubsonic.war=subsonic.war (...)


What I mean is that you want to add another -D argument, like:

Code: Select all
java -Xmx150m -cp Java/subsonic-booter-jar-with-dependencies.jar -Djava.io.tmpdir=/path/to/tmpdir -Dsubsonic.httpsPort=0 -Dsubsonic.port=4040 -Dsubsonic.war=subsonic.war (...)


.. and point it to some /path/to/tmpdir where you have confirmed that the user running the script has permissions to write (and thereby rights to extract the subsonic.war file, which happens to be a zip file).
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Same error as many 503

Postby HackitZ » Sun Aug 26, 2012 8:52 pm

Ok the script i use is from open media vault, so when i run the command to start the install script it's called omv.sh.

So i downloaded the file and opened it in windows using notepad++.

Rather than posting the whole .sh file i have found and included the part for subsonic. near the top it shows it being downloaded to /tmp folder.

install_SUB ()
{
/etc/init.d/subsonic stop > /dev/null 2>&1
screen;
cd /tmp
echo
echo "****************You selected to install SubSonic*********************";
echo
echo "Downloading and installing SubSonic...";
echo "This one takes some time, please wait...";
aptitude -y -q install openjdk-6-jre > /dev/null 2>&1
#lame flac faad vorbis-tools ffmpeg > /dev/null 2>&1
wget 'http://sourceforge.net/projects/subsonic/files/subsonic/4.7.beta3/subsonic-4.7.beta3.deb' -O ./subsonic-4.7.beta3.deb > /dev/null 2>&1
sudo dpkg -i subsonic-4.7.beta3.deb > /dev/null 2>&1
echo "Setting up startup options"
/etc/init.d/subsonic stop > /dev/null 2>&1
sleep 5
rm subsonic-4.7.beta3.deb
/etc/init.d/subsonic start > /dev/null 2>&1
echo "Finished"
sleep 1
}

install_cp ()
{
service CouchPotato stop > /dev/null 2>&1
screen;
cd /tmp
if [ -f /etc/init.d/cpinit ]; then
service cpinit stop > /dev/null 2>&1
rm /etc/init.d/cpinit
update-rc.d -f cpinit remove
fi
echo


sorry for being so new, and i do appreciate your help.
HackitZ
 
Posts: 9
Joined: Sun Aug 26, 2012 1:14 am

Re: Same error as many 503

Postby hakko » Sun Aug 26, 2012 9:13 pm

I guess the "cd /tmp" is just for the installation process, though? To place the new subsonic install file in a temporary directory?

Is "/etc/init.d/subsonic" a binary file or a script? I'm a bit lost here, don't know exactly how open media fault packages thing for you. Try opening /etc/init.d/subsonic in a text editor and see what it actually does.
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Same error as many 503

Postby HackitZ » Sun Aug 26, 2012 10:20 pm

well i opened it and heres a copy of what it says, i used pico.

    root@MEDIA-SERVER:~# pico /etc/init.d/subsonic
    GNU nano 2.2.4 File: /etc/init.d/subsonic

    #! /bin/sh
    ### BEGIN INIT INFO
    # Provides: subsonic
    # Required-Start: $remote_fs $syslog
    # Required-Stop: $remote_fs $syslog
    # Default-Start: 2 3 4 5
    # Default-Stop: 0 1 6
    # Short-Description: Subsonic daemon
    # Description: Starts the Subsonic daemon. Subsonic is a web-based
    # music streamer, jukebox and Podcast receiver.
    # See http://subsonic.org for more details.
    ### END INIT INFO

    # Author: Sindre Mehus <sindre@activeobjects.no>

    # To change the startup parameters of Subsonic, modify the service
    # configuration file /etc/default/subsonic rather than this file.
    [ -r /etc/default/subsonic ] && . /etc/default/subsonic

    PATH=/sbin:/usr/sbin:/bin:/usr/bin
    DESC="Subsonic Daemon"
    NAME=subsonic
    PIDFILE=/var/run/$NAME.pid
    DAEMON=/usr/bin/$NAME
    DAEMON_ARGS="--pidfile=$PIDFILE $SUBSONIC_ARGS"
    SCRIPTNAME=/etc/init.d/$NAME

    # Exit if the package is not installed
    [ -x "$DAEMON" ] || exit 0

    # Run as root if SUBSONIC_USER is not set.
    [ "$SUBSONIC_USER" = "" ] && SUBSONIC_USER=root

    # Make sure Subsonic is started with system locale
    if [ -r /etc/default/locale ]; then
    . /etc/default/locale
    export LANG
    fi

    # Load the VERBOSE setting and other rcS variables
    . /lib/init/vars.sh

    # Define LSB log_* functions.
    # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
    . /lib/lsb/init-functions

    #
    # Function that starts the daemon/service
    #
    do_start()
    {
    # Return
    # 0 if daemon has been started
    # 1 if daemon was already running


    # 0 if daemon has been started
    # 1 if daemon was already running
    # 2 if daemon could not be started

    if [ -e $PIDFILE ]
    then
    ps -p $(cat $PIDFILE) > /dev/null
    [ "$?" = 0 ] && return 1
    fi

    touch $PIDFILE
    chown $SUBSONIC_USER $PIDFILE
    [ -e /var/subsonic ] && chown -R $SUBSONIC_USER /var/subsonic
    [ -e /tmp/subsonic ] && chown -R $SUBSONIC_USER /tmp/subsonic

    start-stop-daemon --start -c $SUBSONIC_USER --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS || return 2
    }

    #
    # Function that stops the daemon/service
    #
    do_stop()
    {
    # Return
    # 0 if daemon has been stopped
    # 1 if daemon was already stopped
    # 2 if daemon could not be stopped
    # other if a failure occurred
    start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE
    RETVAL="$?"
    [ "$RETVAL" = 2 ] && return 2

    # Many daemons don't delete their pidfiles when they exit.
    rm -f $PIDFILE
    return "$RETVAL"
    }

    case "$1" in
    start)
    [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
    do_start
    case "$?" in
    0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
    2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
    esac
    ;;
    stop)
    [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
    do_stop
    case "$?" in
    0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
    2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
    esac
    ;;
    esac
    ;;
    status)
    status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
    ;;
    restart|force-reload)
    #
    # If the "reload" option is implemented then remove the
    # 'force-reload' alias
    #
    log_daemon_msg "Restarting $DESC" "$NAME"
    do_stop
    case "$?" in
    0|1)
    do_start
    case "$?" in
    0) log_end_msg 0 ;;
    1) log_end_msg 1 ;; # Old process is still running
    *) log_end_msg 1 ;; # Failed to start
    esac
    ;;
    *)
    # Failed to stop
    log_end_msg 1
    ;;
    esac
    ;;
    *)
    echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
    exit 3
    ;;
    esac

    :

HackitZ
 
Posts: 9
Joined: Sun Aug 26, 2012 1:14 am

Re: Same error as many 503

Postby HackitZ » Sun Aug 26, 2012 10:35 pm

hakko wrote:You have a shell file of some sort that starts Subsonic, right? Probably called subsonic.sh or something like that.

Code: Select all
java -Xmx150m -cp Java/subsonic-booter-jar-with-dependencies.jar -Djava.io.tmpdir=/path/to/tmpdir -Dsubsonic.httpsPort=0 -Dsubsonic.port=4040 -Dsubsonic.war=subsonic.war (...)


.. and point it to some /path/to/tmpdir where you have confirmed that the user running the script has permissions to write (and thereby rights to extract the subsonic.war file, which happens to be a zip file).


ok sorry im i little slow, yes it's a shell file, subsonic.sh is located in /usr/share/subsonic/

now i open my ssh connection with putty on windows, i log in as root. so i should have access to all directories. i can also see that the subsonic.deb file is coming from the http://sourceforge.net/projects/subsoni ... 4.7.beta3/, so i would assume it's not corrupt.

Maybe changing the permissions on file:/usr/share/subsonic/subsonic.war!, as this is where the error is. can this be done?
HackitZ
 
Posts: 9
Joined: Sun Aug 26, 2012 1:14 am

Re: Same error as many 503

Postby HackitZ » Sun Aug 26, 2012 11:42 pm

ok i was looking over the files and thought i could just manually extract the subsonic.war file to the proper directory.

so i first thought lets view the archive and ran jar tvf /usr/share/subsonic/subsonic.war

this gives me a -bash: jar: command not found

so i ran java -version

this shows version java version "1.6.0_18"

So im thinking it's a java issue.
HackitZ
 
Posts: 9
Joined: Sun Aug 26, 2012 1:14 am

Re: Same error as many 503

Postby HackitZ » Tue Aug 28, 2012 1:50 am

Thanks for the help hakko.

I resolved the issue with help from you and another user from the omv forum.

it appears it was a java issue.

here's the steps i used to fix the issue.

    service subsonic stop

    removed subsonic with = apt-get purge subsonic, had errors. (directory is full)

    so i ran = rm -r the /var/subsonic directory.

    then ran = apt-get purge openjdk-6-jre, went through the setup.

    Then i ran = rm /omv.sh

    Rebooted, re-ran script.

Thanks again.

I have a quick question about folders, as var is on my system drive and thats a small drive, how do i change the music folder on a different drive?

I tried /dev/sds1/music, but that does not work.
HackitZ
 
Posts: 9
Joined: Sun Aug 26, 2012 1:14 am


Return to Help

Who is online

Users browsing this forum: No registered users and 34 guests