views:

87

answers:

3

I am trying to use heroku and appear to be getting a Postgres error but don't have enough information to know what to fix.

The error is below, and it looks like it is trying to run delayed_job:

> PGError: ERROR:  value too long for
> type character varying(255) : UPDATE
> "delayed_jobs" SET "updated_at" =
> '2010-09-12 01:06:59.354515', "last_e
> rror" = E'undefined method `subject''
> for #<YAML::Object:0x2b19faeca308>

Here is how I invoke it from a cron.rake:

    Delayed::Job.enqueue SomeMailJob.new(contact,contact_email)

SomeMailJob is defined through this file:

 class SomeMailJob < Struct.new(:contact, :contact_email) 
   def perform
     OutboundMailer.deliver_campaign_email(contact,contact_email)
   end
 end

It "looks" like the database for delayed_jobs is trying to be updated with something funky but I have no idea what that could be.....

A: 

Looks like the underlying error is from calling "subject" on an object that doesn't have that method defined.

Toby Hede
How can I figure out what that object is, it doesn't give me enough information to figure that out (I don't know why it would be calling that method)....
Angela
+1  A: 

The postgres error is occurring when the delayed job worker process tries to store the result of running the job (which was a separate error, btw).

Check your delayed_jobs table, specifically the last_error column. It should be a text column but it looks like yours is a string.

tfe
Hi, how do I check it -- I used the migration built into the plugin so that seems odd it would be off....let me check what the migration table was....
Angela
yes the migration for the plugin makes last_error string instead of text....I can change the migration -- but maybe should let the guys who own the plugin know...
Angela
Hmm...looks like they wrote it that way: http://github.com/pedro/delayed_job -- but they put a note to make the change just as you suggested, so will give it a go!
Angela
A: 

Hi Angela

Seems like you are trying to enter a value, which has more than 255 chars in to a column which has the max chars 255.

cheers

sameera

sameera207