debtcollective / parent

1 stars 0 forks source link

Plugin prevents bootstrap to complete #181

Closed berleant closed 6 years ago

berleant commented 6 years ago

@orlando commented on Thu Jul 05 2018

This is the error I'm getting.

Plugins are loaded with the application, so we cannot assume everything will be there.

Caused by:
PG::UndefinedTable: ERROR:  relation "tag_groups" does not exist
LINE 1: SELECT "tag_groups".* FROM "tag_groups" WHERE (name = 'Campa...
                                   ^
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.0/lib/patches/db/pg.rb:92:in `async_exec'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.0/lib/patches/db/pg.rb:92:in `async_exec'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:603:in `block (2 levels) in exec_no_cache'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:602:in `block in exec_no_cache'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:579:in `block (2 levels) in log'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:578:in `block in log'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:569:in `log'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:601:in `exec_no_cache'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:588:in `execute_and_clear'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:81:in `exec_query'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:465:in `select'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:57:in `select_all'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/query_cache.rb:101:in `select_all'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/querying.rb:41:in `find_by_sql'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/relation.rb:554:in `block in exec_queries'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/relation.rb:578:in `skip_query_cache_if_necessary'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/relation.rb:542:in `exec_queries'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/relation.rb:414:in `load'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/relation.rb:200:in `records'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/relation/delegation.rb:41:in `[]'
/var/www/discourse/plugins/discourse-custom-pages/plugin.rb:16:in `block (2 levels) in activate!'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:432:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:432:in `eval_block'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:439:in `block in finalize!'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:439:in `each'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:439:in `finalize!'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application/routes_reloader.rb:61:in `each'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application/routes_reloader.rb:61:in `finalize!'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application/routes_reloader.rb:21:in `reload!'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application/routes_reloader.rb:43:in `block in updater'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/file_update_checker.rb:83:in `execute'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application/routes_reloader.rb:44:in `updater'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application/routes_reloader.rb:33:in `execute_if_updated'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application/finisher.rb:130:in `block in <module:Finisher>'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `run'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:61:in `block in run_initializers'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/initializable.rb:60:in `run_initializers'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:361:in `initialize!'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/railtie.rb:190:in `public_send'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/railtie.rb:190:in `method_missing'
/var/www/discourse/config/environment.rb:5:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:337:in `require_environment!'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Tasks: TOP => db:migrate => db:load_config => environment
(See full trace by running task with --trace)
berleant commented 6 years ago

I can't reproduce this. If the import scripts/discourse-seed are run first, then discourse is launched, there should be no problem. The tag_groups table is persistent.

orlando commented 6 years ago

This is for a new installation, before you can run the seed file

Enviado desde mi iPhone

El 06/08/2018, a la(s) 15:15, Shoshana Berleant notifications@github.com escribió:

I can't reproduce this. If the import scripts/discourse-seed are run first, then discourse is launched, there should be no problem. The tag_groups table is persistent.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

berleant commented 6 years ago

You can run the import script before starting the Discourse application, right?

orlando commented 6 years ago

@shoshber this fails in the first installation.

You can reproduce this by simple dropping the database and creating it again. Plugins are loaded with the application and in the first install we don't have models yet

berleant commented 6 years ago

I understand what causes it--I'm wondering if this would ever come up in real life, because the import scripts would have been run before starting the discourse app. If you still think it's worth fixing, I will fix it.

sarayourfriend commented 6 years ago

It sounds like this isn't a problem we need to worry about because it's only during seeding. I feel okay with there being a caveat in the order of operations for the first launch of the application. Unless it will take less than 5 minutes to open a PR to fix it then I vote we move on from this.

orlando commented 6 years ago

@shoshber this plugin is currently disabled, closing this issue means we won't be using it anymore?

berleant commented 6 years ago

If I'm reading @marcondag right, they think that we should use the plugin but we don't need to fix this issue because it won't be a problem.

sarayourfriend commented 6 years ago

Agreed

orlando commented 6 years ago

It is a problem, I had to disable this in order to install the servers. Remember our environments are inmutable, and we cannot enable the plugin after bootstrap.

orlando commented 6 years ago

But cool let’s keep that way then, let’s look at this after launch

berleant commented 6 years ago

Remember our environments are inmutable, and we cannot enable the plugin after bootstrap.

Oh! I didn't know this. Maybe we should have a meeting with @marcondag where you tell us all of the set up stuff, start-to-finish. Right now, I think you are the only person who knows how to do that and has all the info.