PDA

View Full Version : 6.0 svn 2032 - crash on startup unless databasedeleted first



Triode
2005-02-12, 05:56
Hi,

I'm finding with subversion 2032 that unless I delete the database every time before I restart the server, I get the following:

2005-02-12 12:55:54.1570 Adding ITUNES Scan
2005-02-12 12:55:54.1634 loading types config file...
2005-02-12 12:55:54.1721 Tag database support is ON, saving into: /usr/local/slimserver/.slimserversql.db
2005-02-12 12:55:54.1895 Connected to database dbi:SQLite:dbname=/usr/local/slimserver/.slimserversql.db
2005-02-12 12:55:54.2068 database v. 4 requires upgrade to 99999
2005-02-12 12:55:54.2075 Database schema out of date and purge required. Purging db.
2005-02-12 12:55:54.2082 Executing SQL file /usr/local/slimserver/SQL/SQLite/dbdrop.sql
2005-02-12 12:55:54.2089 Executing SQL statement: [DROP TABLE metainformation;]
2005-02-12 12:55:54.2118 Executing SQL statement: [DROP TABLE tracks;]
2005-02-12 12:55:54.2517 Executing SQL statement: [DROP INDEX trackURLIndex;]
DBD::SQLite::db do failed: no such index: trackURLIndex(1) at dbdimp.c line 263 at
/usr/local/slimserver/Slim/DataStores/DBI/DataModel.pm line 67, <$fh> line 23.
2005-02-12 12:55:54.2541 Backtrace:

frame 0: Slim::DataStores::DBI::DataModel::executeSQLFile (/usr/local/slimserver/Slim/DataStores/DBI/DataModel.pm line 142)
frame 1: Slim::DataStores::DBI::DataModel::db_Main (/usr/local/slimserver/Slim/DataStores/DBI/DBIStore.pm line 78)
frame 2: Slim::DataStores::DBI::DBIStore::new (/usr/local/slimserver/Slim/Music/Info.pm line 67)
frame 3: Slim::Music::Info::init (./slimserver.pl line 475)
frame 4: main::start (./slimserver.pl line 502)
frame 5: main::main (./slimserver.pl line 1018)

DBD::SQLite::db do failed: no such index: trackURLIndex(1) at dbdimp.c line 263 at
/usr/local/slimserver/Slim/DataStores/DBI/DataModel.pm line 67, <$fh> line 23.

Adrian

Lars Kellogg-Stedman
2005-02-12, 06:13
> DBD::SQLite::db do failed: no such index: trackURLIndex(1) at dbdimp.c line
> 263 at
> /usr/local/slimserver/Slim/DataStores/DBI/DataModel.pm line 67, <$fh> line
> 23.

Same here (rev 2032).

Dan Sully
2005-02-12, 10:35
* Triode shaped the electrons to say...

>I'm finding with subversion 2032 that unless I delete the database every
>time before I restart the server, I get the following:

Ok - I believe this one is fixed now. There were some bogus DROP INDEX in the
dbdrop.sql script from 3 months ago.


-D
--
You know, for kids.

Caleb Epstein
2005-02-12, 11:12
On Sat, Feb 12, 2005 at 09:35:29AM -0800, Dan Sully wrote:

> * Triode shaped the electrons to say...
>
> >I'm finding with subversion 2032 that unless I delete the database every
> >time before I restart the server, I get the following:
>
> Ok - I believe this one is fixed now. There were some bogus DROP
> INDEX in the dbdrop.sql script from 3 months ago.

Nope. At least not with MYSQL and Rev 2034:

DBD::mysql::db do failed: Cannot delete or update a parent row: a foreign key constraint fails at /data/home/slimserver/Slim/DataStores/DBI/DataModel.pm line 67, <$fh> line 17.
2005-02-12 13:00:16.4353 Backtrace:

frame 0: Slim::DataStores::DBI::DataModel::executeSQLFile (/data/home/slimserver/Slim/DataStores/DBI/DataModel.pm line 142)
frame 1: Slim::DataStores::DBI::DataModel::db_Main (/data/home/slimserver/Slim/DataStores/DBI/DBIStore.pm line 78)
frame 2: Slim::DataStores::DBI::DBIStore::new (/data/home/slimserver/Slim/Music/Info.pm line 67)
frame 3: Slim::Music::Info::init (/home/slimserver/slimserver.pl line 475)
frame 4: main::start (/home/slimserver/slimserver.pl line 502)
frame 5: main::main (/home/slimserver/slimserver.pl line 1018)

