Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running /dev/build #26

Closed
abitran opened this issue Nov 5, 2014 · 9 comments
Closed

Error when running /dev/build #26

abitran opened this issue Nov 5, 2014 · 9 comments

Comments

@abitran
Copy link

abitran commented Nov 5, 2014

After updating my google-analytics module with composer, I get the following error when running /dev/build:

Couldn't run query: SELECT DISTINCT "SiteConfig"."ClassName", "SiteConfig"."Created", "SiteConfig"."LastEdited", "SiteConfig"."Title", "SiteConfig"."Tagline", "SiteConfig"."Theme", "SiteConfig"."CanViewType", "SiteConfig"."CanEditType", "SiteConfig"."CanCreateTopLevelType", "SiteConfig"."Locale", "SiteConfig"."GoogleAnalyticsCode", "SiteConfig"."GoogleAnalyticsProfileId", "SiteConfig"."GoogleAnalyticsEmail", "SiteConfig"."GoogleAnalyticsPassword", "SiteConfig"."UseGoogleUniversalSnippet", "SiteConfig"."GlobalUnsubscribe", "SiteConfig"."ID", CASE WHEN "SiteConfig"."ClassName" IS NOT NULL THEN "SiteConfig"."ClassName" ELSE 'SiteConfig' END AS "RecordClassName" FROM "SiteConfig" WHERE ("SiteConfig"."Locale" = 'en_US') LIMIT 1 Unknown column 'SiteConfig.UseGoogleUniversalSnippet' in 'field list'

SS 3.1.x-dev

@wilr
Copy link
Member

wilr commented Nov 6, 2014

SilverStripe is querying SiteConfig as part of the build process. You'll need to put the website into 'dev' mode and then rebuild your database so it doesn't check site config or use the CLI wrapper.

@wilr wilr closed this as completed Nov 6, 2014
@abitran
Copy link
Author

abitran commented Nov 7, 2014

But my website is already in dev mode:
/* What kind of environment is this: development, test, or live (ie, production)? */
define('SS_ENVIRONMENT_TYPE', 'dev');

/AB

@wilr
Copy link
Member

wilr commented Nov 7, 2014

Then I would try use the cli version (sake dev/build) or go into your database and drop the entire siteconfig table and rebuild from scratch. Please use the forum or IRC issue for support questions.

@abitran
Copy link
Author

abitran commented Nov 7, 2014

I'm always on IRC :) thanks wilr! will try the cli version.

abitran

@abitran
Copy link
Author

abitran commented Nov 7, 2014

Ok.. I tried sake, without success, then I drop the SiteConfig table with the googleanalytics module installed and was impossible to recreate the SiteConfig table. Then I erased the googleanalytics folder and edit _config.php, rerun /dev/build and the SiteConfig table was created. Again I tried with the googleanalytics module, and after running /dev/build, the same error:
Unknown column 'SiteConfig.GoogleAnalyticsCode' in 'field list'

abitran

@silverstripesk
Copy link

hi guys, why is this issue closed? Error is still there. SS 3.1.5 dev/build works fine, latest SS produces this error...

@wilr
Copy link
Member

wilr commented Dec 4, 2014

This is closed because the module cannot do anything about it. It's a SilverStripe limitation that querying the SiteConfig / Member tables while doing migrations need to either be done in dev or cli modes. Not the modules responsibility.

@silverstripesk
Copy link

Of course, I tried it in DEV mode via URL and with sake also, but no success.
How to reproduce it? Install clean SS 3.1.5 with your module, after switch to latest SS version. DEV/BUILD is impossible even using sake...

@laminbarrow
Copy link

I have had a similar issue today and in the end, i found out that i have some code that was extending the "Controller" class and in it, i have some code that was referring "SiteConfig" in the "afterInit" method . The controller class get called in the dev/build process and at that point your siteconfig dataextension tables have not been created yet.

TO fix it, i simply change my code to extend "ContentController" instead of the base "Controller" and the issue was solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants