ankane / blazer

Business intelligence made simple
MIT License
4.5k stars 471 forks source link

Blazer::Error(Unknown data source) after upgrading to 2.6.2 from 2.4.2 #398

Closed lemeo closed 2 years ago

lemeo commented 2 years ago

Hey @ankane,

After upgrading to blazer version 2.6.2 from 2.4.2, we are seeing the following error in sentry:

Blazer::Error /data/queries/cancel Unknown data source: Following is the complete stack trace:

Blazer::Error: Unknown data source: 
  from blazer.rb:130:in `block in data_sources'
  from blazer/queries_controller.rb:220:in `set_data_source'
  from active_support/callbacks.rb:427:in `block in make_lambda'
  from active_support/callbacks.rb:179:in `block (2 levels) in halting_and_conditional'
  from abstract_controller/callbacks.rb:34:in `block (2 levels) in <module:Callbacks>'
  from active_support/callbacks.rb:180:in `block in halting_and_conditional'
  from active_support/callbacks.rb:512:in `block in invoke_before'
  from active_support/callbacks.rb:512:in `each'
  from active_support/callbacks.rb:512:in `invoke_before'
  from active_support/callbacks.rb:105:in `run_callbacks'
  from abstract_controller/callbacks.rb:41:in `process_action'
  from action_controller/metal/rescue.rb:22:in `process_action'
  from action_controller/metal/instrumentation.rb:34:in `block in process_action'
  from active_support/notifications.rb:203:in `block in instrument'
  from active_support/notifications/instrumenter.rb:24:in `instrument'
  from active_support/notifications.rb:203:in `instrument'
  from action_controller/metal/instrumentation.rb:33:in `process_action'
  from action_controller/metal/params_wrapper.rb:249:in `process_action'
  from active_record/railties/controller_runtime.rb:27:in `process_action'
  from scout_apm/instruments/action_controller_rails_3_rails4.rb:120:in `process_action'
  from abstract_controller/base.rb:165:in `process'
  from action_view/rendering.rb:39:in `process'
  from action_controller/metal.rb:190:in `dispatch'
  from action_controller/metal.rb:254:in `dispatch'
  from action_dispatch/routing/route_set.rb:50:in `dispatch'
  from action_dispatch/routing/route_set.rb:33:in `serve'
  from action_dispatch/journey/router.rb:50:in `block in serve'
  from action_dispatch/journey/router.rb:32:in `each'
  from action_dispatch/journey/router.rb:32:in `serve'
  from action_dispatch/routing/route_set.rb:842:in `call'
  from scout_apm/instruments/rails_router.rb:29:in `call_with_scout_instruments'
  from rails/engine.rb:539:in `call'
  from rails/railtie.rb:207:in `public_send'
  from rails/railtie.rb:207:in `method_missing'
  from action_dispatch/routing/mapper.rb:20:in `block in <class:Constraints>'
  from action_dispatch/routing/mapper.rb:49:in `serve'
  from action_dispatch/journey/router.rb:50:in `block in serve'
  from action_dispatch/journey/router.rb:32:in `each'
  from action_dispatch/journey/router.rb:32:in `serve'
  from action_dispatch/routing/route_set.rb:842:in `call'
  from scout_apm/instruments/rails_router.rb:29:in `call_with_scout_instruments'
  from scout_apm/middleware.rb:17:in `call'
  from warden/manager.rb:36:in `block in call'
  from warden/manager.rb:34:in `catch'
  from warden/manager.rb:34:in `call'
  from rack/tempfile_reaper.rb:17:in `call'
  from rack/etag.rb:27:in `call'
  from rack/conditional_get.rb:40:in `call'
  from rack/head.rb:14:in `call'
  from app/middlewares/sanitize_null_bytes.rb:14:in `call'
  from action_dispatch/http/permissions_policy.rb:22:in `call'
  from action_dispatch/http/content_security_policy.rb:19:in `call'
  from rack/session/abstract/id.rb:269:in `context'
  from rack/session/abstract/id.rb:263:in `call'
  from action_dispatch/middleware/cookies.rb:689:in `call'
  from action_dispatch/middleware/callbacks.rb:27:in `block in call'
  from active_support/callbacks.rb:98:in `run_callbacks'
  from action_dispatch/middleware/callbacks.rb:26:in `call'
  from action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
  from ddtrace/contrib/rails/middlewares.rb:18:in `call'
  from action_dispatch/middleware/debug_exceptions.rb:29:in `call'
  from action_dispatch/middleware/show_exceptions.rb:33:in `call'
  from rails/rack/logger.rb:37:in `call_app'
  from rails/rack/logger.rb:26:in `block in call'
  from active_support/tagged_logging.rb:99:in `block in tagged'
  from active_support/tagged_logging.rb:37:in `tagged'
  from active_support/tagged_logging.rb:99:in `tagged'
  from rails/rack/logger.rb:26:in `call'
  from action_dispatch/middleware/remote_ip.rb:81:in `call'
  from request_store/middleware.rb:19:in `call'
  from action_dispatch/middleware/request_id.rb:26:in `call'
  from rack/method_override.rb:24:in `call'
  from rack/runtime.rb:24:in `call'
  from active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
  from action_dispatch/middleware/executor.rb:14:in `call'
  from action_dispatch/middleware/static.rb:24:in `call'
  from rack/sendfile.rb:113:in `call'
  from action_dispatch/middleware/host_authorization.rb:142:in `call'
  from rack/cors.rb:98:in `call'
  from raven/integrations/rack.rb:51:in `call'
  from ddtrace/contrib/rack/middlewares.rb:88:in `call'
  from secure_headers/middleware.rb:11:in `call'
  from scout_apm/instruments/middleware_summary.rb:58:in `call'
  from rails/engine.rb:539:in `call'
  from puma/configuration.rb:228:in `call'
  from puma/server.rb:727:in `handle_request'
  from puma/server.rb:476:in `process_client'
  from puma/server.rb:332:in `block in run'
  from puma/thread_pool.rb:134:in `block in spawn_thread'

Most of our blazer queries seem to be working fine. So, we are not sure where this error message is coming from. I noticed that there were some changes around the data_source in a recent commit (https://github.com/ankane/blazer/commit/f49fbfed7b9e406a69eb78c463c3aa5d35006d8d)

Could you please let me know if we have to make any config changes when upgrading to 2.6.2? Thanks!

ankane commented 2 years ago

Hey @lemeo, thanks for reporting! Just pushed a fix and will make a release later tonight.