QueueClassic / queue_classic_admin

An admin interface for QueueClassic
MIT License
23 stars 18 forks source link

Crash when using search feature #20

Closed smathieu closed 10 years ago

smathieu commented 10 years ago

Stacktrace (most recent call first):

  active_record/sanitization.rb:171:in `raise_if_bind_arity_mismatch'
    raise PreparedStatementInvalid, "wrong number of bind variables (#{provided} for #{expected}) in: #{statement}"
  active_record/sanitization.rb:127:in `replace_bind_variables'
    raise_if_bind_arity_mismatch(statement, statement.count('?'), values.size)
  active_record/sanitization.rb:116:in `sanitize_sql_array'
    replace_bind_variables(statement, values)
  active_record/sanitization.rb:26:in `sanitize_sql_for_conditions'
    when Array; sanitize_sql_array(condition)
  active_record/relation/query_methods.rb:898:in `build_where'
    [@klass.send(:sanitize_sql, other.empty? ? opts : ([opts] + other))]
  active_record/relation/query_methods.rb:545:in `where!'
    self.where_values += build_where(opts, rest)
  active_record/relation/query_methods.rb:535:in `where'
    spawn.where!(opts, *rest)
  queue_classic_admin/job_common.rb:25:in `search'
    relation.where(sql, *([wildcard_query] * SEARCHABLE_COLUMNS.size))
  active_record/relation/delegation.rb:60:in `block in method_missing'
    scoping { @klass.send(method, *args, &block) }
  active_record/relation.rb:270:in `scoping'
    yield
  active_record/relation/delegation.rb:60:in `method_missing'
    scoping { @klass.send(method, *args, &block) }
  queue_classic_admin/application_controller.rb:11:in `filter_jobs'
    @queue_classic_jobs = @queue_classic_jobs.search(params[:search])
  queue_classic_admin/queue_classic_jobs_controller.rb:7:in `index'
    filter_jobs(QueueClassicJob)
  action_controller/metal/implicit_render.rb:4:in `send_action'
    ret = super
  abstract_controller/base.rb:189:in `process_action'
    send_action(method_name, *args)
  action_controller/metal/rendering.rb:10:in `process_action'
    super
  abstract_controller/callbacks.rb:18:in `block in process_action'
    super
  active_support/callbacks.rb:383:in `_run__3059004509711456340__process_action__callbacks'
    def __callback_runner_name_cache
  active_support/callbacks.rb:80:in `run_callbacks'
    send(runner_name, &block)
  abstract_controller/callbacks.rb:17:in `process_action'
    run_callbacks(:process_action) do
  action_controller/metal/rescue.rb:29:in `process_action'
    super
  action_controller/metal/instrumentation.rb:31:in `block in process_action'
    result = super
  active_support/notifications.rb:159:in `block in instrument'
    instrumenter.instrument(name, payload) { yield payload if block_given? }
  active_support/notifications/instrumenter.rb:20:in `instrument'
    yield payload
  active_support/notifications.rb:159:in `instrument'
    instrumenter.instrument(name, payload) { yield payload if block_given? }
  action_controller/metal/instrumentation.rb:30:in `process_action'
    ActiveSupport::Notifications.instrument("process_action.action_controller", raw_payload) do |payload|
  action_controller/metal/params_wrapper.rb:250:in `process_action'
    super
  active_record/railties/controller_runtime.rb:18:in `process_action'
    super
  abstract_controller/base.rb:136:in `process'
    process_action(action_name, *args)
  abstract_controller/rendering.rb:44:in `process'
    super
  action_controller/metal.rb:195:in `dispatch'
    process(name)
  action_controller/metal/rack_delegation.rb:13:in `dispatch'
    super(action, request)
  action_controller/metal.rb:231:in `block in action'
    new.dispatch(name, klass.new(env))
  action_dispatch/routing/route_set.rb:80:in `call'
    controller.action(action).call(env)
  action_dispatch/routing/route_set.rb:80:in `dispatch'
    controller.action(action).call(env)
  action_dispatch/routing/route_set.rb:48:in `call'
    dispatch(controller, params[:action], env)
  action_dispatch/journey/router.rb:71:in `block in call'
    status, headers, body = route.app.call(env)
  action_dispatch/journey/router.rb:59:in `each'
    find_routes(env).each do |match, parameters, route|
  action_dispatch/journey/router.rb:59:in `call'
    find_routes(env).each do |match, parameters, route|
  action_dispatch/routing/route_set.rb:674:in `call'
    @router.call(env)
  rails/engine.rb:511:in `call'
    app.call(env)
  rails/railtie/configurable.rb:30:in `method_missing'
    instance.send(*args, &block)
  action_dispatch/routing/mapper.rb:44:in `call'
    matches?(env) ? @app.call(env) : [ 404, {'X-Cascade' => 'pass'}, [] ]
  action_dispatch/journey/router.rb:71:in `block in call'
    status, headers, body = route.app.call(env)
  action_dispatch/journey/router.rb:59:in `each'
    find_routes(env).each do |match, parameters, route|
  action_dispatch/journey/router.rb:59:in `call'
    find_routes(env).each do |match, parameters, route|
  action_dispatch/routing/route_set.rb:674:in `call'
    @router.call(env)
  new_relic/rack/error_collector.rb:50:in `call'
    @app.call(env)
  new_relic/rack/agent_hooks.rb:28:in `call'
    result = @app.call(env)
  new_relic/rack/browser_monitoring.rb:23:in `call'
    result = @app.call(env)   # [status, headers, response]
  hirefire/middleware.rb:29:in `call'
    @app.call(env)
  rack/etag.rb:23:in `call'
    status, headers, body = @app.call(env)
  rack/conditionalget.rb:25:in `call'
    status, headers, body = @app.call(env)
  rack/head.rb:11:in `call'
    status, headers, body = @app.call(env)
  action_dispatch/middleware/params_parser.rb:27:in `call'
    @app.call(env)
  action_dispatch/middleware/flash.rb:241:in `call'
    @app.call(env)
  rack/session/abstract/id.rb:225:in `context'
    status, headers, body = app.call(env)
  rack/session/abstract/id.rb:220:in `call'
    context(env)
  action_dispatch/middleware/cookies.rb:486:in `call'
    status, headers, body = @app.call(env)
  active_record/query_cache.rb:36:in `call'
    response = @app.call(env)
  active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
    response = @app.call(env)
  action_dispatch/middleware/callbacks.rb:29:in `block in call'
    @app.call(env)
  active_support/callbacks.rb:373:in `_run__964893866993724774__call__callbacks'
    RUBY_EVAL
  active_support/callbacks.rb:80:in `run_callbacks'
    send(runner_name, &block)
  action_dispatch/middleware/callbacks.rb:27:in `call'
    result = run_callbacks :call do
  action_dispatch/middleware/remote_ip.rb:76:in `call'
    @app.call(env)
  action_dispatch/middleware/debug_exceptions.rb:17:in `call'
    _, headers, body = response = @app.call(env)
  action_dispatch/middleware/show_exceptions.rb:30:in `call'
    @app.call(env)
  rails/rack/logger.rb:38:in `call_app'
    resp = @app.call(env)
  rails/rack/logger.rb:20:in `block in call'
    logger.tagged(compute_tags(request)) { call_app(request, env) }
  active_support/tagged_logging.rb:68:in `block in tagged'
    formatter.tagged(*tags) { yield self }
  active_support/tagged_logging.rb:26:in `tagged'
    yield self
  active_support/tagged_logging.rb:68:in `tagged'
    formatter.tagged(*tags) { yield self }
  rails/rack/logger.rb:20:in `call'
    logger.tagged(compute_tags(request)) { call_app(request, env) }
  action_dispatch/middleware/request_id.rb:21:in `call'
    @app.call(env).tap { |_status, headers, _body| headers["X-Request-Id"] = env["action_dispatch.request_id"] }
  rack/methodoverride.rb:21:in `call'
    @app.call(env)
  rack/runtime.rb:17:in `call'
    status, headers, body = @app.call(env)
  active_support/cache/strategy/local_cache.rb:83:in `call'
    @app.call(env)
  action_dispatch/middleware/static.rb:64:in `call'
    @app.call(env)
  rack/sendfile.rb:112:in `call'
    status, headers, body = @app.call(env)
  librato/rack.rb:94:in `process_request'
    response = @app.call(env)
  librato/rack.rb:64:in `call'
    response, duration = process_request(env)
  raven/rack.rb:59:in `call'
    response = @app.call(env)
  rails/engine.rb:511:in `call'
    app.call(env)
  rails/application.rb:97:in `call'
    super(env)
  rails/railtie/configurable.rb:30:in `method_missing'
    instance.send(*args, &block)
  unicorn/http_server.rb:580:in `process_client'
    status, headers, body = @app.call(env = @request.read(client))
  unicorn/http_server.rb:660:in `worker_loop'
    process_client(client)
  new_relic/agent/instrumentation/unicorn_instrumentation.rb:22:in `call'
    old_worker_loop.bind(self).call(worker)
  new_relic/agent/instrumentation/unicorn_instrumentation.rb:22:in `block (4 levels) in <top (required)>'
    old_worker_loop.bind(self).call(worker)
  unicorn/http_server.rb:527:in `spawn_missing_workers'
    worker_loop(worker)
  unicorn/http_server.rb:538:in `maintain_worker_count'
    off < 0 and return spawn_missing_workers
  unicorn/http_server.rb:303:in `join'
    maintain_worker_count if respawn
  bundle/ruby/2.1.0/gems/unicorn-4.7.0/bin/unicorn:126:in `<top (required)>'
    Unicorn::HttpServer.new(app, options).start.join
  bundle/ruby/2.1.0/bin/unicorn:23:in `load'
    load Gem.bin_path('unicorn', 'unicorn', version)
  bundle/ruby/2.1.0/bin/unicorn:23:in `<main>'
    load Gem.bin_path('unicorn', 'unicorn', version)
jipiboily commented 10 years ago

In which app did you get that? It's probably not the case, but it might be related to the args column being JSON if it's in a new app? If so, it should be fixed (sort of) by https://github.com/rainforestapp/queue_classic_admin/pull/23.

smathieu commented 10 years ago

I might have fixed a while ago.