[openstreetmap/openstreetmap-website] Server fails to start when setting `status: "database_offline"` (Issue #3529)

mmd notifications at github.com
Mon Apr 11 17:35:55 UTC 2022


I tried to simulate a "database_offline" situation by adding the following line to settings.local.yml:

```
status: "database_offline"
```

Unfortunately, the server would no longer come up after this change, and prints out a lengthy stack trace instead:

```
	66: from bin/rails:4:in `<main>'
	65: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	64: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	63: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.3/lib/rails/commands.rb:18:in `<main>'
	62: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.3/lib/rails/command.rb:48:in `invoke'
	61: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.3/lib/rails/command/base.rb:87:in `perform'
	60: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
	59: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
	58: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
	57: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.3/lib/rails/commands/server/server_command.rb:134:in `perform'
	56: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.3/lib/rails/commands/server/server_command.rb:134:in `tap'
	55: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.3/lib/rails/commands/server/server_command.rb:143:in `block in perform'
	54: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.3/lib/rails/commands/server/server_command.rb:36:in `start'
	53: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.3/lib/rails/commands/server/server_command.rb:76:in `log_to_stdout'
	52: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/server.rb:422:in `wrapped_app'
	51: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/server.rb:249:in `app'
	50: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/server.rb:349:in `build_app_and_options_from_config'
	49: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:66:in `parse_file'
	48: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:105:in `load_file'
	47: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `new_from_string'
	46: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `eval'
	45: from config.ru:3:in `block in <main>'
	44: from config.ru:3:in `require_relative'
	43: from /home/mmd/openstreetmap-website/config/environment.rb:5:in `<main>'
	42: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.3/lib/rails/application.rb:372:in `initialize!'
	41: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.3/lib/rails/initializable.rb:60:in `run_initializers'
	40: from /usr/lib/ruby/2.7.0/tsort.rb:205:in `tsort_each'
	39: from /usr/lib/ruby/2.7.0/tsort.rb:226:in `tsort_each'
	38: from /usr/lib/ruby/2.7.0/tsort.rb:347:in `each_strongly_connected_component'
	37: from /usr/lib/ruby/2.7.0/tsort.rb:347:in `call'
	36: from /usr/lib/ruby/2.7.0/tsort.rb:347:in `each'
	35: from /usr/lib/ruby/2.7.0/tsort.rb:349:in `block in each_strongly_connected_component'
	34: from /usr/lib/ruby/2.7.0/tsort.rb:431:in `each_strongly_connected_component_from'
	33: from /usr/lib/ruby/2.7.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
	32: from /usr/lib/ruby/2.7.0/tsort.rb:228:in `block in tsort_each'
	31: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.3/lib/rails/initializable.rb:61:in `block in run_initializers'
	30: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.3/lib/rails/initializable.rb:32:in `run'
	29: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.3/lib/rails/initializable.rb:32:in `instance_exec'
	28: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.3/lib/rails/application/finisher.rb:72:in `block in <module:Finisher>'
	27: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/reloader.rb:88:in `prepare!'
	26: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/callbacks.rb:106:in `run_callbacks'
	25: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/callbacks.rb:595:in `invoke_before'
	24: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/callbacks.rb:595:in `each'
	23: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/callbacks.rb:595:in `block in invoke_before'
	22: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/callbacks.rb:200:in `block in halting'
	21: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/callbacks.rb:686:in `block in default_terminator'
	20: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/callbacks.rb:686:in `catch'
	19: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/callbacks.rb:687:in `block (2 levels) in default_terminator'
	18: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/callbacks.rb:199:in `block (2 levels) in halting'
	17: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/callbacks.rb:445:in `block in make_lambda'
	16: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/callbacks.rb:445:in `instance_exec'
	15: from /home/mmd/openstreetmap-website/config/initializers/doorkeeper.rb:4:in `block in <main>'
	14: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/doorkeeper-5.5.4/lib/doorkeeper/config.rb:28:in `configure'
	13: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/doorkeeper-5.5.4/lib/doorkeeper/config.rb:57:in `setup_application_owner'
	12: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/doorkeeper-5.5.4/lib/doorkeeper/orm/active_record.rb:32:in `initialize_application_owner!'
	11: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/doorkeeper-5.5.4/lib/doorkeeper/orm/active_record.rb:40:in `lazy_load'
	10: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/lazy_load_hooks.rb:42:in `on_load'
	 9: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/lazy_load_hooks.rb:42:in `each'
	 8: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/lazy_load_hooks.rb:43:in `block in on_load'
	 7: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/lazy_load_hooks.rb:66:in `execute_hook'
	 6: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/lazy_load_hooks.rb:61:in `with_execution_control'
	 5: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'
	 4: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/lazy_load_hooks.rb:71:in `class_eval'
	 3: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/doorkeeper-5.5.4/lib/doorkeeper/orm/active_record.rb:35:in `block in initialize_application_owner!'
	 2: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/doorkeeper-5.5.4/lib/doorkeeper/config.rb:465:in `application_model'
	 1: from /home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/core_ext/string/inflections.rb:74:in `constantize'
/home/mmd/openstreetmap-website/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/inflector/methods.rb:280:in `constantize': uninitialized constant Oauth2Application (NameError)
Did you mean?  Oauth2ApplicationsController
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/3529
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/issues/3529 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20220411/1db18275/attachment.htm>


More information about the rails-dev mailing list