Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Occasionally getting "undefined method `[]' for nil:NilClass" errors in salesforce_bulk_api gem #54

Open
thomasdziedzic opened this issue Sep 21, 2015 · 1 comment

Comments

@thomasdziedzic
Copy link
Contributor

I suspect that this is due to salesforce sending a response that this gem doesn't expect.

/u/apps/pd_bizops_integration/shared/bundle/ruby/2.2.0/gems/activerecord-3.2.17/lib/active_record/associations/has_many_association.rb:80: warning: circular argument reference - reflection
/u/apps/pd_bizops_integration/shared/bundle/ruby/2.2.0/gems/railties-3.2.17/lib/rails/commands/runner.rb:54:in `eval': undefined method `[]' for nil:NilClass (NoMethodError)
        from /u/apps/pd_bizops_integration/shared/bundle/ruby/2.2.0/gems/salesforce_bulk_api-0.0.12/lib/salesforce_bulk_api/job.rb:175:in `each'
        from /u/apps/pd_bizops_integration/shared/bundle/ruby/2.2.0/gems/salesforce_bulk_api-0.0.12/lib/salesforce_bulk_api/job.rb:175:in `block in get_job_result'
        from /usr/local/rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/timeout.rb:89:in `block in timeout'
        from /usr/local/rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/timeout.rb:99:in `call'
        from /usr/local/rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/timeout.rb:99:in `timeout'
        from /u/apps/pd_bizops_integration/shared/bundle/ruby/2.2.0/gems/salesforce_bulk_api-0.0.12/lib/salesforce_bulk_api/job.rb:172:in `get_job_result'
        from /u/apps/pd_bizops_integration/shared/bundle/ruby/2.2.0/gems/salesforce_bulk_api-0.0.12/lib/salesforce_bulk_api.rb:79:in `do_operation'
        from /u/apps/pd_bizops_integration/shared/bundle/ruby/2.2.0/gems/salesforce_bulk_api-0.0.12/lib/salesforce_bulk_api.rb:29:in `update'
        from /u/apps/pd_bizops_integration/releases/20150821062234/lib/sfdc.rb:49:in `do_bulk!'
        from /u/apps/pd_bizops_integration/releases/20150821062234/lib/sfdc.rb:26:in `update_object!'
        from /u/apps/pd_bizops_integration/releases/20150821062234/lib/sfdc.rb:18:in `update_transaction_object!'
        from /u/apps/pd_bizops_integration/releases/20150821062234/app/models/tasks/sfdc_transaction_updater.rb:49:in `update'
        from /u/apps/pd_bizops_integration/releases/20150821062234/app/models/tasks/sfdc_transaction_updater.rb:6:in `block in run'
        from /u/apps/pd_bizops_integration/releases/20150821062234/lib/cron_utils.rb:26:in `call'
        from /u/apps/pd_bizops_integration/releases/20150821062234/lib/cron_utils.rb:26:in `block (2 levels) in run_with_lock_and_benchmark'
        from /u/apps/pd_bizops_integration/releases/20150821062234/lib/cron_utils.rb:16:in `block in filelock'
        from /u/apps/pd_bizops_integration/releases/20150821062234/lib/cron_utils.rb:14:in `open'
        from /u/apps/pd_bizops_integration/releases/20150821062234/lib/cron_utils.rb:14:in `filelock'
        from /u/apps/pd_bizops_integration/releases/20150821062234/lib/cron_utils.rb:25:in `block in run_with_lock_and_benchmark'
        from /usr/local/rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/benchmark.rb:303:in `realtime'
        from /u/apps/pd_bizops_integration/releases/20150821062234/lib/cron_utils.rb:24:in `run_with_lock_and_benchmark'
        from /u/apps/pd_bizops_integration/releases/20150821062234/app/models/tasks/sfdc_transaction_updater.rb:5:in `run'
        from (eval):1:in `<top (required)>'
        from /u/apps/pd_bizops_integration/shared/bundle/ruby/2.2.0/gems/railties-3.2.17/lib/rails/commands/runner.rb:54:in `eval'
        from /u/apps/pd_bizops_integration/shared/bundle/ruby/2.2.0/gems/railties-3.2.17/lib/rails/commands/runner.rb:54:in `<top (required)>'
        from /u/apps/pd_bizops_integration/shared/bundle/ruby/2.2.0/gems/railties-3.2.17/lib/rails/commands.rb:64:in `require'
        from /u/apps/pd_bizops_integration/shared/bundle/ruby/2.2.0/gems/railties-3.2.17/lib/rails/commands.rb:64:in `<top (required)>'
        from script/rails:12:in `require'
        from script/rails:12:in `<main>'

Edit: I added logging functionality around the issue at:
https://github.com/PagerDuty/salesforce_bulk_api/commit/401239a46641c6e7fda75e4d28e4b1701931c422

@polycarpou
Copy link

I am running into this issue as well. Did you find any more info about this?

hackbac pushed a commit to hackbac/salesforce_bulk_api that referenced this issue Jul 13, 2017
Occasionally, the results of either
`check_job_status` or `check_batch_status` return
nil. This commit adds conditions to protect
against evaluating a NilClass.

Error:
undefined method `[]' for nil:NilClass (NoMethodError)
yatish27 added a commit that referenced this issue Jul 13, 2017
[Issue #54] Fix NilClass evaluation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants