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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Installing SilverStripe /

Getting SilverStripe up and running on your computer and on your web server.

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

dev/build/flush=1 not working after deploy


Go to End


4 Posts   5472 Views

Avatar
Dave L

Community Member, 60 Posts

23 September 2009 at 10:18pm

Edited: 23/09/2009 10:19pm

Hi,

I got SS up and running on my dev machine, tagged in SVN and doing automated deploys via Capistrano to my staging machine. I didn't install SS on staging machine at all, just copied files and db over. All was well.

I've now added new code, modules, page types, etc. re-tagged in SVN and redeployed. The Capistrano deploy went fine and the files look ok on the staging end. However, now when I run http://<project>.staging/dev/build/flush=1 to rebuild the db and check my deploy, I get an error:

[23-Sep-2009 10:00:18] Error at var/www/<project>/releases/20090923085107/sapphire/core/model/MySQLDatabase.php line 401: Couldn't run query: 
SELECT `SiteTree`.*, `GhostPage`.*, `Page`.*, `ErrorPage`.*, `RedirectorPage`.*, `VirtualPage`.*, `Article`.*, `Recipe`.*, `SiteTree`.ID, if(`SiteTree`.ClassName,`SiteTree`.ClassName,'SiteTree') AS RecordClassName
FROM `SiteTree`
LEFT JOIN `GhostPage` ON `GhostPage`.ID = `SiteTree`.ID
LEFT JOIN `Page` ON `Page`.ID = `SiteTree`.ID
LEFT JOIN `ErrorPage` ON `ErrorPage`.ID = `SiteTree`.ID
LEFT JOIN `RedirectorPage` ON `RedirectorPage`.ID = `SiteTree`.ID
LEFT JOIN `VirtualPage` ON `VirtualPage`.ID = `SiteTree`.ID
LEFT JOIN `Article` ON `Article`.ID = `SiteTree`.ID
LEFT JOIN `Recipe` ON `Recipe`.ID = `SiteTree`.ID
WHERE (HomepageForDomain REGEXP '(,

^) *<project>\.staging *(,|$)') ORDER BY Sort LIMIT 1 | Table '<project>.Page' doesn't exist (http://<project>.staging/Security/login)

My mysql log shows this:

		     77 Connect     <project>@192.168.1.x on 
		     77 Init DB     <project>
		     77 Query       SHOW TABLES
		     77 Query       SHOW FULL FIELDS IN `Permission`
		     77 Query       SHOW COLLATION LIKE 'utf8_general_ci'
		     77 Query       SHOW FULL FIELDS IN `Member`
		     77 Query       SHOW FULL FIELDS IN `Permission`
		     77 Query       SHOW FULL FIELDS IN `Member`
		     77 Query       SELECT `SiteTree`.*, `GhostPage`.*, `Page`.*, `ErrorPage`.*, `RedirectorPage`.*, `VirtualPage`.*, `Article`.*, `Recipe`.*, `SiteTree`.ID, if(`SiteTree`.ClassName,`SiteTree`.ClassName,'SiteTree') AS RecordClassName FROM `SiteTree` LEFT JOIN `GhostPage` ON `GhostPage`.ID = `SiteTree`.ID LEFT JOIN `Page` ON `Page`.ID = `SiteTree`.ID LEFT JOIN `ErrorPage` ON `ErrorPage`.ID = `SiteTree`.ID LEFT JOIN `RedirectorPage` ON `RedirectorPage`.ID = `SiteTree`.ID LEFT JOIN `VirtualPage` ON `VirtualPage`.ID = `SiteTree`.ID LEFT JOIN `Article` ON `Article`.ID = `SiteTree`.ID LEFT JOIN `Recipe` ON `Recipe`.ID = `SiteTree`.ID WHERE (HomepageForDomain REGEXP '(,|^) *<project>\.staging *(,|$)') ORDER BY Sort LIMIT 1

It's failing because it's calling tables that haven't been built yet. If I copy over my dev db it's all fine.

Any ideas why it's not building the tables??

Avatar
Dave L

Community Member, 60 Posts

23 September 2009 at 10:46pm

Ok, I just figured out I need a live admin session before I run /dev/build. A bit of a trap for newbies like me, since after deploying I cannot log into admin to create a session.

Now I just need to figure out how to create an admin session automatically via Capistrano :)

Avatar
elgordo

Community Member, 70 Posts

10 May 2011 at 10:59pm

You can put the site into dev mode and this bypasses the need to log in - just ran into that problem and resolved it thus :)

Avatar
Plato Creative

Community Member, 26 Posts

19 May 2011 at 2:10pm

if you append ?isDev=1 to the end of your build command (eg /dev/build?flush=all&isDev=1 ) then you'll be prompted via a popup for the admin username and password without needing to log into the admin section.

I find it very handy when I've backed myself into a corner in a similar fashion (site won't load until I build, can't build until I've logged in).