owen2345/camaleon-cms

Theme generator crashes application server

Closed this issue · 0 comments

I followed the instructions for setting up a new theme, and ran: rails g camaleon_cms:theme netmojo. But then the next page load crashed the server:

I, [2019-08-11T20:23:51.208808 #27496]  INFO -- : [24fd33c1-6e6b-4556-87b2-b1f224ab5f23]   Rendering /usr/local/rvm/gems/ruby-2.6.3/bundler/gems/camaleon-cms-2a214f238968/app/views/camaleon_cms/admin/appearances/themes/index.html.erb within layouts/camaleon_cms/admin
D, [2019-08-11T20:23:51.213356 #27496] DEBUG -- : [24fd33c1-6e6b-4556-87b2-b1f224ab5f23]   CamaleonCms::Theme Load (0.2ms)  SELECT "cama_term_taxonomy".* FROM "cama_term_taxonomy" WHERE "cama_term_taxonomy"."taxonomy" = ? AND "cama_term_taxonomy"."parent_id" = ? AND "cama_term_taxonomy"."slug" = ? AND "cama_term_taxonomy"."status" IS NULL ORDER BY "cama_term_taxonomy"."id" ASC LIMIT ?  [["taxonomy", "theme"], ["parent_id", 1], ["slug", "default"], ["LIMIT", 1]]
D, [2019-08-11T20:23:51.214976 #27496] DEBUG -- : [24fd33c1-6e6b-4556-87b2-b1f224ab5f23]   CACHE  (0.0ms)  SELECT "cama_term_taxonomy"."slug" FROM "cama_term_taxonomy" WHERE "cama_term_taxonomy"."taxonomy" = ? AND "cama_term_taxonomy"."parent_id" = ? AND "cama_term_taxonomy"."term_group" = ?  [["taxonomy", "plugin"], ["parent_id", 1], ["term_group", 1]]
I, [2019-08-11T20:23:51.217411 #27496]  INFO -- : [24fd33c1-6e6b-4556-87b2-b1f224ab5f23]   Rendered /usr/local/rvm/gems/ruby-2.6.3/bundler/gems/camaleon-cms-2a214f238968/app/views/camaleon_cms/admin/appearances/themes/index.html.erb within layouts/camaleon_cms/admin (Duration: 8.2ms | Allocations: 2676)
I, [2019-08-11T20:23:51.217893 #27496]  INFO -- : [24fd33c1-6e6b-4556-87b2-b1f224ab5f23] Completed 500 Internal Server Error in 269ms (ActiveRecord: 1.7ms | Allocations: 128414)
F, [2019-08-11T20:23:51.219603 #27496] FATAL -- : [24fd33c1-6e6b-4556-87b2-b1f224ab5f23]   
[24fd33c1-6e6b-4556-87b2-b1f224ab5f23] ActionView::Template::Error (The asset "themes/netmojo/assets/images/image.png" is not present in the asset pipeline.):

Perhaps restarting the application server alone would have fixed it, but I recompiled the asset pipline using:

su - app -c "cd /home/app/cms; RAILS_ENV=production SECRET_KEY_BASE=token bundle exec rake assets:precompile --trace"

(inside my docker container). Then restarted the app server, and it worked.