canvas-lms icon indicating copy to clipboard operation
canvas-lms copied to clipboard

compile assets failed on fresh setup

Open amg-web opened this issue 3 years ago • 8 comments

compile assets failed due to try to change DB for which initial_setup was not done yet according to proction manual git was cloned today stable barnch it uses tag: release/2022-03-02.01

--> Finished: 'js:webpack_production' in 603.01s
rake aborted!
Parallel::UndumpableException: ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "public.brand_configs" does not exist
LINE 1: DELETE FROM "public"."brand_configs" WHERE (NOT EXISTS (SELE...
                    ^
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.4.2/lib/active_record/connection_adapters/postgresql_adapter.rb:675:in `exec_params'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.4.2/lib/active_record/connection_adapters/postgresql_adapter.rb:675:in `block (2 levels) in exec_no_cache'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.4.2/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.4.2/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.4.2/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.4.2/lib/active_record/connection_adapters/postgresql_adapter.rb:674:in `block in exec_no_cache'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.4.2/lib/active_record/connection_adapters/abstract_adapter.rb:728:in `block (2 levels) in log'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.4.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.4.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.4.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.4.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.4.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.4.2/lib/active_record/connection_adapters/abstract_adapter.rb:727:in `block in log'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.4.2/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/switchman-2.2.2/lib/switchman/sharded_instrumenter.rb:22:in `instrument'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.4.2/lib/active_record/connection_adapters/abstract_adapter.rb:718:in `log'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/switchman-2.2.2/lib/switchman/active_record/abstract_adapter.rb:39:in `log'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.4.2/lib/active_record/connection_adapters/postgresql_adapter.rb:673:in `exec_no_cache'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.4.2/lib/active_record/connection_adapters/postgresql_adapter.rb:654:in `execute_and_clear'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.4.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:111:in `exec_delete'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.4.2/lib/active_record/connection_adapters/abstract/database_statements.rb:180:in `delete'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.4.2/lib/active_record/connection_adapters/abstract/query_cache.rb:22:in `delete'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.4.2/lib/active_record/relation.rb:587:in `delete_all'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/switchman-2.2.2/lib/switchman/guard_rail/relation.rb:23:in `delete_all'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/switchman-2.2.2/lib/switchman/call_super.rb:16:in `call'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/switchman-2.2.2/lib/switchman/call_super.rb:16:in `call_super'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/switchman-2.2.2/lib/switchman/active_record/relation.rb:65:in `block in delete_all'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/switchman-2.2.2/lib/switchman/active_record/relation.rb:104:in `activate'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/switchman-2.2.2/lib/switchman/active_record/relation.rb:65:in `delete_all'
/home/canvas/public_html/config/initializers/active_record.rb:1359:in `delete_all'
/home/canvas/public_html/config/initializers/active_record.rb:1391:in `delete_all'
/home/canvas/public_html/app/models/brand_config.rb:247:in `clean_unused_from_db!'
/home/canvas/public_html/lib/tasks/brand_configs.rake:10:in `block (2 levels) in <top (required)>'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/switchman-2.2.2/lib/tasks/switchman.rake:88:in `block (6 levels) in shardify_task'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/switchman-2.2.2/lib/tasks/switchman.rake:88:in `each'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/switchman-2.2.2/lib/tasks/switchman.rake:88:in `block (5 levels) in shardify_task'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/switchman-2.2.2/lib/switchman/database_server.rb:109:in `unguard'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/switchman-2.2.2/lib/tasks/switchman.rake:87:in `block (4 levels) in shardify_task'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/switchman-2.2.2/app/models/switchman/shard.rb:156:in `with_each_shard'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/switchman-2.2.2/lib/tasks/switchman.rake:72:in `block (3 levels) in shardify_task'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/switchman-2.2.2/lib/switchman/database_server.rb:109:in `unguard'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/switchman-2.2.2/lib/tasks/switchman.rake:69:in `block (2 levels) in shardify_task'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/switchman-2.2.2/lib/switchman/guard_rail.rb:24:in `activate'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/switchman-inst-jobs-3.2.7/lib/switchman_inst_jobs/guard_rail.rb:8:in `activate'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/switchman-2.2.2/lib/tasks/switchman.rake:68:in `block in shardify_task'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/bundler/gems/sentry-ruby-4595fc2893f2/sentry-ruby/lib/sentry/rake.rb:24:in `execute'
/home/canvas/public_html/lib/tasks/canvas.rake:84:in `block (6 levels) in <top (required)>'
/home/canvas/public_html/lib/tasks/canvas.rake:12:in `log_time'
/home/canvas/public_html/lib/tasks/canvas.rake:87:in `block (5 levels) in <top (required)>'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb:515:in `call_with_index'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb:485:in `process_incoming_jobs'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb:465:in `block in worker'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb:456:in `fork'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb:456:in `worker'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb:447:in `block in create_workers'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb:446:in `each'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb:446:in `each_with_index'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb:446:in `create_workers'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb:386:in `work_in_processes'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb:289:in `map'
/home/canvas/public_html/lib/tasks/canvas.rake:80:in `block (4 levels) in <top (required)>'
/home/canvas/public_html/lib/tasks/canvas.rake:79:in `each'
/home/canvas/public_html/lib/tasks/canvas.rake:79:in `block (3 levels) in <top (required)>'
/home/canvas/public_html/lib/tasks/canvas.rake:78:in `block (2 levels) in <top (required)>'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/bundler/gems/sentry-ruby-4595fc2893f2/sentry-ruby/lib/sentry/rake.rb:24:in `execute'
/home/canvas/public_html/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/exe/rake:27:in `<top (required)>'
Tasks: TOP => canvas:compile_assets

amg-web avatar Feb 22 '22 09:02 amg-web

tag release/2022-02-16.01 failes too.

I made fresh install with tag release/2022-01-19.01 after setup it was updated to stable

Also have warning:

`WARNING in asset size limit: The following asset(s) exceed the recommended size limit (1.34 MiB).
This can impact web performance.
Assets:
  account_settings-c-a864185862.js (1.96 MiB)
  calendar-c-d519e4e37c.js (1.76 MiB)
  edit_rubric-c-836a92a394.js (1.62 MiB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (1.21 MiB). This can impact web performance.
Entrypoints:
  main (1.24 MiB)
      main-e-22ae58e6d9.js`

and lots of repeated warnings;

 | The "loose" option must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding
 |      ["@babel/plugin-proposal-private-methods", { "loose": true }]
 | to the "plugins" section of your Babel config.

amg-web avatar Feb 22 '22 17:02 amg-web

Have also been experiencing this, same issue with compile assets.

hallach avatar Feb 23 '22 04:02 hallach

one more message from todays latest stable 1st message error is still actual.

@instructure/canvas-rce
 | Unknown error from PostCSS plugin. Your current PostCSS version is 6.0.23, but postcss-bidirection uses 7.0.36. Perhaps this is the source of the error below.
 | [transform-themeable]: Could not require CSS file: mathlive/dist/mathlive-fonts.css
 |  TypeError: Cannot read property 'nodes' of undefined

amg-web avatar Feb 25 '22 17:02 amg-web

Latest stable version still has this problem I do now in a liitle different way

  1. RAILS_ENV=production bundle exec rake canvas:compile_assets - it ends with error
  2. RAILS_ENV=production bundle exec rake db:initial_setup - it ends with error too
  3. RAILS_ENV=production bundle exec rake canvas:compile_assets - yes again, and no error as the DB are initialized now.
  4. RAILS_ENV=production bundle exec rake db:initial_setup - again to be sure all tables are created

continue setup as usual

PS. I do not use sudo in yarn install and RAILS_ENV=production bundle exec rake as it recommended in Production Start.

amg-web avatar Mar 08 '22 12:03 amg-web

Will it be fixed ? why it tries to access DB before it is initialized ?

amg-web avatar Mar 21 '22 17:03 amg-web

problematic place located https://github.com/instructure/canvas-lms/blob/5522db83697e2b3d3d941d8efe506b3566da5dd6/lib/tasks/brand_configs.rake#L10

need to add check if db exists

amg-web avatar Mar 23 '22 11:03 amg-web

@amg-web : I followed you steps, and it works, thank you

Hellothi11 avatar Mar 30 '22 18:03 Hellothi11

fix for compile assets without source file editing: COMPILE_ASSETS_BRAND_CONFIGS=0 RAILS_ENV=production bundle exec rake canvas:compile_assets

amg-web avatar May 06 '22 07:05 amg-web

@amg-web дякую ;)

qq7 avatar May 09 '22 12:05 qq7