Netflix-Skunkworks / Scumblr

Web framework that allows performing periodic syncs of data sources and performing analysis on the identified results
Apache License 2.0
2.64k stars 317 forks source link

google task fails #200

Closed tDorosheff closed 7 years ago

tDorosheff commented 7 years ago

Hey Andy, im back at scumblr 2.0 with the latest code pulled. When attempting to execute a google search through the UI, i get the following error:

Unable to run task google pastebin "aol.com". Error: undefined method[]' for nil:NilClass ["/home/ubuntu/Scumblr/lib/search_providers/provider.rb:113:in create_event'", "/home/ubuntu/Scumblr/lib/search_providers/provider.rb:92:increate_error'", "/home/ubuntu/Scumblr/lib/search_providers/provider.rb:33:in block in initialize'", "/home/ubuntu/Scumblr/lib/search_providers/provider.rb:30:ineach'", "/home/ubuntu/Scumblr/lib/search_providers/provider.rb:30:in initialize'", "/home/ubuntu/Scumblr/lib/search_providers/google.rb:73:ininitialize'", "/home/ubuntu/Scumblr/app/models/task.rb:137:in new'", "/home/ubuntu/Scumblr/app/models/task.rb:137:inperform_task'", "/home/ubuntu/Scumblr/app/workers/task_worker.rb:30:in perform'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/processor.rb:155:inexecute_job'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/processor.rb:136:in block (3 levels) in process'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/middleware/chain.rb:128:inblock in invoke'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-status-0.6.0/lib/sidekiq-status/server_middleware.rb:37:in call'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/middleware/chain.rb:130:inblock in invoke'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/middleware/server/active_record.rb:6:in call'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/middleware/chain.rb:130:inblock in invoke'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/middleware/server/retry_jobs.rb:74:in call'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/middleware/chain.rb:130:inblock in invoke'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/middleware/server/logging.rb:11:in block in call'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/logging.rb:32:inwith_context'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/middleware/server/logging.rb:7:in call'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/middleware/chain.rb:130:inblock in invoke'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/middleware/chain.rb:133:in invoke'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/processor.rb:131:inblock (2 levels) in process'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/processor.rb:171:in stats'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/processor.rb:130:inblock in process'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq.rb:35:in block in <module:Sidekiq>'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/processor.rb:122:inprocess'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/processor.rb:81:in process_one'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/processor.rb:69:inrun'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/util.rb:17:in watchdog'", "/home/ubuntu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/util.rb:25:inblock in safe_thread'"]`

Have configured the google api key and cx key in scumblr.rb, here is what my google search section of scumblr.rb looks like: # Google config.google_application_name = ENV["Scumblr"] config.google_application_version = ENV["1.0"] config.google_developer_key = ENV["AIzaSyB1s7rG4O2T6iyRiJIooFwdKojgiwFZpW4"] config.google_cx = ENV["006080577954105511262:4qngovjre4k"]

Everything during the setup process went perfectly fine, no errors of any kind. Just finished setting it up today.

sbehrens commented 7 years ago

I think the issue is in the config here

config.google_developer_key = ENV["AIzaSyB1s7rG4O2T6iyRiJIooFwdKojgiwFZpW4"] config.google_cx = ENV["006080577954105511262:4qngovjre4k"]

ENV is short for envionrment variable. If you are not storing your code as envionrment variables you'll want to just set the value to a string.

sbehrens commented 7 years ago
config.google_developer_key = "AIzaSyB1s7rG4O2T6iyRiJIooFwdKojgiwFZpW4"
tDorosheff commented 7 years ago

Thanks Andy, that worked! Im gonna have some more questions to shoot you soon most likely, specifically related to using the rails console to bulk create tasks like i did in the past on V1 with searches. Although maybe there is some cool new Scumblr V2 feature that i dont know about yet that allows me to bulk create tasks?

sbehrens commented 7 years ago

Hi @tDorosheff,

We haven't made any changes to bulk task creation, so the rails console will be the best option for those use cases.

Thanks, Scott