ts:index gives ArgumentError: wrong number of arguments (given 1, expected 0)

Kiril's Avatar

Kiril

23 Apr, 2018 06:19 AM

Hi,

Using flying-sphinx (2.0.0). For the last couple of weeks the error below is occurring and I can not understand why.

heroku run rake ts:index --trace
Running rake ts:index --trace on ⬢ myapp... up, run.3315 (Standard-1X)
** Invoke ts:index (first_time)
** Invoke ts:sql:index (first_time)
** Invoke environment (first_time)
** Execute environment
** [NewRelic][2018-04-23 06:16:15 +0000 run.* (4)] INFO : Starting the New Relic agent version 5.0.0.342 in "production" environment.
** [NewRelic][2018-04-23 06:16:15 +0000 run.* (4)] INFO : To prevent agent startup add a NEW_RELIC_AGENT_ENABLED=false environment variable or modify the "production" section of your newrelic.yml.
** [NewRelic][2018-04-23 06:16:15 +0000 run.* (4)] INFO : Reading configuration from config/newrelic.yml (/app)
** [NewRelic][2018-04-23 06:16:15 +0000 run.* (4)] INFO : Environment: production
** [NewRelic][2018-04-23 06:16:15 +0000 run.* (4)] INFO : No known dispatcher detected.
** [NewRelic][2018-04-23 06:16:15 +0000 run.* (4)] INFO : Application: myapp
** [NewRelic][2018-04-23 06:16:15 +0000 run.* (4)] INFO : NewRelic::Agent::Samplers::DelayedJobSampler not available: No DJ worker present. Skipping DJ queue sampler
** [NewRelic][2018-04-23 06:16:15 +0000 run.* (4)] INFO : Installing ActiveJob instrumentation
** [NewRelic][2018-04-23 06:16:15 +0000 run.* (4)] INFO : Installing Net instrumentation
** [NewRelic][2018-04-23 06:16:15 +0000 run.* (4)] INFO : Installing Rails 3+ middleware instrumentation
** [NewRelic][2018-04-23 06:16:15 +0000 run.* (4)] INFO : Installing ActiveRecord 5 instrumentation
** [NewRelic][2018-04-23 06:16:15 +0000 run.* (4)] INFO : Installing http.rb instrumentation
** [NewRelic][2018-04-23 06:16:15 +0000 run.* (4)] INFO : Installing DelayedJob instrumentation [part 1/2]
** [NewRelic][2018-04-23 06:16:15 +0000 run.* (4)] INFO : Installing deferred Rack::Builder instrumentation
** [NewRelic][2018-04-23 06:16:15 +0000 run.* (4)] INFO : Installing Rack::Builder middleware instrumentation
** [NewRelic][2018-04-23 06:16:15 +0000 run.* (4)] INFO : Installing middleware-based Excon instrumentation
** [NewRelic][2018-04-23 06:16:15 +0000 run.* (4)] INFO : Installing Memcache instrumentation for dalli gem
** [NewRelic][2018-04-23 06:16:15 +0000 run.* (4)] INFO : Installing Rails 5 view instrumentation
** [NewRelic][2018-04-23 06:16:15 +0000 run.* (4)] INFO : Installing Rails 5 Controller instrumentation
** [NewRelic][2018-04-23 06:16:15 +0000 run.* (4)] INFO : Installing Rails 5 Action Cable instrumentation
** [NewRelic][2018-04-23 06:16:15 +0000 run.* (4)] INFO : Finished instrumentation
** Execute ts:sql:index
I, [2018-04-23T06:16:17.263965 #4] INFO -- : Executing Action: configure
** [NewRelic][2018-04-23 06:16:17 +0000 run.* (4)] INFO : Reporting to: https://rpm.newrelic.com/accounts/1033211/applications/7427641
I, [2018-04-23T06:16:19.329152 #4] INFO -- : Action Finished: configure
rake aborted!
ArgumentError: wrong number of arguments (given 1, expected 0)
/app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.6/lib/active_record/relation.rb:492:in `delete_all'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-5.0.0.342/lib/new_relic/agent/instrumentation/active_record_prepend.rb:36:in `block in delete_all'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-5.0.0.342/lib/new_relic/agent.rb:620:in `with_database_metric_name'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-5.0.0.342/lib/new_relic/agent/instrumentation/active_record_prepend.rb:35:in `delete_all'
/app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.6/lib/active_record/querying.rb:8:in `delete_all'
/app/vendor/bundle/ruby/2.4.0/gems/flying-sphinx-2.0.0/lib/flying_sphinx/commands/index_sql.rb:21:in `clear_jobs'
/app/vendor/bundle/ruby/2.4.0/gems/flying-sphinx-2.0.0/lib/flying_sphinx/commands/index_sql.rb:8:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/flying-sphinx-2.0.0/lib/flying_sphinx/commands/base.rb:21:in `call_with_handling'
/app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-4.0.0/lib/thinking_sphinx/commands/base.rb:7:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-4.0.0/lib/thinking_sphinx/commander.rb:7:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-4.0.0/lib/thinking_sphinx/interfaces/base.rb:9:in `command'
/app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-4.0.0/lib/thinking_sphinx/interfaces/sql.rb:26:in `index'
/app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-4.0.0/lib/thinking_sphinx/tasks.rb:49:in `block (3 levels) in <top (required)>'
/app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `block in execute'
/app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `each'
/app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `execute'
/app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/lib/rake/task.rb:213:in `block in invoke_with_call_chain'
/app/vendor/ruby-2.4.1/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
/app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/lib/rake/task.rb:193:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/lib/rake/task.rb:237:in `block in invoke_prerequisites'
/app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/lib/rake/task.rb:235:in `each'
/app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/lib/rake/task.rb:235:in `invoke_prerequisites'
/app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/lib/rake/task.rb:212:in `block in invoke_with_call_chain'
/app/vendor/ruby-2.4.1/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
/app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/lib/rake/task.rb:193:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/lib/rake/task.rb:182:in `invoke'
/app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/lib/rake/application.rb:160:in `invoke_task'
/app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `each'
/app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block in top_level'
/app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/lib/rake/application.rb:125:in `run_with_threads'
/app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/lib/rake/application.rb:110:in `top_level'
/app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/lib/rake/application.rb:83:in `block in run'
/app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/lib/rake/application.rb:186:in `standard_exception_handling'
/app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/lib/rake/application.rb:80:in `run'
/app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/app/vendor/bundle/ruby/2.4.0/bin/rake:23:in `load'
/app/vendor/bundle/ruby/2.4.0/bin/rake:23:in `<top (required)>'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `load'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:27:in `run'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/cli.rb:360:in `exec'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/cli.rb:20:in `dispatch'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/cli.rb:10:in `start'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/exe/bundle:30:in `block in <top (required)>'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/exe/bundle:22:in `<top (required)>'
/app/bin/bundle:3:in `load'
/app/bin/bundle:3:in `<main>'
Tasks: TOP => ts:index => ts:sql:index
** [NewRelic][2018-04-23 06:16:19 +0000 run.* (4)] INFO : Starting Agent shutdown

  1. 1 Posted by Kiril on 23 Apr, 2018 08:40 AM

    Kiril's Avatar

    ts:rebuild is passing successfully

  2. 2 Posted by Kiril on 23 Apr, 2018 08:51 AM

    Kiril's Avatar

    Problem seems to be in this code

    flying-sphinx-2.0.0/lib/flying_sphinx/commands/index_sql.rb where clear_jobs is called.

    clear_jobs calls for
     
    Delayed::Job.delete_all("handler LIKE '--- !ruby/object:FlyingSphinx::%'")
    and this returns an error

    ArgumentError: wrong number of arguments (given 1, expected 0)

  3. 3 Posted by Kiril on 23 Apr, 2018 09:25 AM

    Kiril's Avatar

    Pull request with where I think the problem is - https://github.com/flying-sphinx/flying-sphinx/pull/19

  4. 4 Posted by Kiril on 23 Apr, 2018 10:52 AM

    Kiril's Avatar

    The problem is resolved with the pull request

  5. Support Staff 5 Posted by Pat Allan on 23 Apr, 2018 12:00 PM

    Pat Allan's Avatar

    Thanks so much for not only reporting this bug, but fixing it! Great to know your patch is working well for you now 👍

  6. Pat Allan closed this discussion on 23 Apr, 2018 12:00 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac