Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Files and Images admin sections gives a 500 Internal Server Error


Go to End


2 Posts   6624 Views

Avatar
darkowl

Community Member, 12 Posts

11 January 2008 at 2:34pm

Edited: 11/01/2008 2:56pm

Hi,

Okay, weird problem time.

A SS site I deployed, working just fine on the dev server, has choked up on a shared server (MediaTemple). Just updated to 2.2.1, and weirdness is happening.

Specifically, the site itself is okay, and the admin section works, EXCEPT for the Files and Images section. This was working once, but now it's broken.

It throws a 500 Internal Server Error - I found where in the Debug.php file and put in its friendly stack trace. Here's the test (domain edited out for safety):

-----
Debug::friendlyError(256,DATABASE ERROR: Couldn't run query: SELECT Name FROM `File` WHERE ParentID = 0 GROUP BY Name HAVING count(*) > 1 | Can't create/write to file '/tmp/#sql_3db3_0.MYI' (Errcode: 17),/[myserver.com]/html/sapphire/core/model/Database.php,397,Array)
line 115 of Debug.php

Debug::fatalHandler(256,DATABASE ERROR: Couldn't run query: SELECT Name FROM `File` WHERE ParentID = 0 GROUP BY Name HAVING count(*) > 1 | Can't create/write to file '/tmp/#sql_3db3_0.MYI' (Errcode: 17),/[myserver.com]/html/sapphire/core/model/Database.php,397,Array)
line 328 of Debug.php

errorHandler(256,DATABASE ERROR: Couldn't run query: SELECT Name FROM `File` WHERE ParentID = 0 GROUP BY Name HAVING count(*) > 1 | Can't create/write to file '/tmp/#sql_3db3_0.MYI' (Errcode: 17),/[myserver.com]/html/sapphire/core/model/Database.php,397,Array)

user_error(DATABASE ERROR: Couldn't run query: SELECT Name FROM `File` WHERE ParentID = 0 GROUP BY Name HAVING count(*) > 1 | Can't create/write to file '/tmp/#sql_3db3_0.MYI' (Errcode: 17),256)
line 397 of Database.php

Database->databaseError(Couldn't run query: SELECT Name FROM `File` WHERE ParentID = 0 GROUP BY Name HAVING count(*) > 1 | Can't create/write to file '/tmp/#sql_3db3_0.MYI' (Errcode: 17),256)
line 106 of MySQLDatabase.php

MySQLDatabase->query(SELECT Name FROM `File` WHERE ParentID = 0 GROUP BY Name HAVING count(*) > 1,256)
line 79 of DB.php

DB::query(SELECT Name FROM `File` WHERE ParentID = 0 GROUP BY Name HAVING count(*) > 1)
line 73 of Folder.php

Folder->syncChildren()
line 211 of File.php

File::sync()
line 78 of AssetAdmin.php

AssetAdmin->index(Array)
line 210 of Controller.php

Controller->run(Array)
line 76 of Director.php

Director::direct(admin/assets/)
line 104 of main.php
-----

I've tried flushing the cache, rebuilding the database, and trying to find where the heck it's trying to write to /tmp/ (which is not available on the shared host, so I'm using the silverstripe-cache folder in the web root).

It's only started happening recently, and I'm not sure why - or how to fix it. All other admin functions are working as expected.

Any ideas, thoughts etc. appreciated. Thanks.

[EDIT]

Okay, seems to be a MySQL infrequent problem. Specifically, here: http://bugs.mysql.com/bug.php?id=9551

My solution, whilst inelegant, was to DROP the File table, and then run a /db/build?flush=1 to recreate it.

Avatar
tutmeister

Community Member, 1 Post

31 May 2008 at 10:00am

Hey, so did this fix your error as I am about to deploy from localhost to Mediatemple's (gs) setup and am a little concerned at the possibility for errors at the later stages of a project I am working on - to the point I might need to move the host if this isn't fixed.