Jump to:

4876 Posts in 6997 Topics by 1473 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » dev/build/flush=1 not working after deploy

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

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

Page: 1
Go to End
Author Topic: 3637 Views
  • Dave L
    Avatar
    Community Member
    56 Posts

    dev/build/flush=1 not working after deploy Link to this post

    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??

  • Dave L
    Avatar
    Community Member
    56 Posts

    Re: dev/build/flush=1 not working after deploy Link to this post

    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

  • elgordo
    Avatar
    Community Member
    69 Posts

    Re: dev/build/flush=1 not working after deploy Link to this post

    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

  • Plato
    Avatar
    Community Member
    26 Posts

    Re: dev/build/flush=1 not working after deploy Link to this post

    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).

    3637 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.