"ass" expception, genuine error not a spam

18 views
Skip to first unread message

badnaam

unread,
Oct 5, 2010, 1:33:42 PM10/5/10
to Searchlogic
No kidding. Searchlogic is raising this exception during a delayed_job
execution. It's a long story, at first we thought it was Delayed_job
or something else, but it seems it's coming from Searchlogic. Not sure
why in this particular situation or in combination with Delayed Job.

I request you read this thread for more information.

http://groups.google.com/group/delayed_job/browse_thread/thread/4640f42792ae2a9d

This is happening in my production pilot, so any help will be greatly
appreciated!

Happy to provide more info.

Thanks

badnaam

unread,
Oct 5, 2010, 1:36:03 PM10/5/10
to Searchlogic
Here is the stack trace

http://pastie.org/1201142


On Oct 5, 10:33 am, badnaam <asitkmis...@gmail.com> wrote:
> No kidding. Searchlogic is raising this exception during a delayed_job
> execution. It's a long story, at first we thought it was Delayed_job
> or something else, but it seems it's coming from Searchlogic. Not sure
> why in this particular situation or in combination with Delayed Job.
>
> I request you read this thread for more information.
>
> http://groups.google.com/group/delayed_job/browse_thread/thread/4640f...

Ben Johnson

unread,
Oct 5, 2010, 1:45:15 PM10/5/10
to searc...@googlegroups.com
Ha ha, my apologies. Serializing a search object to yaml is still under development. I will remove this error.

Ben Johnson
Binary Logic

W: www.binarylogic.com
E: bjoh...@binarylogic.com

> --
> You received this message because you are subscribed to the Google Groups "Searchlogic" group.
> To post to this group, send email to searc...@googlegroups.com.
> To unsubscribe from this group, send email to searchlogic...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/searchlogic?hl=en.
>

badnaam

unread,
Oct 5, 2010, 1:47:47 PM10/5/10
to Searchlogic
No worries Ben. We all had a good laugh. What's the solution in the
meantime though or are you pushing out a fix?

Thanks for the quick response!

Ben Johnson

unread,
Oct 5, 2010, 1:48:45 PM10/5/10
to searc...@googlegroups.com
I'm removing that line. I need to run some more tests on serializing a search object. I believe it works as expected, but lets just say that feature is in beta.

Ben Johnson
Binary Logic

W: www.binarylogic.com
E: bjoh...@binarylogic.com

Ben Johnson

unread,
Oct 5, 2010, 1:53:47 PM10/5/10
to searc...@googlegroups.com
Also, if you are passing a search object to delayed_job you might consider breaking this down into more simple objects. Such as passing in the scope and the conditions and reconstructing the object. I try to keep the parameters passed to delayed_job to be basic ruby objects.

Hope this helps.

Ben Johnson
Binary Logic

W: www.binarylogic.com
E: bjoh...@binarylogic.com

badnaam

unread,
Oct 5, 2010, 1:55:52 PM10/5/10
to Searchlogic
Ok, cool. Let me know if you need more info from my environement. Not
sure why this serialization is happening only in this case.

Just so I understand, should I pull the new version/copy of the gem or
how do I get the update?

On Oct 5, 10:48 am, Ben Johnson <bjohn...@binarylogic.com> wrote:
> I'm removing that line. I need to run some more tests on serializing a search object. I believe it works as expected, but lets just say that feature is in beta.
>
> Ben Johnson
> Binary Logic
>
> W:www.binarylogic.com
> E: bjohn...@binarylogic.com

Ben Johnson

unread,
Oct 5, 2010, 2:00:33 PM10/5/10
to searc...@googlegroups.com
I just released a new version.

But yeah, I would try to understand why a complex object is being passed a parameter to delayed job. What I do right now for example:

@search = current_user.orders
Whatever.send_later(@search.scope, @search.conditions)

I pass those parameters because they are easily serialized. Then I reconstruct the object on the backend:

search = User.scoped(scope).search(conditions)


Hope that helps.


Ben Johnson
Binary Logic

W: www.binarylogic.com
E: bjoh...@binarylogic.com

badnaam

unread,
Oct 5, 2010, 2:15:23 PM10/5/10
to Searchlogic
This particular job is a mail delivery job "new_post_notification"
method in Notifier, that takes a post object as a parameter.
There are other similar jobs, like new_user_activation instruction
@user, which take a complex object too i.e. User object and they work
just fine.

What might be happening in this case, is that this Post model is also
a scoped friendly_id model and I constantly run into issues where if I
do a

Post.find ('friendly_id_of_that_post'), the find fails, complaining a
scope (i.e. category) is missing. so If I do a

Post.find('friendly_id_of_that_post', :scope =>
'category_of_that_post') then it works.

The post object being passed in this case does not include the
category

@post = Post.create(params[:post_id])
Notifier.delay.deliver_new_post_notification @post

Pls bear with me, I am far from an expert Ruby programmer, but does it
have any bearing on this error/condition?


On Oct 5, 11:00 am, Ben Johnson <bjohn...@binarylogic.com> wrote:
> I just released a new version.
>
> But yeah, I would try to understand why a complex object is being passed a parameter to delayed job. What I do right now for example:
>
> @search = current_user.orders
> Whatever.send_later(@search.scope, @search.conditions)
>
> I pass those parameters because they are easily serialized. Then I reconstruct the object on the backend:
>
> search = User.scoped(scope).search(conditions)
>
> Hope that helps.
>
> Ben Johnson
> Binary Logic
>
> W:www.binarylogic.com

Ben Johnson

unread,
Oct 5, 2010, 2:20:05 PM10/5/10
to searc...@googlegroups.com
I don't see a problem with that. ActiveRecord objects are actually simplified within delayed job by just passing the id of the object and reloading it on the backend. So that shouldn't be a problem.

Ben Johnson
Binary Logic

W: www.binarylogic.com
E: bjoh...@binarylogic.com

badnaam

unread,
Oct 5, 2010, 2:23:24 PM10/5/10
to Searchlogic
I don't understand, this @post object is coming straight from a
Post.create call. Why it is being considered a SearchLogic Search
object?

On Oct 5, 11:20 am, Ben Johnson <bjohn...@binarylogic.com> wrote:
> I don't see a problem with that. ActiveRecord objects are actually simplified within delayed job by just passing the id of the object and reloading it on the backend. So that shouldn't be a problem.
>
> Ben Johnson
> Binary Logic
>
> W:www.binarylogic.com

Ben Johnson

unread,
Oct 5, 2010, 2:25:06 PM10/5/10
to searc...@googlegroups.com
I'm not sure, maybe its buried somewhere in that object. Perhaps you're using it in a method or something and saving it to an instance variable. Try updating, and let me know if that fixes it.

Ben Johnson
Binary Logic

W: www.binarylogic.com
E: bjoh...@binarylogic.com

badnaam

unread,
Oct 5, 2010, 2:38:13 PM10/5/10
to Searchlogic
Yep works now! Thanks a bunch! Exciting start to the morning! :)

On Oct 5, 11:25 am, Ben Johnson <bjohn...@binarylogic.com> wrote:
> I'm not sure, maybe its buried somewhere in that object. Perhaps you're using it in a method or something and saving it to an instance variable. Try updating, and let me know if that fixes it.
>
> Ben Johnson
> Binary Logic
>
> W:www.binarylogic.com
Reply all
Reply to author
Forward
0 new messages