uploading of files through subsonic never completes

Need help? Post your questions here.

Moderator: moderators

uploading of files through subsonic never completes

Postby trinitymusic » Thu Dec 16, 2010 7:51 pm

Currently running subsonic on my qnap nas through tomcat. When I try to upload zip files / mp3 through subsonic I receive the following error

Uploading file

Uploading failed with the following error:
"Processing of multipart/form-data request failed. No space left on device"

There is plenty of physical diskspace, but maybe this is related to memory? Is there a way to change the settings to fix this? Help!

Mike
trinitymusic
 
Posts: 14
Joined: Wed Dec 01, 2010 6:10 am

Postby stozher » Thu Dec 16, 2010 8:16 pm

User avatar
stozher
 
Posts: 313
Joined: Tue Nov 16, 2010 10:56 am
Location: Sofia, Bulgaria

Postby trinitymusic » Fri Dec 17, 2010 8:11 am

How do I bring up the terminal to enter those commands on tomcat?
trinitymusic
 
Posts: 14
Joined: Wed Dec 01, 2010 6:10 am

Postby stozher » Fri Dec 17, 2010 10:38 am

Download file from NAS, edit with plain text editor (notepad) and reupload...

I'm not sure about installation on NAS but see also for subsonic.sh or subsonic.bat files. Properties for memory also found in this files.
User avatar
stozher
 
Posts: 313
Joined: Tue Nov 16, 2010 10:56 am
Location: Sofia, Bulgaria

Postby trinitymusic » Fri Dec 17, 2010 4:53 pm

Sorry to be annoying, i'm not a techie. I am adding this code to the tomcat.sh file? Is that correct or is it another file?

If it is tomcat.sh, does it matter where I place the code in the file? Thanks again for all your help.
trinitymusic
 
Posts: 14
Joined: Wed Dec 01, 2010 6:10 am

Postby stozher » Fri Dec 17, 2010 8:33 pm

Post your current "tomcat.sh" please...
http://music.stozher.com:8080/login.view?user=guest&password=
User avatar
stozher
 
Posts: 313
Joined: Tue Nov 16, 2010 10:56 am
Location: Sofia, Bulgaria

Postby trinitymusic » Sat Dec 18, 2010 7:04 pm

#!/bin/sh
#
# /etc/init.d/tomcat6 -- startup script for the Tomcat 6 servlet engine
#
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
# Modified for Tomcat by Stefan Gybas <sgybas@debian.org>.
# Modified for Tomcat6 by Thierry Carrez <thierry.carrez@ubuntu.com>.
#
### BEGIN INIT INFO
# Provides: tomcat
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Should-Start: $named
# Should-Stop: $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start Tomcat.
# Description: Start the Tomcat servlet engine.
### END INIT INFO
### Create Subsonic link in /var
cd /var
ln -s /share/MD0_DATA/subsonic /var/subsonic
### End of Subconic link creation


set -e

PATH=/bin:/usr/bin:/sbin:/usr/sbin
NAME=tomcat
DESC="Tomcat servlet engine"
DAEMON=/usr/bin/jsvc
CATALINA_BASE=/usr/local/$NAME
DEFAULT=/etc/default/$NAME
JVM_TMP=/tmp/tomcat-temp
JRE_HOME=/usr/local/jre
QPKG_DIR=""
QPKG_NAME=Tomcat
PUBLIC_SHARE=`/sbin/getcfg SHARE_DEF defPublic -d Public -f /etc/config/def_share.info`


JRE_ENABLED=`/sbin/getcfg JRE Enable -u -d FALSE -f /etc/config/qpkg.conf`
if [ "$JRE_ENABLED" = "TURE" ]; then
echo "Java Runtime Environment needs to be installed and enabled."
exit 1
fi

TOMCAT_USER_EXISTS="`grep -n tomcat /etc/passwd`"
if [ "x${TOMCAT_USER_EXISTS}" = "x" ]; then
/bin/adduser -DH tomcat 1>/dev/null 2>/dev/null
fi

if [ `id -u` -ne 0 ]; then
echo "You need root privileges to run this script"
exit 1
fi

export JAVA_HOME=$JRE_HOME
export JAVA_OPTS="-Xmx256m"

# Determine BASE installation location
find_base(){
publicdir=`/sbin/getcfg $PUBLIC_SHARE path -f /etc/config/smb.conf`
if [ ! -z $publicdir ] && [ -d $publicdir ];then
publicdirp1=`/bin/echo $publicdir | /bin/cut -d "/" -f 2`
publicdirp2=`/bin/echo $publicdir | /bin/cut -d "/" -f 3`
publicdirp3=`/bin/echo $publicdir | /bin/cut -d "/" -f 4`
if [ ! -z $publicdirp1 ] && [ ! -z $publicdirp2 ] && [ ! -z $publicdirp3 ]; then
[ -d "/${publicdirp1}/${publicdirp2}/${PUBLIC_SHARE}" ] && QPKG_BASE="/${publicdirp1}/${publicdirp2}"
fi
fi

# Determine BASE installation location by checking where the Public folder is.
if [ -z $QPKG_BASE ]; then
for datadirtest in /share/HDA_DATA /share/HDB_DATA /share/HDC_DATA /share/HDD_DATA /share/MD0_DATA /share/MD1_DATA; do
[ -d $datadirtest/$PUBLIC_SHARE ] && QPKG_BASE="/${publicdirp1}/${publicdirp2}"
done
fi
if [ -z $QPKG_BASE ] ; then
echo "The Public share not found."
_exit 1
fi

QPKG_DIR="${QPKG_BASE}/.qpkg/${QPKG_NAME}"
}

create_links() {
/bin/echo "Creating sym-links ..."
[ -f /usr/local/tomcat ] || /bin/ln -sf "${QPKG_DIR}/tomcat" /usr/local/
[ -f /etc/tomcat ] || /bin/ln -sf "${QPKG_DIR}/tomcat/conf" /etc/tomcat
[ -f /usr/sbin/start-stop-daemon ] || /bin/ln -sf "${QPKG_DIR}/sbin/start-stop-daemon" /usr/sbin
[ -f /usr/bin/jsvc ] || /bin/ln -sf "${QPKG_DIR}/bin/jsvc" /usr/bin
}

find_base
create_links

# Run Tomcat 6 as this user ID
TOMCAT_USER=tomcat

# Directory for per-instance configuration files and webapps
CATALINA_HOME=/usr/local/tomcat

# Use the Java security manager? (yes/no)
TOMCAT6_SECURITY=no

if [ ! -f "$CATALINA_HOME/bin/bootstrap.jar" ]; then
echo "$NAME is not installed"
exit 1
fi

if [ ! -f "$DAEMON" ]; then
$/bin/echo "missing $DAEMON"
exit 1
fi

POLICY_CACHE="$CATALINA_BASE/work/catalina.policy"

JAVA_OPTS="$JAVA_OPTS -Djava.endorsed.dirs=$CATALINA_HOME/endorsed -Dcatalina.base=$CATALINA_BASE -Dcatalina.home=$CATALINA_HOME -Djava.io.tmpdir=$JVM_TMP"

if [ "$TOMCAT6_SECURITY" = "yes" ]; then
JAVA_OPTS="$JAVA_OPTS -Djava.security.manager -Djava.security.policy=$POLICY_CACHE"
fi

# Set juli LogManager if logging.properties is provided
if [ -r "$CATALINA_BASE"/conf/logging.properties ]; then
JAVA_OPTS="$JAVA_OPTS "-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager" "-Djava.util.logging.config.file="$CATALINA_BASE/conf/logging.properties"
fi

# Define other required variables
CATALINA_PID="/var/run/$NAME.pid"
BOOTSTRAP_CLASS=org.apache.catalina.startup.Bootstrap
JSVC_CLASSPATH="/usr/share/java/commons-daemon.jar:$CATALINA_HOME/bin/bootstrap.jar"


case "$1" in
start)
if [ -z "$JRE_HOME" ]; then
$/bin/echo "no JRE found - please set JRE_HOME"
exit 1
fi

if [ ! -d "$CATALINA_BASE/conf" ]; then
$/bin/echo "invalid CATALINA_BASE: $CATALINA_BASE"
exit 1
fi

/bin/echo "Starting $DESC" "$NAME"
if "${QPKG_DIR}/sbin/start-stop-daemon" --test --start --pidfile "$CATALINA_PID" \
--user $TOMCAT_USER --startas "$JRE_HOME/bin/java" \
/dev/null; then

# Regenerate POLICY_CACHE file
umask 022
echo "// AUTO-GENERATED FILE from /etc/tomcat/policy.d/" \
> "$POLICY_CACHE"
echo "" >> "$POLICY_CACHE"
cat $CATALINA_BASE/conf/policy.d/*.policy \
>> "$POLICY_CACHE"

# Remove / recreate JVM_TMP directory
rm -rf "$JVM_TMP"
mkdir "$JVM_TMP" || {
$/bin/echo "could not create JVM temporary directory"
exit 1
}

chown -R $TOMCAT_USER.$TOMCAT_USER /usr/local/tomcat/*
chown $TOMCAT_USER "$JVM_TMP"
cd "$JVM_TMP"

$DAEMON -user "$TOMCAT_USER" -cp "$JSVC_CLASSPATH" \
-outfile SYSLOG -errfile SYSLOG \
-pidfile "$CATALINA_PID" $JAVA_OPTS "$BOOTSTRAP_CLASS"

sleep 5
if "${QPKG_DIR}/sbin/start-stop-daemon" --test --start --pidfile "$CATALINA_PID" \
--user $TOMCAT_USER --startas "$JRE_HOME/bin/java" \
>/dev/null; then
/bin/echo "...failed"
else
/bin/echo "...successful"
fi
else
/bin/echo "(already running)"
/bin/echo 0
fi
;;
stop)
/bin/echo "Stopping $DESC" "$NAME"
if "${QPKG_DIR}/sbin/start-stop-daemon" --test --start --pidfile "$CATALINA_PID" \
--user "$TOMCAT_USER" --startas "$JRE_HOME/bin/java" \
>/dev/null; then
/bin/echo "(not running)"
else
$DAEMON -cp "$JSVC_CLASSPATH" -pidfile "$CATALINA_PID" \
-stop "$BOOTSTRAP_CLASS"
fi
rm -rf "$JVM_TMP"
/bin/echo 0
;;
status)
if "${QPKG_DIR}/sbin/start-stop-daemon" --test --start --pidfile "$CATALINA_PID" \
--user $TOMCAT_USER --startas "$JRE_HOME/bin/java" \
>/dev/null; then

if [ -f "$CATALINA_PID" ]; then
/bin/echo "$DESC is not running, but pid file exists."
exit 1
else
/bin/echo "$DESC is not running."
exit 3
fi
else
/bin/echo "$DESC is running with pid `cat $CATALINA_PID`"
fi
;;
restart|force-reload)
if "${QPKG_DIR}/sbin/start-stop-daemon" --test --stop --pidfile "$CATALINA_PID" \
--user $TOMCAT_USER --startas "$JRE_HOME/bin/java" \
>/dev/null; then
$0 stop
sleep 1
fi
$0 start
;;
try-restart)
if "${QPKG_DIR}/sbin/start-stop-daemon" --test --start --pidfile "$CATALINA_PID" \
--user $TOMCAT_USER --startas "$JRE_HOME/bin/java" \
>/dev/null; then
$0 start
fi
;;
*)
/bin/echo "Usage: $0 {start|stop|restart|try-restart|force-reload|status}"
exit 1
;;
esac

exit 0
trinitymusic
 
Posts: 14
Joined: Wed Dec 01, 2010 6:10 am

Postby stozher » Sat Dec 18, 2010 7:57 pm

Check with "-Xmx512m"
export JAVA_HOME=$JRE_HOME
export JAVA_OPTS="-Xmx256m"


Check also if uploading directory exist and permissions of this directory...
http://music.stozher.com:8080/login.view?user=guest&password=
User avatar
stozher
 
Posts: 313
Joined: Tue Nov 16, 2010 10:56 am
Location: Sofia, Bulgaria

Postby trinitymusic » Fri Dec 24, 2010 3:11 pm

Much Thanks to Stozher for helping me figure this out! I wouldn't have been able to fix it any other way.

The issue wasn't related to memory, but a space related issue. The java temp folder for tomcat was on the root partition with limited space, thus large files wouldn't upload only small files. I changed the location of the temp file to /share/MD0_DATA/Multimedia/Public in the tomcat.sh and now large file uploading is working!

java.io.IOException: No space left on device

"... uses the /tmp space to store files during the upload. The /tmp directory on our server just filled up which caused this problem."

tomcat.sh (line 36): JVM_TMP=/tmp/tomcat-temp
trinitymusic
 
Posts: 14
Joined: Wed Dec 01, 2010 6:10 am

Postby Exrace » Sat Dec 25, 2010 6:12 am

How is the performance on this device?
Exrace
 
Posts: 218
Joined: Thu Nov 11, 2010 5:02 am


Return to Help

Who is online

Users browsing this forum: No registered users and 10 guests