Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined index: job #60

Closed
Borkache opened this issue Jun 1, 2016 · 17 comments
Closed

Undefined index: job #60

Borkache opened this issue Jun 1, 2016 · 17 comments

Comments

@Borkache
Copy link

Borkache commented Jun 1, 2016

exception 'ErrorException' with message 'Undefined index: job' in /var/www/api-v1.gdmfx.com/httpdocs/vendor/vladimir-yuldashev/laravel-queue-rabbitmq/src/VladimirYuldashev/LaravelQueueRabbitMQ/Queue/Jobs/RabbitMQJob.php:96

got too many of this errors, got same when used redis as queue, but on laravel site developers told that it can be in case of cross match between cache and queue jobs. What the problem is here maybe laravel side again?

I used this versions
"laravel/framework": "5.1.*",
"vladimir-yuldashev/laravel-queue-rabbitmq": "5.1",

Thanks!

@Borkache
Copy link
Author

Borkache commented Jun 1, 2016

seems problem is here
$body = $this->message->body;
$body = json_decode($body, true);

    $attempts = $this->attempts();

    // write attempts to body
    $body['data']['attempts'] = $attempts + 1;

    $job = $body['job'];
    $data = $body['data'];

in VladimirYuldashev\LaravelQueueRabbitMQ\Queue\Jobs\RabbitMQJob, so maybe can be some kind of situations with wrong message content and maybe you can add some checker

@vyuldashev
Copy link
Owner

Cannot replay the issue. It works for me. Can you provide examples?

@Borkache
Copy link
Author

Borkache commented Jun 7, 2016

trying to catch it near 2 weeks already , I use standard facades for queue in laravel but there is some strange situation when the record in queue is blank , will try to catch again , if will be lucky will paste here, thanks for feedback

@adrenth
Copy link

adrenth commented Nov 4, 2016

Got the same issues with the Undefined index: job, this is still an issue. For some reason the message body cannot be extracted from the message body. This occurs randomly. As of now I cannot reproduce this issue. But this issue should be re-opened.

I'm using: "vladimir-yuldashev/laravel-queue-rabbitmq":"v5.1.x-dev",

@hillelcoren
Copy link

FYI... we're seeing this error randomly as well, we're using redis.

@vyuldashev
Copy link
Owner

@hillelcoren How does applies to this driver?

@vyuldashev vyuldashev reopened this Feb 20, 2017
@vyuldashev
Copy link
Owner

@adrenth Try to catch the exception and provide stack trace, please.

@hillelcoren
Copy link

The problem may be with Laravel rather than this specific driver.

@hillelcoren
Copy link

You can see a stack here: laravel/framework#9555

@vyuldashev
Copy link
Owner

I did not get this kind of error for about 3 years using this driver in production.

@hillelcoren Yeah, @cabloo answered there

For other people who come across this problem: I had the same issue after I forgot to add the 'Illuminate\Queue\SerializesModels' to a Job/Command class. Earlier in the Job/Command pipeline, the json_encode function doesn't know how to serialize Jobs that have models without that function, so json_encode on the array containing the job returns false.

May be this is the issue?

@hillelcoren
Copy link

Thanks, we tracked down the problem. There was an error processing the job payload.

@echnio
Copy link

echnio commented Apr 5, 2017

@hillelcoren Hi,Can you say when this happens? I also encountered this problem, did not find a way to reproduce

@hillelcoren
Copy link

In our case the job payload was failing to be decoded.

@echnio
Copy link

echnio commented Apr 5, 2017

Did you solve it? How to solve it? @hillelcoren

@hillelcoren
Copy link

We fixed it by removing data from the job payload, in our case it was a raw PDF file which caused problems.

@echnio
Copy link

echnio commented Apr 5, 2017

all right,i also fixed it by removing data from the job payload ,thanks

@defaye
Copy link

defaye commented May 31, 2017

I avoided serialization errors by removing some of the instantiation of problem code from the job's __construct() to the handle() method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants