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.

Archive /

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

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

Fatal error: DATABASE ERROR: Couldn't run query: SELECT `SiteTree_Draft`


Go to End
Reply


10 Posts   6144 Views

Avatar
billy

Community Member, 9 Posts

18 April 2007 at 10:44am

Edited: 18/04/2007 10:45am

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

Avatar
Sean

Forum Moderator, 922 Posts

18 April 2007 at 11:43am

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

Avatar
billy

Community Member, 9 Posts

18 April 2007 at 12:17pm

2.0.1

Avatar
Sean

Forum Moderator, 922 Posts

18 April 2007 at 2:44pm

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

Avatar
billy

Community Member, 9 Posts

18 April 2007 at 3:15pm

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

Avatar
Andy

230 Posts

18 April 2007 at 4:10pm

Have you had any earlier SilverStripe installations on this server?

Avatar
billy

Community Member, 9 Posts

19 April 2007 at 8:01am

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.

Avatar
Andy

230 Posts

19 April 2007 at 9:31am

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

Go to Top