Okay guys, I fixed the issue. And it was a really stupid issue.
I got 2 staging for this application, beta and production. The actual issue was that the MediaAnalyzer is not anymore present in the beta application... And my workers from beta were performing the jobs instead of the workers from the production application.
I didn't pay enough attention to the exception log, it was saying that myapp_beta/
in the backtrace.
The issue is simple to resolve, I just had to namespace the redis/resque with :
Resque.redis.namespace = "resque:myapp_#{Rails.env}"
And add this environment variable to the worker command :
RESQUE_NAMESPACE=resque:myapp_production
(or RESQUE_NAMESPACE=resque:myapp_beta
for beta obviously)
That's why it was random, it was depending on which worker was catching the job, one from the beta or one from the production.