Bug 244628 - amarok dies on start-up -- can't create its own database
Summary: amarok dies on start-up -- can't create its own database
Status: RESOLVED UPSTREAM
Alias: None
Product: amarok
Classification: Applications
Component: Collections/Local (show other bugs)
Version: 2.3.1
Platform: FreeBSD Ports FreeBSD
: NOR crash
Target Milestone: 2.3.2
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-14 18:37 UTC by mi+kde
Modified: 2010-09-22 23:50 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mi+kde 2010-07-14 18:37:51 UTC
Version:           2.3.1 (using KDE 4.4.4) 
OS:                FreeBSD

This is on FreeBSD-8.1 (pre-release). Amarok is built using FreeBSD's port amarok-kde4 against KDE-4.4.5. The user never ran Amarok before:

s@s:~ (276) amarok
kdeinit4: Shutting down running client.
kdeinit4: preparing to launch /opt/kde4/lib/libkdeinit4_klauncher.so
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
kdeinit4: preparing to launch /opt/kde4/lib/libkdeinit4_kded4.so
KDE Daemon (kded) already running.
kdeinit4: preparing to launch /opt/kde4/lib/libkdeinit4_kbuildsycoca4.so
kbuildsycoca4 running...
InnoDB: The first specified data file /home/s/.kde4/share/apps/amarok/mysqle/ibdata1 did not exist:
InnoDB: a new database to be created!
100712 19:56:48  InnoDB: Setting file /home/s/.kde4/share/apps/amarok/mysqle/ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
100712 19:56:49  InnoDB: Log file /home/s/.kde4/share/apps/amarok/mysqle/ib_logfile0 did not exist: new to be created
InnoDB: Setting log file /home/s/.kde4/share/apps/amarok/mysqle/ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
100712 19:56:49  InnoDB: Log file /home/s/.kde4/share/apps/amarok/mysqle/ib_logfile1 did not exist: new to be created
InnoDB: Setting log file /home/s/.kde4/share/apps/amarok/mysqle/ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
<unknown program name>(45632)/: Communication problem with  "amarok" , it probably crashed.
Error message was:  "org.freedesktop.DBus.Error.ServiceUnknown" : " "The name org.kde.amarok was not provided by any .service files" "

KCrash: Application 'amarok' crashing...
sock_file=/home/s/.kde4/socket-s.local/kdeinit4__0
kdeinit4: preparing to launch /opt/kde4/lib/kde4/libexec/drkonqi
s@s:~ (277) 100712 19:56:51  InnoDB: Error: Write to file /home/s/.kde4/share/apps/amarok/mysqle/ibdata1 failed at offseoffset 0 1048576.
InnoDB: 262144 bytes should have been written, only -1 were written.
InnoDB: Operating system error number 9.
InnoDB: Check that your OS and file system support files of this size.
InnoDB: Check also that the disk is not full or a disk quota exceeded.
InnoDB: Error number 9 means '.....'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.0/en/operating-system-error-codes.html
100712 19:56:51InnoDB: Assertion failure in thread 821375872 in file fil0fil.c line 4023
InnoDB: Failing assertion: ret
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html
InnoDB: about forcing recovery.
Unable to start Dr. Konqi
klauncher: Exiting on signal 15

The folks on kde@FreeBSD.org mailing list advised filing a bug-report... Please, advise. Thanks!

Reproducible: Always

Steps to Reproduce:
Wipe out prior user-specific Amarok configuration (if any) and try starting the 2.3.1 anew.

Subsequent attempts to start Amarok will complain about the DB-file (~/.kde4/share/apps/amarok/mysqle/ibdata1) as well, but removing the file (and the entire mysqle/ subdirectory) does not help at all...
Comment 1 Jeff Mitchell 2010-07-14 19:10:28 UTC
Amarok doesn't actually use InnoDB (because it doesn't handle the index sizes/text types we need). All of the tables are forced to MyISAM in Amarok's code.

However, although we tell MySQL to please not load InnoDB, it usually ignores this and does so anyways. This is normally not a problem, however in this particular user's case it seems like InnoDB is having big problems even simply being initialized. I don't really have any advice for you -- I would suggest asking MySQL folks. Your best bet might actually be #maria on FreeNode; they are generally keen on making the embedded library work.
Comment 2 mi+kde 2010-07-14 20:16:23 UTC
(In reply to comment #1)
> However, although we tell MySQL to please not load InnoDB, it usually ignores
> this and does so anyways. This is normally not a problem, however in this
> particular user's case it seems like InnoDB is having big problems even simply
> being initialized. I don't really have any advice for you -- I would suggest
> asking MySQL folks. Your best bet might actually be #maria on FreeNode; they
> are generally keen on making the embedded library work.

Jeff, I don't think, yours is a fair request. I know nothing about how you use MySQL -- certainly, not enough to file a proper bug-report with MySQL. Someone from the Amarok's team would have to do that -- and then (competently!) reply to MySQL's questions, try their suggestions, etc.

FWIW, the MySQL installed here is of version 5.0.90...
Comment 3 Jeff Mitchell 2010-07-14 21:34:51 UTC
There is no way for me to reply to their requests for information or to try their suggestions, because I'm not the one having the problem, and further I know of no way to reproduce it. Furthermore, I have almost no experience with FreeBSD, and I have no knowledge of how they patch or configure their MySQL or Amarok ports.

If you were to file a bug report with MySQL, you could point them to http://gitweb.kde.org/amarok/amarok.git/blob/HEAD:/src/core-impl/collections/sqlcollection/mysqlecollection/MySqlEmbeddedStorage.cpp and that should have most of the information they would need. You could also CC me on that bug so that if they ask technical questions I can answer them.

You could also try talking to the maintainer of the FreeBSD Amarok port, and see if s/he has the same problems you are having.

You could also take my original suggestion and try talking to people in #maria. If you do so you could pull me in there too (jefferai on FreeNode).

You could also try using the mysql server option instead of the embedded option, and see if that works properly for you.
Comment 4 mi+kde 2010-07-14 22:20:03 UTC
(In reply to comment #3)
> There is no way for me to reply to their requests for information or to try
> their suggestions, because I'm not the one having the problem, and further I
> know of no way to reproduce it.

I think, you can -- and should? -- complain about InnoDB being used despite the application's request for MySAM... From your earlier response, I conclude, that that behavior is both undesirable and reproducible for you...
Comment 5 Jeff Mitchell 2010-07-14 23:37:15 UTC
(In reply to comment #4)
> I think, you can -- and should? -- complain about InnoDB being used despite the
> application's request for MySAM

InnoDB isn't being used, it's being loaded. The engine is being loaded, but the tables Amarok uses are all MyISAM -- MySQL supports having many storage engines loaded at once.

We have filed bug reports with the MySQL guys about it ignoring the options to skip InnoDB, but so far it's not fixed.

> From your earlier response, I conclude, that
> that behavior is both undesirable and reproducible for you...

The engines loading, yes. Your problem, no. I've never seen it before.
Comment 6 Jeff Mitchell 2010-07-19 03:11:35 UTC
Hi there,

I just asked a very knowledgeable MySQL developer who looked at the error. He said that the error code (number 9) is defined as "bad file number" which is something that should never happen. Apparently the error is coming straight from the operating system.

The most likely issues are that your disk is full or that you don't have access to write to that directory. You should check that you do indeed have space on your disk and that you can write a file to that directory.
Comment 7 Jeff Mitchell 2010-08-10 04:12:59 UTC
As another update -- Amarok from Git will no longer load the InnoDB code. But that won't have any bearing on this issue, simply prevent spurious warnings.
Comment 8 mi+kde 2010-08-10 16:56:22 UTC
Uhm, I'm sorry -- what "INFO" is being waited for? I didn't see any questions asked... Please, advise. Thanks!
Comment 9 Myriam Schweingruber 2010-08-10 21:35:37 UTC
(In reply to comment #8)
> Uhm, I'm sorry -- what "INFO" is being waited for? I didn't see any questions
> asked... Please, advise. Thanks!

See comment #6: you should check if your disk is full and if you have all necessary permissions.
Comment 10 mi+kde 2010-08-10 21:40:01 UTC
(In reply to comment #9)
>
> See comment #6: you should check if your disk is full and if you have all
> necessary permissions.

I thought, that was a rhetorical question -- of course, the disk is not full (about 10Gb free) and the permissions are fine too. The directory is under ~/.kde4 -- it was auto-created by KDE and the DB-files do get created in there, Amarok is just unable to use them for some reason. I even mentioned removing them manually for testing...

Please, reopen. Thanks!
Comment 11 Jeff Mitchell 2010-08-10 23:33:31 UTC
Well, there's not much I can do.

We have *lots* of successful FreeBSD users, and the MySQL developer who told me that the error probably meant that the disk was full or permissions were wrong also told me that you should never, ever be seeing that error.

Given the nature of FreeBSD and how its packages are built, it's not impossible that you have broken shared libraries or some other deeper problem.

At this point I can really only suggest what I did in comment #3 -- that you contact the maintainer of the FreeBSD port and ask for his/her help.

Closing as WONTFIX, though if I could I'd really close it as CANTFIX.
Comment 12 Mattia Rossi 2010-09-21 04:34:31 UTC
Well, here is my problem:

It's actually exactly the same, and Error code is 9, and yes - the disk is full.

But wait!

The disk I'm talking about is my 500 MB /tmp partition, which is empty before I startup amarok (2.3.1 btw. - on FreeBSD). 

I have no settings at all - this is a fresh KDE 4.5.1 install. Amarok is used for the first time at all.

Firing amarok up fills 500 MB of /tmp doing what??

And as stated in other bug reports, a full /tmp makes amarok crash.

That's what happens, and I believe it's definitely an amarok problem.

So, please reopen the bug, as it's still valid.
Comment 13 Mattia Rossi 2010-09-21 04:43:52 UTC
Ok.. sorry, not an amarok problem.. the disk full was caused by some weird settings i had, which interestingly got fired up at the same time as amarok, and filled /tmp.

Going to look at mysql/innodb as you suggest.

Sorry again.
Comment 14 Mattia Rossi 2010-09-21 06:54:47 UTC
Ok, I'll put that in here now just for anyone else stumbling across the problem:

I don't know whether it's a freebsd packaging problem or an amarok problem or a mysql problem or any combination of them.

Fact is, amarok does not start-up with mysql 5.0, which is pulled in by default in freebsd. It doesn't work if you compiled amarok with mysql 5.0 installed, but upgraded to 5.1 later, it dows work though if you upgrade mysql to 5.1 and then recompile amarok using mysql 5.1.

Now it could be that amarok itself doesn't work with mysql 5.0 on any platform - in that case, it would be nice to tell the user so.
It could be, that it just won't work on freebsd, so it's a packaging problem.
It could be that I was just lucky to get it running by doing as described..
Comment 15 Myriam Schweingruber 2010-09-21 12:01:16 UTC
Mattia, please do not arbitrarily subscribe people to bug reports, I am subscribed to the amarok bugs digest already, now your are polluting my inbox.
 
Also, the README of Amarok is very clear which MySQL version is required, so please read the informations where those are. Address packaging problems to our distribution, as Jeff already said, it is not something we can do anything about, please read comment #11 again and report this where it belongs.
Comment 16 Jeff Mitchell 2010-09-21 17:14:30 UTC
What Myriam said.

And for the record it's a FreeBSD and/or a *your system* problem.
Comment 17 mi+kde 2010-09-21 17:50:28 UTC
(In reply to comment #16)
> And for the record it's a FreeBSD and/or a *your system* problem.

Sorry, I'm forced to chime in in disagreement. An application dying on start-up is *never* the problem of the Operating System or the particular computer.

Though the developers can't be expected to test every possible OS/hardware combination, once a problem is reported and identified, the application's next release MUST either work around it, or provide a readable explanation of what is wrong.

In this particular case, if the problem is with a particular version/configuration of the MySQL client-library, the (mis)configuration needs to be checked for at start-up and, as a minimum, a readable error message MUST be produced.

Not doing it is a bug -- whether you'll fix it or "WONT".

Now, to Myriam. The comment #15 does not include a link to the "readme" file... But simple web-search brings up Amarok's very own "howto" file

http://amarok.kde.org/wiki/MySQL_HowTo#MySQL_Setup

which states:

<<Amarok 1.4 requires MySQL 4.0 or better, and is known to work with MySQL versions up to 5.0.22 (but, at the time of writing, not 5.0.24). Since Amarok-1.4.2 MySQL-5.0.24 also works. Amarok 1.4.5 work with MySQL 5.0.27>>

The above makes it perfectly reasonable to expect the modern Amarok to work with any MySQL-5.x. If that expectation is incorrect, simply tucking a requirement deep into a readme somewhere is not sufficient -- at the very least, the information needs to be on a web-site and pop-up in search engines. Proper software engineering would require the wrong MySQL to be rejected at configure-time (and re-validated at start-up)...
Comment 18 Jeff Mitchell 2010-09-21 19:04:07 UTC
(In reply to comment #17)
> (In reply to comment #16)
> > And for the record it's a FreeBSD and/or a *your system* problem.
> 
> Sorry, I'm forced to chime in in disagreement. An application dying on start-up
> is *never* the problem of the Operating System or the particular computer.

You're quite wrong. It can be problems with your libraries, your compilation/optimization/linking flags, default settings FreeBSD uses for X or Y, missing shared object dependencies and many, many more things.

> Though the developers can't be expected to test every possible OS/hardware
> combination, once a problem is reported and identified, the application's next
> release MUST either work around it, or provide a readable explanation of what
> is wrong.

The problem is reported but has not been identified.

Actually, if you look at Mattia's comments, you'll see that it was identified, but not as Amarok being at fault.

Furthermore, applications are not bound to you or anyone else to provide a fix or workaround for any bug in its next release. That's at the discretion of the developers. It wouldn't even be possible in this case. In Amarok we do try to take care of bugs as fast as reasonably possible, but the fact is that, like many (most?) other FOSS projects, we have far less manpower than we would like. Knowing that there is a bug doesn't mean we can fix it in the next release. And we're not beholden to anyone to do so.

> In this particular case, if the problem is with a particular
> version/configuration of the MySQL client-library, the (mis)configuration needs
> to be checked for at start-up and, as a minimum, a readable error message MUST
> be produced.

It's not. Amarok works just fine with MySQL 5.0 and 5.1. If there is some combination of 5.0/5.1 for which it doesn't work, I don't know about it.

> Not doing it is a bug -- whether you'll fix it or "WONT".

Actually, the real problem is CANTFIX, but we don't have that option. We don't know why it messes up on your two systems, and there is no identified cause. The only thing in common is that you are both running FreeBSD. Lots of other users run FreeBSD and aren't reporting this problem.

> But simple web-search brings up Amarok's very own "howto" file
> 
> http://amarok.kde.org/wiki/MySQL_HowTo#MySQL_Setup
> 
> which states:
> 
> <<Amarok 1.4 requires MySQL 4.0 or better, and is known to work with MySQL
> versions up to 5.0.22 (but, at the time of writing, not 5.0.24). Since
> Amarok-1.4.2 MySQL-5.0.24 also works. Amarok 1.4.5 work with MySQL 5.0.27>>

You'll notice that the page only talks about Amarok 1.4. It doesn't matter in this case, but Amarok 1 and Amarok 2 are vastly different programs.

> The above makes it perfectly reasonable to expect the modern Amarok to work
> with any MySQL-5.x.

It does.
Comment 19 mi+kde 2010-09-22 06:44:08 UTC
(In reply to comment #18)
> You're quite wrong. It can be problems with your libraries, your
> compilation/optimization/linking flags, default settings FreeBSD uses for X or
> Y, missing shared object dependencies and many, many more things.

Amarok is the only program to -- repeatedly -- fail at start-up and the debug output, however hard it is to sift through, points at a MySQL problem.

And, of course, attempts to single-out FreeBSD are wrong. Here, for example, is a thread discussing *the same* issue on Linux:

http://forum.kde.org/viewtopic.php?f=115&t=83126

and another:

http://forums.gentoo.org/viewtopic-t-797500-start-0.html
 
> Actually, if you look at Mattia's comments, you'll see that it was identified,
> but not as Amarok being at fault.

In my case there was plenty of diskspace, yet the problem was the same.
 
> Furthermore, applications are not bound to you or anyone else to provide a fix
> or workaround for any bug in its next release. That's at the discretion of the
> developers. [...] And we're not beholden to anyone to do so.

"Men have forgotten this truth," said the fox. "But you must not forget it. You become responsible, forever, for what you have tamed. You are responsible for your rose . . ."

http://www.angelfire.com/hi/littleprince/framechapter21.html

> Amarok works just fine with MySQL 5.0 and 5.1. If there is some
> combination of 5.0/5.1 for which it doesn't work, I don't know about it.

Why, then, are the comment #1 (yours!), and comment #15 (Myriam's) state, that the problem is with MySQL? Not "may be" with MySQL, but *is* with MySQL. You stated -- with certainty -- it is a MySQL bug, and Myriam said (just as unequivocally), it is a wrong MySQL version... Both of these earlier comments contradict the above-quoted statement from your most recent comment #18.

Could you, at least, explicitly withdraw the earlier suggestions and just state, that you have no idea, what's wrong?
Comment 20 Jeff Mitchell 2010-09-22 21:02:41 UTC
(In reply to comment #19)
> Amarok is the only program to -- repeatedly -- fail at start-up and the debug
> output, however hard it is to sift through, points at a MySQL problem.

Absolutely. I agree. It's a MySQL problem. Quite possibly with how the embedded library is being built on your system. You may want to try the external database.

> And, of course, attempts to single-out FreeBSD are wrong. Here, for example, is
> a thread discussing *the same* issue on Linux:

It's not the same issue. The fact that the debug output looks similar doesn't mean it's the same problem. Those guys weren't getting error number 9.

Additionally, both of those users were on Gentoo, where they had trouble due to how Gentoo was building the embedded libraries in their MySQL packages. 

So in your example, you have showed a case where you have both singled out a distro (Gentoo) and in which case the problem was, in fact, MySQL and not Amarok.

> > Actually, if you look at Mattia's comments, you'll see that it was identified,
> > but not as Amarok being at fault.
> 
> In my case there was plenty of diskspace, yet the problem was the same.

OK. So you have plenty of diskspace. Again, I fail to see why that means that this is an Amarok issue. Additionally, when I showed your problem to several MySQL developers at OSCON, they told me that something was very messed up with either your system or your MySQL as error 9 should *never* be getting triggered (according to them). This was already relayed to you in comment #6.

> > Amarok works just fine with MySQL 5.0 and 5.1. If there is some
> > combination of 5.0/5.1 for which it doesn't work, I don't know about it.
> 
> Why, then, are the comment #1 (yours!), and comment #15 (Myriam's) state, that
> the problem is with MySQL? Not "may be" with MySQL, but *is* with MySQL. You
> stated -- with certainty -- it is a MySQL bug, and Myriam said (just as
> unequivocally), it is a wrong MySQL version... Both of these earlier comments
> contradict the above-quoted statement from your most recent comment #18.
> 
> Could you, at least, explicitly withdraw the earlier suggestions and just
> state, that you have no idea, what's wrong?

There's nothing for me to withdraw. I said that it was a problem with MySQL. I have maintained that throughout this entire bug report.

Myriam's suggestion about MySQL version was just that -- a suggestion for you to make sure that you are using the appropriate versions. The fact that you are using a version of MySQL that Amarok is known to work with doesn't mean that therefore any MySQL problems are somehow Amarok's.

I've already given you several suggestions as to where you could turn for help: #mysql or especially #maria on FreeNode, your distribution packager/help lists/help forums, etc. You've ignored all this in favor of insisting, with no evidence of any sort, that it is in fact a problem with Amarok. At this point, however, there is nothing more that I can -- or, due to your antagonistic, attack-driven attitude, want to -- do for you.

Seek help elsewhere.
Comment 21 mi+kde 2010-09-22 21:46:40 UTC
Coment #18 (by Jeff Mitchell):
> Amarok works just fine with MySQL 5.0 and 5.1.

Comment #20 (by Jeff Mitchell):
> I said that it was a problem with MySQL.

If you don't see the illogic in the above, then, indeed, one should not be surprised about the quality of software you are involved in... (How is *this* for "antagonistic attidue"?)
Comment 22 Jeff Mitchell 2010-09-22 23:50:04 UTC
(In reply to comment #21)
> Coment #18 (by Jeff Mitchell):
> > Amarok works just fine with MySQL 5.0 and 5.1.
> 
> Comment #20 (by Jeff Mitchell):
> > I said that it was a problem with MySQL.
> 
> If you don't see the illogic in the above

Since you're cherry-picking lines without context, of course you don't have the context of Amarok works just fine with MySQL 5.0 and 5.1 *in general* and it's a problem with *your* MySQL installation.

Although even without that clarification, the statements above still hold up on its own. The fact that Amarok works with MySQL 5.0 and 5.1 doesn't mean that MySQL is bug-free.

> , then, indeed, one should not be
> surprised about the quality of software you are involved in... (How is *this*
> for "antagonistic attidue"?)

Indeed it is.