Theme editor preview gets stuck
Whenever I change primary color value or upload a watermark image in the theme editor and click on preview changes button, the generating preview would show on the screen but no preview is generated. In the terminal, I found the same api call being made infinite times.
Here is what gets displayed to the terminal:
Started POST "/accounts/9/brand_configs" for 10.0.2.2 at 2016-05-31 12:04:31 +0530 CacheStore: read "_account_lookup4/1" 0.0000 Account Load (1.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = 1 LIMIT 1 [["id", 1]] [development:1 master] CacheStore: generate "_account_lookup4/1" 0.0055 CacheStore: write "_account_lookup4/1" 0.0001 CacheStore: read "settings_for_plugin3/sessions" 0.0000 PluginSetting Load (1.0ms) SELECT "plugin_settings".* FROM "plugin_settings" WHERE "plugin_settings"."name" = 'sessions' ORDER BY "plugin_settings"."id" ASC LIMIT 1 [development:1 master] CacheStore: generate "settings_for_plugin3/sessions" 0.0040 CacheStore: write "settings_for_plugin3/sessions" 0.0001 Processing by BrandConfigsController#create as JSON Parameters: {"utf8"=>"✓", "authenticity_token"=>"39vgG4KYNb/knro5J4ZfGz5y9bGCj9E0OLzlSwGtzu3qiqMi6aB/0LDowHd3vjFUeTmfiPPnp3hw/bwecpy6rw==", "te-action"=>"edit", "brand_config"=>{"variables"=>{"ic-brand-primary"=>"#3b7e4e", "ic-brand-button--primary-bgd"=>"", "ic-brand-button--primary-text"=>"", "ic-brand-button--secondary-bgd"=>"", "ic-brand-button--secondary-text"=>"", "ic-link-color"=>"#b52828", "ic-brand-global-nav-bgd"=>"#262626", "ic-brand-global-nav-ic-icon-svg-fill"=>"#d43c3c", "ic-brand-global-nav-ic-icon-svg-fill--active"=>"", "ic-brand-global-nav-menu-item__text-color"=>"", "ic-brand-global-nav-menu-item__text-color--active"=>"#d12e2e", "ic-brand-global-nav-avatar-border"=>"", "ic-brand-global-nav-menu-item__badge-bgd"=>"#128812", "ic-brand-global-nav-logo-bgd"=>"#d12e2e", "ic-brand-header-image"=>"", "ic-brand-watermark"=>"", "ic-brand-watermark-opacity"=>"1", "ic-brand-favicon"=>"", "ic-brand-apple-touch-icon"=>"", "ic-brand-msapplication-tile-color"=>"", "ic-brand-msapplication-tile-square"=>"", "ic-brand-msapplication-tile-wide"=>"", "ic-brand-right-sidebar-logo"=>"", "ic-brand-Login-body-bgd-color"=>"#d12e2e", "ic-brand-Login-body-bgd-image"=>"", "ic-brand-Login-body-bgd-shadow-color"=>"#d12e2e", "ic-brand-Login-logo"=>"", "ic-brand-Login-Content-bgd-color"=>"#262626", "ic-brand-Login-Content-border-color"=>"#262626", "ic-brand-Login-Content-inner-bgd"=>"", "ic-brand-Login-Content-inner-border"=>"", "ic-brand-Login-Content-inner-body-bgd"=>"", "ic-brand-Login-Content-inner-body-border"=>"", "ic-brand-Login-Content-label-text-color"=>"", "ic-brand-Login-Content-password-text-color"=>"[FILTERED]", "ic-brand-Login-Content-button-bgd"=>"#d12e2e", "ic-brand-Login-Content-button-text"=>"", "ic-brand-Login-footer-link-color"=>"#dddddd", "ic-brand-Login-footer-link-color-hover"=>"#cccccc", "ic-brand-Login-instructure-logo"=>"#cccccc"}}, "css_overrides"=>"", "js_overrides"=>"", "mobile_css_overrides"=>"", "mobile_js_overrides"=>"", "_workaround_for_IE_10_and_11_formdata_bug"=>"", "account_id"=>"9"} Pseudonym Load (1.7ms) SELECT "pseudonyms".* FROM "pseudonyms" WHERE "pseudonyms"."id" = 1 LIMIT 1 [development:1 master] (0.3ms) BEGIN [development:1 master] SQL (1.6ms) UPDATE "pseudonyms" SET "last_request_at" = '2016-05-31 06:34:31.957845', "perishable_token" = 'jhoaVoEiLFLapn2lyBoz', "updated_at" = '2016-05-31 06:34:31.964760' WHERE "pseudonyms"."id" = 1 [["last_request_at", Tue, 31 May 2016 00:34:31 MDT -06:00], ["perishable_token", "jhoaVoEiLFLapn2lyBoz"], ["updated_at", Tue, 31 May 2016 00:34:31 MDT -06:00]] [development:1 master] User Load (1.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1 [["id", 1]] [development:1 master] (1.0ms) COMMIT [development:1 master] Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" IN (9) ORDER BY "accounts"."id" ASC LIMIT 1 [development:1 master] AccountUser Load (1.0ms) SELECT "account_users".* FROM "account_users" WHERE "account_users"."account_id" = 9 AND "account_users"."user_id" = 1 ORDER BY "account_users"."id" ASC LIMIT 1 [["account_id", 9]] [development:1 master] CacheStore: read "permissions/accounts/9-2016-05-30 13:16:39 UTC/users/1-2016-05-30 11:34:32 UTC/manage_account_settings" 0.0000 CacheStore: read "_account_lookup4/2" 0.0000 Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = 2 LIMIT 1 [["id", 2]] [development:1 master] CacheStore: generate "_account_lookup4/2" 0.0058 CacheStore: write "_account_lookup4/2" 0.0001 Account Load (2.6ms) WITH RECURSIVE t AS ( SELECT * FROM "accounts" WHERE id=1 UNION SELECT accounts.* FROM "accounts" INNER JOIN t ON accounts.id=t.parent_account_id ) SELECT * FROM t [development:1 master] AccountUser Load (1.0ms) SELECT "account_users".* FROM "account_users" WHERE "account_users"."account_id" IN (9, 1, 2) AND "account_users"."user_id" = 1 [development:1 master] Account Load (1.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = 2 LIMIT 1 [["id", 2]] [development:1 master] CacheStore: write "permissions/accounts/9-2016-05-30 13:16:39 UTC/users/1-2016-05-30 11:34:32 UTC/manage_account_settings" 0.0001 Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = 1 LIMIT 1 [["id", 1]] [development:1 master] WARNING: Can't mass-assign protected attributes for BrandConfig: parent_md5 config/initializers/strong_parameters.rb:40:insanitize_for_mass_assignment'
app/models/brand_config.rb:37:in for' app/controllers/brand_configs_controller.rb:79:increate'
app/controllers/application_controller.rb:287:in block in enable_request_cache' lib/temp_cache.rb:7:inenable'
app/controllers/application_controller.rb:286:in enable_request_cache' app/controllers/application_controller.rb:280:inset_locale'
app/middleware/request_throttle.rb:59:in block in call' app/middleware/request_throttle.rb:257:inreserve_capacity'
app/middleware/request_throttle.rb:54:in call' app/middleware/request_context_session.rb:25:incall'
app/middleware/sessions_timeout.rb:22:in call' app/middleware/load_account.rb:12:incall'
app/middleware/request_context_generator.rb:49:in call' app/middleware/prevent_non_multipart_parse.rb:32:incall'
BrandConfig Load (1.6ms) SELECT "brand_configs".* FROM "brand_configs" WHERE "brand_configs"."md5" = '234bd66784ca9385748a671ce39ca244' ORDER BY "brand_configs"."md5" ASC LIMIT 1 development:1 master BEGIN [development:1 master]
SQL (1.4ms) INSERT INTO "brand_configs" ("created_at", "css_overrides", "js_overrides", "md5", "mobile_css_overrides", "mobile_js_overrides", "variables") VALUES ('2016-05-31 06:34:32.070034', '', '', '234bd66784ca9385748a671ce39ca244', '', '', '--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess
ic-brand-primary: "#3b7e4e"
ic-link-color: "#b52828"
ic-brand-global-nav-bgd: "#262626"
ic-brand-global-nav-ic-icon-svg-fill: "#d43c3c"
ic-brand-global-nav-menu-item__text-color--active: "#d12e2e"
ic-brand-global-nav-menu-item__badge-bgd: "#128812"
ic-brand-global-nav-logo-bgd: "#d12e2e"
ic-brand-watermark-opacity: ''1''
ic-brand-Login-body-bgd-color: "#d12e2e"
ic-brand-Login-body-bgd-shadow-color: "#d12e2e"
ic-brand-Login-Content-bgd-color: "#262626"
ic-brand-Login-Content-border-color: "#262626"
ic-brand-Login-Content-password-text-color: "#dddddd"
ic-brand-Login-Content-button-bgd: "#d12e2e"
ic-brand-Login-footer-link-color: "#dddddd"
ic-brand-Login-footer-link-color-hover: "#cccccc"
ic-brand-Login-instructure-logo: "#cccccc"
GETDOWNWITHTHESYCKNESS
') RETURNING "md5" [["created_at", Tue, 31 May 2016 00:34:32 MDT -06:00], ["css_overrides", ""], ["js_overrides", ""], ["md5", "234bd66784ca9385748a671ce39ca244"], ["mobile_css_overrides", ""], ["mobile_js_overrides", ""], ["variables", "--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nic-brand-primary: "#3b7e4e"\nic-link-color: "#b52828"\nic-brand-global-nav-bgd: "#262626"\nic-brand-global-nav-ic-icon-svg-fill: "#d43c3c"\nic-brand-global-nav-menu-item__text-color--active: "#d12e2e"\nic-brand-global-nav-menu-item__badge-bgd: "#128812"\nic-brand-global-nav-logo-bgd: "#d12e2e"\nic-brand-watermark-opacity: '1'\nic-brand-Login-body-bgd-color: "#d12e2e"\nic-brand-Login-body-bgd-shadow-color: "#d12e2e"\nic-brand-Login-Content-bgd-color: "#262626"\nic-brand-Login-Content-border-color: "#262626"\nic-brand-Login-Content-password-text-color: "#dddddd"\nic-brand-Login-Content-button-bgd: "#d12e2e"\nic-brand-Login-footer-link-color: "#dddddd"\nic-brand-Login-footer-link-color-hover: "#cccccc"\nic-brand-Login-instructure-logo: "#cccccc"\n#GETDOWNWITHTHESYCKNESS\n"]] development:1 master COMMIT development:1 master BEGIN [development:1 master] SQL (4.4ms) INSERT INTO "progresses" ("completion", "context_id", "context_type", "created_at", "results", "tag", "updated_at", "user_id", "workflow_state") VALUES (0, 1, 'User', '2016-05-31 06:34:32.480372', NULL, 'brand_config_save_and_sync_to_s3', '2016-05-31 06:34:32.480372', 1, 'queued') RETURNING "id" [["completion", 0.0], ["context_id", 1], ["context_type", "User"], ["created_at", Tue, 31 May 2016 00:34:32 MDT -06:00], ["results", nil], ["tag", :brand_config_save_and_sync_to_s3], ["updated_at", Tue, 31 May 2016 00:34:32 MDT -06:00], ["user_id", 1], ["workflow_state", "queued"]] development:1 master COMMIT development:1 master BEGIN [development:1 master] SQL (7.7ms) INSERT INTO "delayed_jobs" ("created_at", "handler", "max_attempts", "queue", "run_at", "tag", "updated_at") VALUES ('2016-05-31 06:34:32.544570', '--- !ruby/struct:Progress::Work object: !ruby/ActiveRecord:BrandConfig 234bd66784ca9385748a671ce39ca244 method: :save_and_sync_to_s3! args:
- !ruby/ActiveRecord:Progress 4 fail_cb: permanent_fail_cb: progress: !ruby/ActiveRecord:Progress 4 #GETDOWNWITHTHESYCKNESS ', 1, 'canvas_queue', '2016-05-31 06:34:32.544067', 'BrandConfig#save_and_sync_to_s3!', '2016-05-31 06:34:32.544570') RETURNING "id" [["created_at", Tue, 31 May 2016 00:34:32 MDT -06:00], ["handler", "--- !ruby/struct:Progress::Work\nobject: !ruby/ActiveRecord:BrandConfig 234bd66784ca9385748a671ce39ca244\nmethod: :save_and_sync_to_s3!\nargs:\n- !ruby/ActiveRecord:Progress 4\nfail_cb: \npermanent_fail_cb: \nprogress: !ruby/ActiveRecord:Progress 4\n#GETDOWNWITHTHESYCKNESS\n"], ["max_attempts", 1], ["queue", "canvas_queue"], ["run_at", Tue, 31 May 2016 00:34:32 MDT -06:00], ["tag", "BrandConfig#save_and_sync_to_s3!"], ["updated_at", Tue, 31 May 2016 00:34:32 MDT -06:00]] development:1 master COMMIT [development:1 master] Rendered text template (0ms) Completed 200 OK in 625ms (Views: 2.0ms | ActiveRecord: 44.7ms) [STATSD](total: 626.36) (view: 1.97) (db: 44.65) (sql_read: 9.00) (sql_write: 5.00) (sql_cache: 0.00) (active_record: 13.00) [STAT] 851856 851856 0 851716 0.490000000000002 0.060000000000002274 `
`Started GET "/api/v1/progress/4" for 10.0.2.2 at 2016-05-31 12:04:33 +0530 CacheStore: read "settings_for_plugin3/sessions" 0.0000 PluginSetting Load (0.8ms) SELECT "plugin_settings".* FROM "plugin_settings" WHERE "plugin_settings"."name" = 'sessions' ORDER BY "plugin_settings"."id" ASC LIMIT 1 [development:1 master] CacheStore: generate "settings_for_plugin3/sessions" 0.0041 CacheStore: write "settings_for_plugin3/sessions" 0.0001 Processing by ProgressController#show as JSON Parameters: {"id"=>"4"} Pseudonym Load (1.1ms) SELECT "pseudonyms".* FROM "pseudonyms" WHERE "pseudonyms"."id" = 1 LIMIT 1 [development:1 master] User Load (1.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1 [["id", 1]] [development:1 master] Progress Load (0.9ms) SELECT "progresses".* FROM "progresses" WHERE "progresses"."id" = 4 LIMIT 1 [["id", "4"]] [development:1 master] CACHE (0.0ms) 1::SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1 [["id", 1]] CacheStore: read "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/read" 0.0000 CacheStore: write "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/read_grades" 0.0001 CacheStore: write "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/read_profile" 0.0001 CacheStore: write "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/read_as_admin" 0.0001 CacheStore: write "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/manage" 0.0001 CacheStore: write "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/manage_content" 0.0001 CacheStore: write "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/manage_files" 0.0000 CacheStore: write "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/manage_calendar" 0.0000 CacheStore: write "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/send_messages" 0.0000 CacheStore: write "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/update_avatar" 0.0000 CacheStore: write "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/manage_feature_flags" 0.0001 CacheStore: write "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/read" 0.0000 Completed 200 OK in 53ms (Views: 1.8ms | ActiveRecord: 3.1ms) [STATSD](total: 54.14) (view: 1.83) (db: 3.12) (sql_read: 3.00) (sql_write: 0.00) (sql_cache: 1.00) (active_record: 4.00) [STAT] 851856 851856 0 851856 0.0799999999999983 0.1599999999999966
Started GET "/api/v1/progress/4" for 10.0.2.2 at 2016-05-31 12:04:34 +0530 CacheStore: read "settings_for_plugin3/sessions" 0.0000 PluginSetting Load (0.8ms) SELECT "plugin_settings".* FROM "plugin_settings" WHERE "plugin_settings"."name" = 'sessions' ORDER BY "plugin_settings"."id" ASC LIMIT 1 [development:1 master] CacheStore: generate "settings_for_plugin3/sessions" 0.0040 CacheStore: write "settings_for_plugin3/sessions" 0.0001 Processing by ProgressController#show as JSON Parameters: {"id"=>"4"} Pseudonym Load (1.9ms) SELECT "pseudonyms".* FROM "pseudonyms" WHERE "pseudonyms"."id" = 1 LIMIT 1 [development:1 master] User Load (1.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1 [["id", 1]] [development:1 master] Progress Load (0.9ms) SELECT "progresses".* FROM "progresses" WHERE "progresses"."id" = 4 LIMIT 1 [["id", "4"]] [development:1 master] CACHE (0.3ms) 1::SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1 [["id", 1]] CacheStore: read "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/read" 0.0000 CacheStore: write "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/read_grades" 0.0001 CacheStore: write "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/read_profile" 0.0001 CacheStore: write "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/read_as_admin" 0.0001 CacheStore: write "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/manage" 0.0001 CacheStore: write "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/manage_content" 0.0001 CacheStore: write "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/manage_files" 0.0000 CacheStore: write "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/manage_calendar" 0.0001 CacheStore: write "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/send_messages" 0.0001 CacheStore: write "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/update_avatar" 0.0001 CacheStore: write "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/manage_feature_flags" 0.0001 CacheStore: write "permissions/users/1-2016-05-30 11:34:32 UTC/users/1-2016-05-30 11:34:32 UTC/read" 0.0000 Completed 200 OK in 59ms (Views: 11.6ms | ActiveRecord: 4.2ms) [STATSD](total: 61.90) (view: 11.63) (db: 4.23) (sql_read: 3.00) (sql_write: 0.00) (sql_cache: 1.00) (active_record: 4.00) [STAT] 851856 851856 0 851856 0.07000000000000028 0 `
The call started GET: /api/api/v1/progress/4 happens infinite times.
Are your delayed jobs running? The preview is generated by a delayed job
Thank you @simonista . I didn't start the delayed job before running theme editor.
Thanks @simonista . After 1 week's research, we got a hint from your post and resolve the theme preview issue by running delayed job daemon. And I would suggest the canvas LMS team to post this steps on their production setup page because lots of users are facing the same issue at the time of installations and nothing found any valid solutions.
sudo RAILS_ENV=production script/delayed_job start
Hi @narendraqa, glad you found the issue, and sorry it took so long. We do have a section already about the jobs daemon here: https://github.com/instructure/canvas-lms/wiki/Production-Start#automated-jobs. We could add a note that script/delayed_job start would also work, but it's written the way it is to encourage the use of a process manager to keep an eye on things. Do you have other suggestions on what might have made that section more discoverable to you?