DBD::mysql::db do failed: Cannot delete or update a parent row: a foreign key constraint fails at /data/home/slimserver/Slim/DataStores/DBI/DataModel.pm line 67, <$fh> line 17.

And from mysql.log:

050212 13:00:16 29 Query SET AUTOCOMMIT=0
29 Query SHOW TABLES
29 Query SELECT version FROM metainformation
29 Query DROP TABLE metainformation
29 Query DROP TABLE tracks
29 Query ROLLBACK
29 Quit

--
Caleb Epstein | bklyn . org |
cae at | Brooklyn Dust | You are magnetic in your bearing.
bklyn dot org | Bunny Mfg. |

Dan Sully
2005-02-12, 11:16
* Caleb Epstein shaped the electrons to say...

>> Ok - I believe this one is fixed now. There were some bogus DROP
>> INDEX in the dbdrop.sql script from 3 months ago.
>
> Nope. At least not with MYSQL and Rev 2034:
>
>DBD::mysql::db do failed: Cannot delete or update a parent row: a foreign key constraint fails at /data/home/slimserver/Slim/DataStores/DBI/DataModel.pm line 67, <$fh> line 17.
>2005-02-12 13:00:16.4353 Backtrace:

Can you add:

SET foreign_key_checks = 0;

To the top of SQL/mysql/dbdrop.sql ?

-D
--
<iNoah> I think someone should create a magazine for computer peripherals, called Card & Driver

Dan Sully
2005-02-12, 11:32
* Ralph Edington shaped the electrons to say...

> FYI, I'm seeing the same crash-on-restart-unless-DB-is-deleted problem.
> Adding the foreign_key_checks line didn't help. I'm running last night's
> Windows Executable build.

The foreign_key_checks is only for MySQL

I've made some changes since last night's build.

> "The description for Event ID ( 0 ) in Source ( Application ) cannot be
> "found. The local computer may not have the necessary registry information
> "or message DLL files to display messages from a remote computer. You may
> "be able to use the /AUXSOURCE= flag to retrieve this description; see Help
> "and Support for details. The following information is part of the event:
> "DBD::SQLite::db do failed: no such index: trackURLIndex(1) at dbdimp.c
> "line 263 at /PerlApp/Slim/DataStores/DBI/DataModel.pm line 67, <$fh> line
> "23.

You should either sync with the Subversion tree, or remove the 3 "DROP INDEX"
lines from SQL/SQLite/dbdrop.sql

-D
--
<noah> I'm partial to lipstick lesbians, I guess, but I suppose that's
a little like saying you're partial to blue when you're blind.

Dan Sully
2005-02-12, 11:37
* Ralph Edington shaped the electrons to say...

> Stupid question: How do I know whether I'm running mysql or sqllite? Why
> are there two flavors of sql? Is one for Windows and one for everything
> else or somethign?

From the error log:

>> > "DBD::SQLite::db do failed: no such index: trackURLIndex(1) at dbdimp.c
>> > "line 263 at /PerlApp/Slim/DataStores/DBI/DataModel.pm line 67,

SlimServer 6.0 by default will always use SQLite, as we ship the server with it.

Some people want to use MySQL, and we allow them to do that, though don't officially support it.

-D
--
<noah> I'm partial to lipstick lesbians, I guess, but I suppose that's
a little like saying you're partial to blue when you're blind.

Dan Sully
2005-02-12, 11:57
* Ralph Edington shaped the electrons to say...

> I removed the three lines, now a restart generates the following:
>
> "The description for Event ID ( 0 ) in Source ( Application ) cannot be
> "found. The local computer may not have the necessary registry information
> "or message DLL files to display messages from a remote computer. You may
> "be able to use the /AUXSOURCE= flag to retrieve this description; see Help
> "and Support for details. The following information is part of the event:
> "DBD::SQLite::db do failed: table dirlist_track already exists(1) at
> "dbdimp.c line 263 at /PerlApp/Slim/DataStores/DBI/DataModel.pm line 67,
> "<$fh> line 158.

Now add the line to SQLite/dbdrop.sql

DROP TABLE dirlist_track;

I'll have a checkin shortly.

-D
--
Ya gotta love UNIX, where else do you wonder whether
you can kill a zombie spawned by a daemon's fork?

