core icon indicating copy to clipboard operation
core copied to clipboard

Deploying the starter site removes all existing assets

Open Xander-Steinmann opened this issue 11 years ago • 7 comments

All configuration properties including the database settings can be stored in the com.dotcms.config plugin, as is recommended. This has a downside, since undeploying the plugins and starting dotCMS will cause the starter site to be deployed. This is OK, but what has proven to be quite dangerous (in our case) is that when the starter site is deployed all existing assets are removed. So when you notice the problem during/after startup you can redeploy the plugins to fix dotCMS but your assets will be gone.

Could you guys think of a way to make this more safe? For instance:

  • pause the startup with a warning message
  • move/zip the existing assets somewhere
  • only deploy the starter site when there is no assets folder or nothing in it
  • remove the starter.zip at a certain time

We've had this problem 3 times now therefore we've created this issue. You can easily destroy your PRD environment by running undeploy-plugins + start instead of undeploy-plugins + deploy-plugins + start.

Xander-Steinmann avatar Aug 20 '15 15:08 Xander-Steinmann

There is a configuration variable called STARTERSITE_BUILD that if that is set to false, will prevent the starter from being built.

Secondly, the starter won't build if the /assets/starter.zip is not there (I think). Why not just delete it?

wezell avatar Aug 24 '15 17:08 wezell

The STARTERSITE_BUILD is a property that you'd probably set in the com.dotcms.config plugin, so if you undeploy the plugin you're still in trouble. If removing the starter.zip prevents the assets from being deleted then that's something that we'll start to do. Although I still think that a backup of the assets or something would be better.

Xander-Steinmann avatar Aug 25 '15 06:08 Xander-Steinmann

Hi,

Not sure if this should be another issue. But Setting the STARTERSITE_BUILD=false (followed by a deploy-plugins) and starting the cms throws 500 on all pages (even /admin).

This is from a fresh download of 3.2.4. We need a very thin starter pack without the demo site and assets.

With Error:- 2015-11-13 11:19:36,078 WARN com.dotmarketing.business.web.HostWebAPIImpl - Content Index is fouled up, need to try db: null app_1 | 2015-11-13 11:19:36,081 ERROR com.dotmarketing.portlets.contentlet.business.HostAPIImpl - app_1 | java.lang.NullPointerException app_1 | at com.dotmarketing.portlets.contentlet.business.HostAPIImpl.createDefaultHost(HostAPIImpl.java:727) app_1 | at com.dotmarketing.portlets.contentlet.business.HostAPIImpl.findDefaultHost(HostAPIImpl.java:98) app_1 | at com.dotmarketing.portlets.contentlet.business.HostAPIImpl.resolveHostName(HostAPIImpl.java:141) app_1 | at com.dotmarketing.business.web.HostWebAPIImpl.getCurrentHost(HostWebAPIImpl.java:65) app_1 | at org.apache.jsp.portal._500_jsp._jspService(_500_jsp.java:138) app_1 | at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) app_1 | at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) app_1 | at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:431) app_1 | at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396) app_1 | at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340) app_1 | at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) app_1 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) app_1 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) app_1 | at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:721) app_1 | at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:468) app_1 | at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:391) app_1 | at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:318) app_1 | at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:439) app_1 | at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:305) app_1 | at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:399) app_1 | at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) app_1 | at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) app_1 | at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610) app_1 | at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) app_1 | at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516) app_1 | at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1086) app_1 | at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:659) app_1 | at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223) app_1 | at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1558) app_1 | at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1515) app_1 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) app_1 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) app_1 | at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) app_1 | at java.lang.Thread.run(Thread.java:745)

Thanks

anwarkhadim avatar Nov 13 '15 11:11 anwarkhadim

Able to recreate receiving 500s on front and backends on a clean install of 3.2.4 with no plugins.

  • Untarred release file of 3.2.4 on Ubuntu linux with Java 8 installed
  • Set STARTERSITE_BUILD=false in ./dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/classes/dotmarketing-config.properties and saved
  • Started server via bin/startup.sh

Full log catalina.out here: https://gist.github.com/brentgriffin/67d0d3a9fa9cd184f63d

brentgriffin avatar Nov 13 '15 14:11 brentgriffin

As it relates to the initial issue, a workaround would be to make sure that you configure your db and an alternative asset location in your config plugin. If your ASSET_PATH is configured in your plugin to store the assets in another location then when the plugin is undeployed, assets will be safe.

Since your db and new asset location are only configured when the config plugin is deployed there is no chance they will be overwritten when the plugin is not deployed.

brentgriffin avatar Nov 13 '15 14:11 brentgriffin

I am doing something different than the original issue. Shall I create a new Issue for just the STARTERSITE_BUILD=false, and 500's?

anwarkhadim avatar Nov 13 '15 15:11 anwarkhadim

This issue has been automatically marked as stale because it has not had activity within the past 90 days. It will be closed in 30 days no further activity occurs. Thank you.

stale[bot] avatar Sep 30 '19 02:09 stale[bot]