Bug 10137 - Squeezecenter won't start - ReadyNas Pro (probably database)
: Squeezecenter won't start - ReadyNas Pro (probably database)
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Database
: 7.3.0
: Infrant ReadyNAS Other
: P1 critical with 1 vote (vote)
: 7.x
Assigned To: Spies Steven
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-25 12:02 UTC by Emmanuele Patti
Modified: 2009-07-31 10:32 UTC (History)
4 users (show)

See Also:
Category: ---


Attachments
logfile (169.66 KB, text/plain)
2008-11-25 12:02 UTC, Emmanuele Patti
Details
Log of SqueezeCenter failing to start on ReayNAS Pro (26.28 KB, text/plain)
2008-11-25 15:29 UTC, Spies Steven
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Emmanuele Patti 2008-11-25 12:02:40 UTC
Created attachment 4339 [details]
logfile

Tried to install the ReadyNas Pro build of SC. It works until I've restarted it - then it is unreachable.

To remedy this I did a factory reset of my ReadyNas - so it was totally clean, then I reinstalled SC. Same problem again.

Could you guys look into it? Seems like a corruption of the database. Attaching slimserver.log
Comment 1 James Richardson 2008-11-25 14:11:00 UTC
Emmanuele: please don't set priority or severity, that will be done during bug review.

Matt: can you look into this
Comment 2 Matt Wise 2008-11-25 14:47:56 UTC
James,
  Please have QA verify this ... QA has the only ReadyNas pro available for testing. 
Comment 3 Spies Steven 2008-11-25 15:29:18 UTC
Created attachment 4346 [details]
Log of SqueezeCenter failing to start on ReayNAS Pro

I see the same behavior that Emmanuele reports .  In addition uninstalling SqueezeCenter by clicking the remove button on the ReadyNAS interface and then installing again using the ReadyNAS system update did not get around the issue either.

I was also wondering if the ReadyNAS folks were planing on updating their CleanSqueezeCenter add-on for the Pro.
Comment 4 Spies Steven 2008-11-25 15:36:38 UTC
Matt, is this one for you?
Comment 5 Matt Wise 2008-11-25 16:00:17 UTC
Justin,
  Can you look into this? 
Comment 6 Blackketter Dean 2008-11-25 20:46:45 UTC
this is not a 7.3 blocker, but does prevent us from releasing a final 7.3 build for the ReadyNAS Pro platform.

Justin?
Comment 7 Emmanuele Patti 2008-11-26 00:23:05 UTC
Hi!
Sorry for setting severety etc. - thought i was supposed to :)

However, there are more people having these problems (just FYI):

http://www.readynas.com/forum/viewtopic.php?f=22&t=22209
http://www.readynas.com/forum/viewtopic.php?f=22&t=23259
Comment 8 Justin Maggard 2008-11-26 13:04:19 UTC
Looks like MySQLHelper.pm is finding the mysqld in /usr/share/squeezecenter/Bin/i386-linux/ and using that instead of the one that's already on the system.  The 7.3 addon worked fine on my box once I removed that file.  Can somebody check that?
Comment 9 Emmanuele Patti 2008-11-26 14:53:08 UTC
Removed the mysqld that you are mentioninh, but still same problem.
Comment 10 Justin Maggard 2008-11-26 15:07:36 UTC
Can you try installing the addon at http://www.readynas.com/download/addons/x86/4.2/Clean_SqueezeCenter_DB_1.0-x86.bin ?
Comment 11 Emmanuele Patti 2008-11-26 18:54:53 UTC
Yay!

Heres some love to you guys, FINALLY it works. I'll get back about its stability - but so far, so good!

I just have to add that I really admire all the work and dedication you guys put into the products - CREDS!
Comment 12 Emmanuele Patti 2008-11-27 06:18:10 UTC
Clean squeezecenter addon solves the problem - but after I provoced the database a bit by rescanning it a couple of times it got corrupted again. Fixed by the add-on again though.
Comment 13 James Richardson 2008-12-01 09:45:58 UTC
Justin: what is the proper thing to do here to fix the root cause of the issue?

It appears there is a difference in the mysql.helper file between RN install and SC installs.
Comment 14 Justin Maggard 2008-12-01 10:43:44 UTC
All the helper does is start mysql if it isn't already running, correct??  The difference shouldn't cause any problems once it does its job.
Comment 15 Michael Herger 2008-12-01 10:46:46 UTC
I don't see why you would need that file at all. 

It's based on some very old code. I'd just want to be sure we don't see these issues due to the outdated file.
Comment 16 Justin Maggard 2008-12-01 11:12:31 UTC
It's still needed to dynamically start mysql when it's not running.  I modified it quite some time ago to use the system's mysqld instead of SqueezeCenter's (actually SlimServer at the time) version.  I can make the same changes to the current version, but I highly doubt that will fix anything.  Is this reproducible for everyone?  I don't the same problem here on my Pro.
Comment 17 Michael Herger 2008-12-01 11:39:58 UTC
Whether this issue is related to MySQLHelper or not - we don't know yet. But we shouldn't need it. One potential conflict less to care about.

Do you have an idea what's causing the issues "fixed" by the cleanup script?
Comment 18 Justin Maggard 2008-12-01 13:03:27 UTC
But we *do* need MySQLHelper.  As I said before, we need it to start mysqld dynamically.

I haven't seen the same problem on my system, but from the logs out there, there seems to be a problem in SqueezeCenter DB migration path.  Maybe it doesn't expect a table to be there, but it already is there for some reason??  I really don't know.  Below is the relevant log entry.

[08-11-25 15:00:03.6505] DBIx::Migration::migrate (115) Warning: Database error: Can't create table './slimserver/metainformation.frm' (errno: 121) at /usr/share/squeezecenter/CPAN/DBIx/Migration.pm line 115.
Comment 19 Michael Herger 2008-12-01 13:46:37 UTC
> But we *do* need MySQLHelper.

Of course. But you shouldn't need a customized version of it. 

> I haven't seen the same problem on my system, but from the logs out there,
> there seems to be a problem in SqueezeCenter DB migration path.  Maybe it

