tobi / delayed_job

Database backed asynchronous priority queue -- Extracted from Shopify
http://tobi.github.com/delayed_job
MIT License
2.15k stars 1.25k forks source link

Delayed_job returns “syntax error” for process daemon and rake task #40

Open jonpaul opened 13 years ago

jonpaul commented 13 years ago

This is basically a copy of my question here: http://stackoverflow.com/questions/5383625/delayed-job-returns-syntax-error-for-process-daemon-and-rake-task

However, it seemed appropriate to re-post the question in effort to generate some form of backlog for delayed_job.

Started to have an issue this afternoon with the delayed_job process, found that the daemons were dead and restarted them...

Roughly 40 minutes later the process died again @ 86 jobs. Tried to start the daemons again and found they quietly died immediately after I start them. Checking the log I found:

s603021@ec2-184-72-244-232:~/rails/gamestreamer/current$ tail -F log/delayed_job.log 
  SQL (0.7ms)   SET NAMES 'utf8'
  SQL (0.8ms)   SET SQL_AUTO_IS_NULL=0
*** Starting job worker delayed_job.4 host:ec2-184-72-244-232.compute-1.amazonaws.com pid:17397
  Delayed::Job Columns (1.5ms)   SHOW FIELDS FROM `delayed_jobs`
  Product Columns (1.5ms)   SHOW FIELDS FROM `products`
  Game Columns (2.4ms)   SHOW FIELDS FROM `games`
  Delayed::Job Update (12.8ms)   UPDATE `delayed_jobs` SET locked_by = null, locked_at = null WHERE (locked_by = 'delayed_job.4 host:ec2-184-72-244-232.compute-1.amazonaws.com pid:17397') 
#<ArgumentError: syntax error on line 1588, col 10: `'>

I went ahead and did some digging, a lot of people used to find the daemon gem for delayed_jobs was bugged, and the rake task still worked; this was not the case for me however:

s603021@ec2-184-72-244-232:~/rails/gamestreamer/current$ RAILS_ENV=gs1_development rake jobs:work --trace
(in /data01/home/s603021/rails/gamestreamer/releases/20110302193304)
** Invoke jobs:work (first_time)
** Invoke merb_env (first_time)
** Execute merb_env
** Invoke environment (first_time)
** Execute environment
** Execute jobs:work
*** Starting job worker host:ec2-184-72-244-232.compute-1.amazonaws.com pid:17082
rake aborted!
syntax error on line 1588, col 10: `'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/yaml.rb:133:in `load'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/yaml.rb:133:in `load'
/data01/home/s603021/rails/gamestreamer/releases/20110302193304/vendor/plugins/delayed_job/lib/delayed/job.rb:234:in `deserialize'
/data01/home/s603021/rails/gamestreamer/releases/20110302193304/vendor/plugins/delayed_job/lib/delayed/job.rb:50:in `payload_object'
/data01/home/s603021/rails/gamestreamer/releases/20110302193304/vendor/plugins/delayed_job/lib/delayed/job.rb:55:in `name'
/data01/home/s603021/rails/gamestreamer/releases/20110302193304/vendor/plugins/delayed_job/lib/delayed/job.rb:90:in `run_with_lock'
/data01/home/s603021/rails/gamestreamer/releases/20110302193304/vendor/plugins/delayed_job/lib/delayed/job.rb:159:in `reserve_and_run_one_job'
/data01/home/s603021/rails/gamestreamer/releases/20110302193304/vendor/plugins/delayed_job/lib/delayed/job.rb:158:in `each'
/data01/home/s603021/rails/gamestreamer/releases/20110302193304/vendor/plugins/delayed_job/lib/delayed/job.rb:158:in `reserve_and_run_one_job'
/data01/home/s603021/rails/gamestreamer/releases/20110302193304/vendor/plugins/delayed_job/lib/delayed/job.rb:205:in `work_off'
/data01/home/s603021/rails/gamestreamer/releases/20110302193304/vendor/plugins/delayed_job/lib/delayed/job.rb:204:in `times'
/data01/home/s603021/rails/gamestreamer/releases/20110302193304/vendor/plugins/delayed_job/lib/delayed/job.rb:204:in `work_off'
/data01/home/s603021/rails/gamestreamer/releases/20110302193304/vendor/plugins/delayed_job/lib/delayed/worker.rb:30:in `start'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/data01/home/s603021/rails/gamestreamer/releases/20110302193304/vendor/plugins/delayed_job/lib/delayed/worker.rb:29:in `start'
/data01/home/s603021/rails/gamestreamer/releases/20110302193304/vendor/plugins/delayed_job/lib/delayed/worker.rb:26:in `loop'
/data01/home/s603021/rails/gamestreamer/releases/20110302193304/vendor/plugins/delayed_job/lib/delayed/worker.rb:26:in `start'
/data01/home/s603021/rails/gamestreamer/releases/20110302193304/vendor/plugins/delayed_job/lib/delayed/tasks.rb:13
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

Now I'm simply not sure what could possibly be the problem, any advice on how to get more information(or a more verbose exception) would be awesome. If anyone can help me to solve it, that'd be unbelievable. Thanks in advance--

Job.rb File: http://pastie.org/1697465

simianarmy commented 13 years ago

This is DJ choking while attempting to deserialize the "handler" attribute of the job record. As you an see in the last line, it is a YAML exception thrown during YAML.load().