laravel-aws-worker icon indicating copy to clipboard operation
laravel-aws-worker copied to clipboard

Schedule request returns 302

Open ido567 opened this issue 7 years ago • 4 comments

I've installed the package in my project, but it looks like all the requests of '/worker/schedule' returns 302 status code on EB servers. The package works perfectly on my local machine, and I made sure that the 'REGISTER_WORKER_ROUTES' env variable is turned on.

The logs: /var/log/httpd/access_log: 127.0.0.1 (-) - - [16/Jul/2017:19:09:00 +0000] "POST /worker/schedule HTTP/1.1" 302 376 "-" "aws-sqsd/2.3"

/var/log/aws-sqsd/default.log: 2017-07-16T19:14:00Z message: sent to http://localhost:80/worker/schedule 2017-07-16T19:14:00Z http-err: b910dcd1-7713-429c-bfe3-2d5990e0f2fc (2) 302 - 0.037

ido567 avatar Jul 16 '17 19:07 ido567

I hade the same issue but i figure out that App\Http\Kernal line16 ( protected $middleware) was holding it back, just outcomment it and my worker was fixed. However if your using same app as worker you should do a env check :)

bobbygrossmann avatar Sep 07 '17 12:09 bobbygrossmann

My problem was that I added a package which forces all requests to be 'https' and EB requests was 'http'. Disabling this restriction in the worker environment solved this issue. The package uses middleware to check the protocol, so it might be your problem too.

ido567 avatar Sep 07 '17 19:09 ido567

Aha yes i have same flow, will see if its that.

bobbygrossmann avatar Sep 08 '17 05:09 bobbygrossmann

This was also the problem for me. I had an Elasticbeanstalk extension file forcing HTTP redirect.

I modified this with a conditional so it didn't run on the worker, and hey presto. It works.

edward-aslin avatar Jul 25 '19 14:07 edward-aslin