PDA

View Full Version : Can't start Slimserver service. Could it be MusicIP?



AndyHennah
2007-08-08, 02:26
Hi all,
I've been trying to set up MusicIP for a while now. It's finally finished analyzing all of my songs (took a couple of weeks, due to slow machine and big collection).
So, I started the headless server (./MusicMagicServer start) on my server. Then I started SlimServer service. Then I enabled MusicMagic in the web UI for slimserver and removed the Music Location field (as it says on the interface). Then I did a complete rescan.
Success! I now have the coverted 'm' on all of my tracks and I spend a happy evening creating mixes using MusicMagic - Great!!
Then slimserver hung - I restarted the service, it started ok.
However, whenever I try to start up the web UI for Slimserver it stops the slimserver service.
I've looked in the error log for slimserver, it says :




2007-08-07 23:17:04.7763 ERROR: DBI Connection failed: DBI connect('hostname=127.0.0.1;port=9092;database=sli mserver','slimserver',...) failed: Can't connect to MySQL server on '127.0.0.1' (111) at /usr/local/slimserver/CPAN/DBIx/Class/Storage/DBI.pm line 652

2007-08-07 23:17:04.7779 ERROR: Backtrace follows:

2007-08-07 23:17:04.7809 Backtrace:

frame 0: Slim::Schema::Storage::throw_exception (/usr/local/slimserver/CPAN/DBIx/Class/Storage/DBI.pm line 658)
frame 1: DBIx::Class::Storage::DBI::_connect (/usr/local/slimserver/CPAN/DBIx/Class/Storage/DBI.pm line 616)
frame 2: DBIx::Class::Storage::DBI::_populate_dbh (/usr/local/slimserver/CPAN/DBIx/Class/Storage/DBI.pm line 543)
frame 3: DBIx::Class::Storage::DBI::ensure_connected (/usr/local/slimserver/Slim/Schema/Storage.pm line 45)
frame 4: (eval) (/usr/local/slimserver/Slim/Schema/Storage.pm line 45)
frame 5: Slim::Schema::Storage::dbh (/usr/local/slimserver/CPAN/DBIx/Class/Storage/DBI.pm line 723)
frame 6: (eval) (/usr/local/slimserver/CPAN/DBIx/Class/Storage/DBI.pm line 722)
frame 7: DBIx::Class::Storage::DBI::txn_rollback (/usr/local/slimserver/CPAN/DBIx/Class/Schema.pm line 507)
frame 8: DBIx::Class::Schema::txn_rollback (/usr/local/slimserver/CPAN/DBIx/Class/Schema.pm line 593)
frame 9: (eval) (/usr/local/slimserver/CPAN/DBIx/Class/Schema.pm line 592)
frame 10: DBIx::Class::Schema::txn_do (/usr/local/slimserver/Slim/Schema.pm line 320)
frame 11: (eval) (/usr/local/slimserver/Slim/Schema.pm line 311)
frame 12: Slim::Schema::wipeDB (/usr/local/slimserver/Slim/Schema.pm line 1300)
frame 13: Slim::Schema::wipeAllData (/usr/local/slimserver/scanner.pl line 140)
frame 14: main::__ANON__ (/usr/local/slimserver/CPAN/DBIx/Class/Schema.pm line 584)
frame 15: (eval) (/usr/local/slimserver/CPAN/DBIx/Class/Schema.pm line 572)
frame 16: DBIx::Class::Schema::txn_do (/usr/local/slimserver/scanner.pl line 140)
frame 17: (eval) (/usr/local/slimserver/scanner.pl line 140)
frame 18: main::main (/usr/local/slimserver/scanner.pl line 306)

2007-08-07 23:17:04.7831 ERROR: Unable to connect to the database - even tried restarting it twice!

2007-08-07 23:17:04.7844 ERROR: Check the event log for errors on Windows. Fatal. Exiting.



