Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Fatal error: DATABASE ERROR: Couldn't run query: SELECT `SiteTree_Draft`

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

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

Page: 1 2
Go to End
Author Topic: 5924 Views
  • billy
    Avatar
    Community Member
    9 Posts

    Fatal error: DATABASE ERROR: Couldn't run query: SELECT `SiteTree_Draft` Link to this post

    Installation is failing for me with the following error:

    Fatal error: DATABASE ERROR: Couldn't run query: SELECT `SiteTree_Draft`.*, `UserDefinedForm_Draft`.*, `SubscribeForm_Draft`.*, `ErrorPage_Draft`.*, `GhostPage_Draft`.*, `RedirectorPage_Draft`.*, `VirtualPage_Draft`.*, `SiteTree_Draft`.ID, if(`SiteTree_Draft`.ClassName,`SiteTree_Draft`.ClassName,'SiteTree') AS RecordClassName FROM `SiteTree_Draft` LEFT JOIN `UserDefinedForm_Draft` ON `UserDefinedForm_Draft`.ID = `SiteTree_Draft`.ID LEFT JOIN `SubscribeForm_Draft` ON `SubscribeForm_Draft`.ID = `SiteTree_Draft`.ID LEFT JOIN `ErrorPage_Draft` ON `ErrorPage_Draft`.ID = `SiteTree_Draft`.ID LEFT JOIN `GhostPage_Draft` ON `GhostPage_Draft`.ID = `SiteTree_Draft`.ID LEFT JOIN `RedirectorPage_Draft` ON `RedirectorPage_Draft`.ID = `SiteTree_Draft`.ID LEFT JOIN `VirtualPage_Draft` ON `VirtualPage_Draft`.ID = `SiteTree_Draft`.ID WHERE (URLSegment = 'home') ORDER BY Sort LIMIT 1

    The reason for the error is pretty straight forward, i.e. the table doesn't exist, so I guess the real problem is 'why isn't the table being created during the installation process?'. One thing I did notice is that the number of tables successfully created prior to this error is exactly 50, but I'm guessing this is simply a coincidence as I can login to the mysql server as the same user and create tables manually.

    Cheers,
    Billy

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Fatal error: DATABASE ERROR: Couldn't run query: SELECT `SiteTree_Draft` Link to this post

    Weird.

    `SiteTree` is supposed to be the draft table, not `SiteTree_draft`.
    `SiteTree_Live` in turn, is the published version of that.

    Which version, 2.0.0 or 2.0.1?

    Cheers,
    Sean

  • billy
    Avatar
    Community Member
    9 Posts
  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Fatal error: DATABASE ERROR: Couldn't run query: SELECT `SiteTree_Draft` Link to this post

    Odd... I did an install just 5 mins ago of 2.0.1 and can't seem to replicate this at all... using MAMP on my Mac...

    Would be good if anyone else out there could produce the same problem, which server specs are you running on?

    Cheers,
    Sean

  • billy
    Avatar
    Community Member
    9 Posts

    Re: Fatal error: DATABASE ERROR: Couldn't run query: SELECT `SiteTree_Draft` Link to this post

    Apache 2.2.3, MySQL 5.0.24a and PHP 5.2.1 running on centOS.

  • Andy
    Avatar
    230 Posts

    Re: Fatal error: DATABASE ERROR: Couldn't run query: SELECT `SiteTree_Draft` Link to this post

    Have you had any earlier SilverStripe installations on this server?

  • billy
    Avatar
    Community Member
    9 Posts

    Re: Fatal error: DATABASE ERROR: Couldn't run query: SELECT `SiteTree_Draft` Link to this post

    Yeah, I did play around with an earlier version actually and I did get a weird caching problem when I tried to install this version, the installation script was trying to include files at the old installation's location. Rebooting apache seemed to fix that problem though and it isn't fixing this one. I've removed and re-made the root directory completely, cleared all the relevant files I could find out of tmp and rebooted apache but it is still happeing.

  • Andy
    Avatar
    230 Posts

    Re: Fatal error: DATABASE ERROR: Couldn't run query: SELECT `SiteTree_Draft` Link to this post

    Try flushing the cache and rebuilding the database, by going to http://www.yoursite.com/db/build?flush=1 .

    5924 Views
Page: 1 2
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.