The customized MySQLHelper version you're using is using incorrect API calls in the code handling table creation. Maybe it's unrelated, but keeping that changed and broken file around seems like a good source for such issues.
Comment 20 Michael Herger 2008-12-02 10:52:07 UTC
As there is yet another request about ReadyNAS issues in the forums, I took a closer look at the log snippets. (http://forums.slimdevices.com/showthread.php?t=55824)

[08-11-25 19:49:14.1280] Slim::Utils::Misc::msg (1126) Warning: [19:49:14.1277] Use of uninitialized value in sprintf at /usr/share/perl5/Slim/Utils/MySQLHelper.pm line 354.

That line is indeed using some property which is _not_ initialized in your customized MySQLHelper.pm file. The init() has been stripped down to a bare minimum, leaving behind a few uninitialized variables. As they are used in other parts of the module, trouble must be expected.

Matt - could we try to build a ReadyNAS package using our standard MySQLHelper.pm file? The modified version has not been updated in almost a year, and there obviously are bugs in there which can crash SC. Whatever change was needed should now be done in OS/ReadyNAS.pm. I'll be happy to help re-factor even MySQLHelper.pm to support this. 
Comment 21 Matt Wise 2008-12-02 10:55:58 UTC
I've tried to get it working with our mysqlhelper and it fails ... It shouldn't be hard for QA to give you access to our ReadyNas Pro and you can try swapping in the stock mysqlhelper and making the changes that are necessary. I'd actually love to see the changes put into the OSDetect code so that we no longer have to replace the mysqlhelper script... 
Comment 22 Michael Herger 2008-12-02 14:53:02 UTC
Justin - is your ReadyNAS running MySQL for some other application too? From what I understand MySQLHelper.pm can't start it if it's not running yet.

I'm working on a patch for 7.3 which should render the custom MySQLHelper.pm obsolete. Hope to have it ready later this afternoon.
Comment 23 Michael Herger 2008-12-02 15:48:46 UTC
change 24185 - make our MySQLHelper.pm compatible with ReadyNAS. It now uses the OSDetect code to initialize mysql the way it was doing it in the custom file used so far.

Justin - could you please test this change and include it with your builds if it's ok? Thanks!
Comment 24 Justin Maggard 2008-12-03 17:17:29 UTC
For the most part it looks good to me with 7.3-24187, except that it's still using /usr/share/squeezecenter/Bin/i386-linux/mysqld first if it finds it, and it is currently being included with the ReadyNAS package.  So we can either change the build script to remove mysqld from the ReadyNAS package, or add something like this to ReadyNAS.pm to force it to use the system's mysqld:

sub decodeExternalHelperPath {
	if ($_[1] =~ '/mysqld') {
		return "/usr/sbin/mysqld";
	}
	else {
		return Slim::Utils::Unicode::utf8decode_locale($_[1]);
	}
}
Comment 25 Michael Herger 2008-12-04 13:21:59 UTC
change 24204 - remove mysqld binary from the readynas builds
Comment 26 Blackketter Dean 2008-12-05 15:48:36 UTC
Justin/Michael/Steven/Matt: Is this resolved?
Comment 27 Justin Maggard 2008-12-05 16:02:21 UTC
I can't really say since I never saw the issue.  Can we get Emmanuele to try out the latest package?
Comment 28 Emmanuele Patti 2008-12-06 00:44:54 UTC
I'll try it immediately.
Comment 29 Michael Herger 2008-12-08 07:25:40 UTC
Any news?
Comment 30 James Richardson 2008-12-08 09:46:10 UTC
Marking this one as fixed, QA and Emmanuele to verify
Comment 31 Emmanuele Patti 2008-12-08 19:19:26 UTC
Tried to provoke it for a couple of days now - so far, so good. Well done guys!
Comment 32 Spies Steven 2008-12-09 09:14:42 UTC
Looks good to me as well.  Marking bug as verified fixed.
Comment 33 Emmanuele Patti 2008-12-12 04:25:35 UTC
Sorry - but it has crashed again. 

Upgraded to 7.3 today and now the problem is back again.  Is the bugfix really included in the official 7.3?
Comment 34 Emmanuele Patti 2008-12-12 04:27:30 UTC
Some info from the log.


2008-12-12 13:21:30 SqueezeCenter died. Restarting.
[08-12-12 13:21:31.6321] Slim::Schema::init (153) Warning: Creating new database - empty database or database from 6.3.x found
[08-12-12 13:21:31.6967] DBIx::Migration::migrate (115) Warning: Database error: Can't create table './slimserver/metainformation.frm' (errno: 121) at /usr/share/squeezecenter/CPAN/DBIx/Migration.pm line 115.
[08-12-12 13:21:31.6972] Slim::Schema::forceCommit (1481) Warning: Trying to commit transactions before DB is initialized!
Comment 35 Spies Steven 2008-12-12 08:32:09 UTC
Emmanuele, I am not seeing this issue on the ReadyNAS Pro here in the office with the 7.3 release.  Do you have any idea what may have triggered the crash?  Did SqueezeCenter recover after the crash?
Comment 36 Emmanuele Patti 2008-12-12 12:51:49 UTC
Hmmm - I did an uninstallation of the latest beta and installed the released 7.3.

I cleaned the database with the addon from Netgear and after that it restarted.

Let's give it some days - I'll get back to you on the issue.
Comment 37 Spies Steven 2008-12-22 13:31:06 UTC
7.3.1 release is now available and contains ReadyNAS specific fixes.

Please download the new version from
http://www.slimdevices.com/su_downloads.html if you haven't already.  

If you are still experiencing this problem, feel free to reopen the bug with
your new comments and we'll have another look.
Comment 38 Chris Owens 2009-07-31 10:32:35 UTC
Reduce number of active targets for SC