Rebake error when posts contain deleted YouTube video


(Jacob) #1
2013-10-19T03:57:52Z 17032 TID-oxerz43sw WARN: undefined method `each' for nil:NilClass
2013-10-19T03:57:52Z 17032 TID-oxerz43sw WARN: /var/www/discourse/lib/oneboxer/youtube_onebox.rb:12:in `onebox'
/var/www/discourse/lib/oneboxer.rb:53:in `onebox_nocache'
/var/www/discourse/lib/oneboxer.rb:143:in `fetch_and_cache'
/var/www/discourse/lib/oneboxer.rb:184:in `onebox'
/var/www/discourse/lib/cooked_post_processor.rb:73:in `block in post_process_oneboxes'
/var/www/discourse/lib/oneboxer.rb:109:in `block in apply'
/var/www/discourse/lib/oneboxer.rb:95:in `block in each_onebox_link'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/nokogiri-1.6.0/lib/nokogiri/xml/node_set.rb:237:in `block in each'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/nokogiri-1.6.0/lib/nokogiri/xml/node_set.rb:236:in `upto'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/nokogiri-1.6.0/lib/nokogiri/xml/node_set.rb:236:in `each'
/var/www/discourse/lib/oneboxer.rb:93:in `each_onebox_link'
/var/www/discourse/lib/oneboxer.rb:108:in `apply'
/var/www/discourse/lib/cooked_post_processor.rb:72:in `post_process_oneboxes'
/var/www/discourse/lib/cooked_post_processor.rb:22:in `post_process'
/var/www/discourse/app/jobs/regular/process_post.rb:18:in `execute'
/var/www/discourse/app/jobs/base.rb:128:in `block (2 levels) in perform'

I just switched to a new domain. I made sure I ran RAILS_ENV=production bundle exec rake posts:rebake not sure what to do to fix this.
Any help is greatly appreciated!


(Jacob) #2

Okay I found out it’s because it’s because the Youtube removed the videos. It didn’t start failing jobs in Sidekiq untl I rebaked the posts.


(Jeff Atwood) #3

So you are saying rebake fails with an error if it attempts to rebake a post with a YouTube video that has been removed?


(Jacob) #4

Yes, after the rebake three jobs were failing and each post had a different YouTube video that had been removed. I removed the three links and everything is good.


(Jeff Atwood) #5

Does our rebake process handle this gracefully now @zogstrip? I suspect it might since we have done a lot more rebaking since then…


(Jeff Atwood) #6

I am rather confident this is fixed, so closing.


(Jeff Atwood) #7