Closed dbanck closed 11 years ago
Have you test it with simple echo "something"
or var_dump("some text")
? And also can you see any detail error in your php log?
Yes, I've tried that.
I've set log_errors
and error_log
, but php isn't logging anything else.
Hmm... its weird, I've created exactly like yours, I put this on my site controller :
Yii::app()->resque->createJob('default', 'Worker_GetFacebookUser');
die();
I create GetFacebookUser.php
and put it in Worker
folder :
<?php
/**
* Worker for getting information from facebook about a user
*/
class Worker_GetFacebookUser
{
public function setUp()
{
}
public function perform()
{
var_dump($this);
}
public function tearDown()
{
}
}
run worker with this command in my root app :
./protected/yiic rresque start
access my site controller from browser and I got this in my log :
[2013-09-24T19:39:33+00:00] got {"queue":"default","id":"56c5dcc6d124e06a2e5252447b4096db","class":"Worker_GetFacebookUser","args":[[]]}
[2013-09-24T19:39:33+00:00] Processing ID:56c5dcc6d124e06a2e5252447b4096db in default
object(Worker_GetFacebookUser)#7 (3) {
["job"]=>
object(Resque_Job)#6 (4) {
["queue"]=>
string(7) "default"
["worker"]=>
object(Resque_Worker)#4 (10) {
["logOutput"]=>
resource(2) of type (stream)
["logLevel"]=>
int(1)
["queues":protected]=>
array(1) {
[0]=>
string(1) "*"
}
["hostname":protected]=>
string(25) "Roliess-MacBook-Pro.local"
["shutdown":protected]=>
bool(false)
["paused":protected]=>
bool(false)
["id":protected]=>
string(32) "Roliess-MacBook-Pro.local:3179:*"
["currentJob":protected]=>
*RECURSION*
["child":protected]=>
int(0)
["logger":protected]=>
NULL
}
["payload"]=>
array(3) {
["class"]=>
string(22) "Worker_GetFacebookUser"
["args"]=>
array(1) {
[0]=>
array(0) {
}
}
["id"]=>
string(32) "56c5dcc6d124e06a2e5252447b4096db"
}
["instance":"Resque_Job":private]=>
*RECURSION*
}
["args"]=>
array(0) {
}
["queue"]=>
string(7) "default"
}
[2013-09-24T19:39:33+00:00] done ID:56c5dcc6d124e06a2e5252447b4096db
That's really weird. Thanks for your effort.
Do you have any idea why the yii_resque_log.log
contains html as error message? Since the workers are running on the command line, there shouldn't be involved any web server.
Which PHP version are you using?
I've edited bin/resque
and turned up the error reporting.
The error in detail looks like this: http://download.dbanck.de/yii_error.html
what happen if you put die(var_dump(class_exists('Resque_Job_Creator')));
on /home/vagrant/backend/current/protected/components/yii-resque/lib/Resque/Job.php
line 154 just for checking the autoloader is running well.
what version of php that you use? mine is 5.4.11
With the debug statement, the error stays the same, since class_exists
is called and causes the error.
Somehow there is no class with that name:
$ git grep 'Resque_Job_Creator'
lib/Resque/Job.php: if (class_exists('Resque_Job_Creator')) {
lib/Resque/Job.php: $this->instance = Resque_Job_Creator::createJob($this->payload['class'], $this->getArguments());
Looks the auto loader is not working, can you please try change :
Yii::registerAutoloader(array(new self,'autoload'),true);
to
spl_autoload_register(array(new self, 'autoload'));
in RResqueAutoloader.php
line 17
Same error, just another error message: http://download.dbanck.de/yii_error2.html
There is no file named Resque_Job_Creator.php
.
I've fixed it.
Adding these lines to console.php
does the trick:
...
'import' => array(
'application.models.*',
'application.helpers.*',
'application.components.*',
),
...
Thanks again for your help.
I'm facing some problems using yii-resque.
I've created a simple worker:
Now I'm trying to create a new job:
Which produces following log output:
The result inside redis looks like this:
What could cause that error? How can I debug further? Due the lack of documentation I don't know where to start.