Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Files and Images admin sections gives a 500 Internal Server Error

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

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

Page: 1
Go to End
Author Topic: 5603 Views
  • darkowl
    Avatar
    Community Member
    12 Posts

    Files and Images admin sections gives a 500 Internal Server Error Link to this post

    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.

  • tutmeister
    Avatar
    Community Member
    1 Post

    Re: Files and Images admin sections gives a 500 Internal Server Error Link to this post

    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.

    5603 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.