So now I'm left with a Slimserver that won't start :-(
My guess is that the database is corrupt, but I have no idea how to rebuild it without the UI. Is it possible to delete the database file? If so, how? Or maybe there's another way of getting it all working again.

I'm running the latest releases of Slimserver and MusicIP.
My server is running Linux, Fedora Core 3.







[Addition of another log file trace]
This trace was also in the log file, a little later on :

2007-08-07 23:49:01.3595 ERROR: DBI Connection failed: DBI connect('hostname=127.0.0.1;port=9092;database=sli mserver:mysql_socket=/usr/local/slimserver/Cache/slimserver-mysql.sock','slimserver',...) failed: Can't connect to MySQL server on '127.0.0.1' (111) at /usr/local/slimserver/CPAN/DBIx/Class/Storage/DBI.pm line 652

2007-08-07 23:49:01.3611 ERROR: Backtrace follows:

2007-08-07 23:49:01.3632 Backtrace:

frame 0: Slim::Schema::Storage::throw_exception (/usr/local/slimserver/CPAN/DBIx/Class/Storage/DBI.pm line 658)
frame 1: DBIx::Class::Storage::DBI::_connect (/usr/local/slimserver/CPAN/DBIx/Class/Storage/DBI.pm line 616)
frame 2: DBIx::Class::Storage::DBI::_populate_dbh (/usr/local/slimserver/CPAN/DBIx/Class/Storage/DBI.pm line 543)
frame 3: DBIx::Class::Storage::DBI::ensure_connected (/usr/local/slimserver/Slim/Schema/Storage.pm line 28)
frame 4: (eval) (/usr/local/slimserver/Slim/Schema/Storage.pm line 28)
frame 5: Slim::Schema::Storage::dbh (/usr/local/slimserver/Slim/Schema.pm line 118)
frame 6: Slim::Schema::init (/usr/local/slimserver/Slim/Music/Info.pm line 71)
frame 7: Slim::Music::Info::init (/usr/local/slimserver/slimserver.pl line 366)
frame 8: main::init (/usr/local/slimserver/slimserver.pl line 443)
frame 9: main::main (/usr/local/slimserver/slimserver.pl line 1069)

2007-08-07 23:49:01.3662 ERROR: Couldn't connect to database! Fatal error: [Transport endpoint is not connected] Exiting!

2007-08-07 23:49:01.3683 Backtrace:

frame 0: Slim::Schema::init (/usr/local/slimserver/Slim/Music/Info.pm line 71)
frame 1: Slim::Music::Info::init (/usr/local/slimserver/slimserver.pl line 366)
frame 2: main::init (/usr/local/slimserver/slimserver.pl line 443)
frame 3: main::main (/usr/local/slimserver/slimserver.pl line 1069)

erland
2007-08-08, 03:27
Are you sure slimserver really restarted correctly, from these messages it looks like it can't connect to the database, probably because the old slimserver mysql instance is still running.

Try to shutdown slimserver and then run:
ps aux|grep slimserver

This will list all slimserver processes that is running after you have shutdown.

If there are some running, kill them with the "kill" command.

Or as an alternative to all this you can just reboot the machine.

Dougal
2007-08-08, 06:13
I am using MusicMagicServer with some success on cc4 and I am using an improvised init script to start it at boot before ss. This at least allows me to use "service MusicMagicServer start|stop|restart".
Also I did not have to remove the entry in the slimserver music location field, so I can still browse the music folder.
MusicMagicServer is still a bit rough, if you start from terminal there is no return message it just locks up and if you close the terminal window it stops! also it doesn't seem to be able to be run as a daemon.
The script is below if it is any use anyone.
Doug.

************************************************** **

#!/bin/sh
#
# Startup script for MusicMagicServer.
#
# chkconfig: 2345 58 40
#
# description: MusicIP server produces song mixes for slimserver.


# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0


RETVAL=0


# See how we were called.
case "$1" in
start)
echo -n $"Starting MusicMagicServer: "
/usr/local/MusicIP/MusicMagicMixer/MusicMagicServer start &
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/MusicMagicServer
;;
stop)
echo -n $"Stopping MusicMagicServer: "
killproc MusicMagicServer
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/MusicMagicServer
;;
status)
status MusicMagicServer
RETVAL=$?
;;
restart)
$0 stop
$0 start
RETVAL=$?
;;
*)
echo "Usage: $prog {start|stop|restart|status}"
exit 1
esac

exit $RETVAL

************************************************** *******************

AndyHennah
2007-08-09, 01:16
Thanks guys.
It looks like I had a corrupt database.
From other posts, I managed to find where the database files were (/usr/local/slimserver/Cache/MySQL/) and I renamed them all.
ib_logfile0
ib_logfile1
ibdata1

After renaming them, I started the slimserver service :
service slimserver start
This time it didn't crash out and it re-created the database and did a full rescan automaically.
It's now up and running - Yay!!

Thanks for the script Doug, I was wondering how to get that working properly. At the moment I've gone for starting MusicMagicServer from a terminal window, but that's really not ideal.

Being a bit of a numpty when it comes to Linux, could you give me some guidance as to where I call the script from during startup so that it start before slimserver?

erland
2007-08-09, 01:50
Being a bit of a numpty when it comes to Linux, could you give me some guidance as to where I call the script from during startup so that it start before slimserver?I think you need to specify which Linux distribution you are using if we shall be able to help you with this.

In Ubuntu the startup script is stored in /etc/init.d and the order they are executed is controlled by links in /etc/rc*.d that points to the init.d directory. There is a help script on Ubuntu for updating these links called update-rc.d.
But this looks different on different Linux distributions, so to get more detailed help we need to know which one you are using.

Dougal
2007-08-09, 12:54
Thanks guys.
It looks like I had a corrupt database.
From other posts, I managed to find where the database files were (/usr/local/slimserver/Cache/MySQL/) and I renamed them all.
ib_logfile0
ib_logfile1
ibdata1

After renaming them, I started the slimserver service :
service slimserver start
This time it didn't crash out and it re-created the database and did a full rescan automaically.
It's now up and running - Yay!!

Thanks for the script Doug, I was wondering how to get that working properly. At the moment I've gone for starting MusicMagicServer from a terminal window, but that's really not ideal.

Being a bit of a numpty when it comes to Linux, could you give me some guidance as to where I call the script from during startup so that it start before slimserver?

The init is for redhat system so should be ok on fc3 just save as txt file, call it MusicMagicServer and edit the path in the file MusicMagicServer to reflect wherever you have it on your system.

As root copy MusicMagicServer to /etc/rc.d/init.d

ensure it is executable.

you now have to make symlink S58MusicMagicServer in rc2.d,rc3.d,rc5.d to start and K40MusicMagicServer in rc0.d,rc6.d to stop, this can be done manually or by using the "chkconfig" tool.

"chkconfig --levels MusicMagicServer 235 on"

"chkconfig --levels MusicMagicServer 06 off"

If it works you should be able to use service MusicMagicServer start|stop|restart|status

admin is done with http://serverip:10002

Doug.

AndyHennah
2007-08-10, 01:06
Thanks Doug, you're a star :-)
I'll give that a go.