Dan Sully
2005-02-12, 12:09
* Ralph Edington shaped the electrons to say...

>I think I'll go take two 5.4.1's and call you in the morning...

I'm sorry Ralph - but we just did a large merge from the import branch last
night, and there were a bunch of additional changes as well.

It's best for 6.0 if you are in sync with Subversion right now.

-D
--
<noah> I'm partial to lipstick lesbians, I guess, but I suppose that's
a little like saying you're partial to blue when you're blind.

Dan Sully
2005-02-12, 12:14
* Ralph Edington shaped the electrons to say...

> FYI One other small gotcha for alpha testers: "rolling back" from 2-12 v6
> nightly to 2-12 v5.4.1 nightly gives following error:
>
> Undefined subroutine &Plugins::MusicMagic::Plugin::getFunctions called at
> /PerlApp/Slim/Buttons/Plugins.pm line 338, <DATA> line 1.

kdf - any ideas?

-D
--
<noah> I'm partial to lipstick lesbians, I guess, but I suppose that's
a little like saying you're partial to blue when you're blind.

Caleb Epstein
2005-02-12, 12:56
On Sat, Feb 12, 2005 at 10:16:25AM -0800, Dan Sully wrote:

> * Caleb Epstein shaped the electrons to say... >>Ok - I believe
> this one is fixed now. There were some bogus DROP >>INDEX in the
> dbdrop.sql script from 3 months ago. > > Nope. At least not with
> MYSQL and Rev 2034: > >DBD::mysql::db do failed: Cannot delete or
> update a parent row: a foreign >key constraint fails at
> >/data/home/slimserver/Slim/DataStores/DBI/DataModel.pm line 67,
> <$fh> line >17. >2005-02-12 13:00:16.4353 Backtrace: Can you add:
> SET foreign_key_checks = 0; To the top of SQL/mysql/dbdrop.sql ?

OK, now with version 2040 the server dies with:

2005-02-12 14:45:58.1639 Executing SQL statement: [CREATE TABLE pluginversion (id int(10) unsigned NOT NULL auto_increment,name varchar(255),version int(10) unsigned,PRIMARY KEY (id)) TYPE=InnoDB;]
DBD::mysql::db do failed: Table 'pluginversion' already exists at /data/home/slimserver/Slim/DataStores/DBI/DataModel.pm line 67, <$fh> line 198.

So "DROP TABLE pluginversion" should to be added to dbdrop.sql.

If I try restarting after this, I get:

2005-02-12 14:53:27.0738 Executing SQL statement: [SET foreign_key_checks = 0;]
2005-02-12 14:53:27.1040 Executing SQL statement: [CREATE TABLE metainformation (version int(10) unsigned,track_count int(10) unsigned,total_time int(10) unsigned) TYPE=InnoDB;]
DBD::mysql::db do failed: Table 'metainformation' already exists at /data/home/slimserver/Slim/DataStores/DBI/DataModel.pm line 67, <$fh> line 198.
DBD::mysql::db do failed: Table 'metainformation' already exists at /data/home/slimserver/Slim/DataStores/DBI/DataModel.pm line 67, <$fh> line 198.

AAARGH! Yet another cycle of "mysqladmin drop" & create
required.

BTW, why not just use the "mysqldump" command and
have a single file that contains all of the commands so
they don't get out of sync? They look like:

DROP TABLE IF EXISTS `whatever`;
CREATE TABLE `whatever` ...

--
Caleb Epstein | bklyn . org |
cae at | Brooklyn Dust |Mistrust first impulses; they are always right.
bklyn dot org | Bunny Mfg. |

kdf
2005-02-12, 14:10
Quoting Dan Sully <dan (AT) slimdevices (DOT) com>:

> * Ralph Edington shaped the electrons to say...
>
> > FYI One other small gotcha for alpha testers: "rolling back" from 2-12 v6
> > nightly to 2-12 v5.4.1 nightly gives following error:
> >
> > Undefined subroutine &Plugins::MusicMagic::Plugin::getFunctions called at
> > /PerlApp/Slim/Buttons/Plugins.pm line 338, <DATA> line 1.
>
> kdf - any ideas?

yup....dont do that ;)

The installs dont erase plugins as that would REALLY upset the users who have a
large number installed. The import plugins do not establish modes so they dont
have certain features that the older API required (without the safe tests we
use on every other option thing).

One fix would be to place dummy stubs in the new plugins.

-kdf