Could not call the function

109 views
Skip to first unread message

mr_jingles

unread,
Feb 6, 2012, 8:26:11 AM2/6/12
to gearman
Hello everyone,

i am using the PHP Gearman Client and getting the following error:

"Warning: GearmanClient::runTasks(): Could not call the function in
[...]"

I have been searching the web for a while but didn't find any hint.
Maybe someone of you has an idea or some helb for me.

Thanks in advance,
Benjamin

Herman Radtke

unread,
Feb 6, 2012, 11:59:38 AM2/6/12
to gea...@googlegroups.com

I have never encountered this myself. Please provide the version of
pecl/gearman and gearmand you are using. Also, please provide the
snippet of code for the addTasks and runTasks calls. We can better
help you with that information.

--
Herman Radtke
herman...@gmail.com | http://hermanradtke.com

mr_jingles

unread,
Feb 6, 2012, 12:32:30 PM2/6/12
to gearman
Hello Herman,

thx for reply.

This is the environment:
extension version 0.8.0
libgearman version 0.14
PHP Version 5.3.6-13ubuntu3.3

The code is an huge abstraction layer, but nothing special. Using
priority and running in foreground.

I let you know, if I have some further information.

Regards,
Benjamin


On 6 Feb., 17:59, Herman Radtke <hermanrad...@gmail.com> wrote:
> On Mon, Feb 6, 2012 at 5:26 AM, mr_jingles
>
> <benjamin.rad...@googlemail.com> wrote:
> > Hello everyone,
>
> > i am using the PHP Gearman Client and getting the following error:
>
> > "Warning: GearmanClient::runTasks(): Could not call the function   in
> > [...]"
>
> > I have been searching the web for a while but  didn't find any hint.
> > Maybe someone of you has an idea or some helb for me.
>
> > Thanks in advance,
> > Benjamin
>
> I have never encountered this myself. Please provide the version of
> pecl/gearman and gearmand you are using. Also, please provide the
> snippet of code for the addTasks and runTasks calls. We can better
> help you with that information.
>
> --
> Herman Radtke
> hermanrad...@gmail.com |http://hermanradtke.com

Herman Radtke

unread,
Feb 6, 2012, 2:44:25 PM2/6/12
to gea...@googlegroups.com

I took a look at the pecl/gearman code. The warning is generated when
the internal call zend_call_function() returns a failure. This can
occur in two places: 1) the worker callback 2) the return callback.
Are you defining the callback with a string, array or anonymous
function?

mr_jingles

unread,
Feb 7, 2012, 5:37:05 AM2/7/12
to gearman
I had all callbacks with a php callback as an array (array($this,
'funcname'). As I removed them, except the on complete one, the
failure doesn't appear anymore.

Regards,
Benjamin

On 6 Feb., 20:44, Herman Radtke <hermanrad...@gmail.com> wrote:
> On Mon, Feb 6, 2012 at 9:32 AM, mr_jingles
> hermanrad...@gmail.com |http://hermanradtke.com

Herman Radtke

unread,
Feb 7, 2012, 1:27:05 PM2/7/12
to gea...@googlegroups.com
On Tue, Feb 7, 2012 at 2:37 AM, mr_jingles
<benjami...@googlemail.com> wrote:
> I had all callbacks with a php callback as an array (array($this,
> 'funcname'). As I removed them, except the on complete one, the
> failure doesn't appear anymore.

It definitely sounds like a scope problem. Were any of the callbacks
referencing a protected or private function that the abstraction layer
did not have access to?

mr_jingles

unread,
Feb 8, 2012, 6:43:05 AM2/8/12
to gearman
No really, the callbacks referenced to another public method which has
access to a protected attribute of the object.

On 7 Feb., 19:27, Herman Radtke <hermanrad...@gmail.com> wrote:
> On Tue, Feb 7, 2012 at 2:37 AM, mr_jingles
>
> <benjamin.rad...@googlemail.com> wrote:
> > I had all callbacks with a php callback as an array (array($this,
> > 'funcname'). As I removed them, except the on complete one, the
> > failure doesn't appear anymore.
>
> It definitely sounds like a scope problem. Were any of the callbacks
> referencing a protected or private function that the abstraction layer
> did not have access to?
>
> --
> Herman Radtke
> hermanrad...@gmail.com |http://hermanradtke.com

Kendall Willets

unread,
Aug 30, 2012, 3:43:14 PM8/30/12
to gea...@googlegroups.com, benjami...@googlemail.com
I just had this too, but it came after a number of successful callbacks.  

Is PHP garbage-collecting the array($this,'method') passed as the function argument?  The error message lacks any function name (and also doesn't have "[undefined]" to indicate a missing pointer), so I suspect the callback data is being overwritten at some point.
Message has been deleted
Message has been deleted

Mand Nie

unread,
Jul 6, 2016, 9:00:00 PM7/6/16
to Gearman, benjami...@googlemail.com
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages