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

[Util] [util_for_PHP.c:145] [callPhpFunction] call_user_function failed. Return value: -1. PHP function name: `\Elastic\Apm\Impl\AutoInstrument\PhpPartFacade::shutdown'. argsCount: 0. #459

Closed
calvin2021y opened this issue Jul 31, 2021 · 8 comments · Fixed by #1223

Comments

@calvin2021y
Copy link

calvin2021y commented Jul 31, 2021

with today ext with 7.3, get this error:

2021-07-31 18:26:17.976446+08:00 [ERROR]    [Util] [util_for_PHP.c:145] [callPhpFunction] call_user_function failed. Return value: -1. PHP function name: `\Elastic\Apm\Impl\AutoInstrument\PhpPartFacade::bootstrap'. argsCount: 2.
Configuration File (php.ini) Path: /usr/local/etc/php
Loaded Configuration File:         /usr/local/etc/php/php.ini

2021-07-31 18:26:17.980848+08:00 [ERROR]    [Util] [util_for_PHP.c:145] [callPhpFunction] call_user_function failed. Return value: -1. PHP function name: `\Elastic\Apm\Impl\AutoInstrument\PhpPartFacade::shutdown'. argsCount: 0.
@calvin2021y calvin2021y added the bug Something isn't working label Jul 31, 2021
@calvin2021y
Copy link
Author

After I change the folder from ElasticApm into Elastic/Apm, I get Segmentation fault.

@krystalcode
Copy link

I have encountered a similar error, not sure if they are related. I'm installing v1.3 from the package provided here. It's a container setup and in one project everything works well, in another built and run in exactly the same way I get the error. Both on PHP 7.4.23.

2021-09-03 20:35:45.938158+00:00 [ERROR]    [Util] [util_for_PHP.c:145] [callPhpFunction] call_user_function failed. Return value: -1. PHP function name: `\Elastic\Apm\Impl\AutoInstrument\PhpPartFacade::interceptedCallPostHook'. argsCount: 2.
2021-09-03 20:35:45.938254+00:00 [ERROR]    [C-to-PHP] [tracer_PHP_part.c:213] [tracerPhpPartInterceptedCallPostHook] Exiting: resultCode: resultFailure (4)

@sergiosanchezalvarez
Copy link

sergiosanchezalvarez commented Sep 21, 2021

I have encountered a similar error, not sure if they are related. I'm installing v1.3 from the package provided here. It's a container setup and in one project everything works well, in another built and run in exactly the same way I get the error. Both on PHP 7.4.23.

2021-09-03 20:35:45.938158+00:00 [ERROR]    [Util] [util_for_PHP.c:145] [callPhpFunction] call_user_function failed. Return value: -1. PHP function name: `\Elastic\Apm\Impl\AutoInstrument\PhpPartFacade::interceptedCallPostHook'. argsCount: 2.
2021-09-03 20:35:45.938254+00:00 [ERROR]    [C-to-PHP] [tracer_PHP_part.c:213] [tracerPhpPartInterceptedCallPostHook] Exiting: resultCode: resultFailure (4)

Same error here:

Sep 21 15:29:03 ae35945ea9d9 apache2: Elastic APM PHP Tracer [PID: 1200] 2021-09-21 15:29:03.917762+00:00 [ERROR] [Util] [util_for_PHP.c:146] [callPhpFunction] call_user_function failed. Return value: -1. PHP function name:\Elastic\Apm\Impl\AutoInstrument\PhpPartFacade::interceptedCallPostHook'. argsCount: 2.
Sep 21 15:29:03 ae35945ea9d9 apache2: Elastic APM PHP Tracer [PID: 1200] 2021-09-21 15:29:03.917917+00:00 [ERROR] [C-to-PHP] [tracer_PHP_part.c:214] [tracerPhpPartInterceptedCallPostHook] Exiting: resultCode: resultFailure (4)
`

Running on a dockericed environment

@JanMikes
Copy link

JanMikes commented Apr 28, 2022

Hi, i have the same following error as above. Even though the errors, request in is made in background.

2022-04-28 22:44:41.166475+00:00 [PID: 13] [TID: 13] [ERROR]    [Util] [util_for_PHP.c:189] [callPhpFunction] call_user_function failed. Return value: -1. PHP function name: `\Elastic\Apm\Impl\AutoInstrument\PhpPartFacade::interceptedCallPostHook'. argsCount: 2.
2022-04-28 22:44:41.166904+00:00 [PID: 13] [TID: 13] [ERROR]    [Util] [util_for_PHP.c:202] [callPhpFunction] Exiting...; resultCode: resultFailure (4);
2022-04-28 22:44:41.167051+00:00 [PID: 13] [TID: 13] [ERROR]    [C-to-PHP] [tracer_PHP_part.c:208] [tracerPhpPartInterceptedCallPostHook] Exiting...; resultCode: resultFailure (4); dbgInterceptRegistrationId: 9; interceptedCallRetValOrThrown type: 2.

PHP 8.0.18, Apm agent runs in Docker, version 1.5.

@intuibase
Copy link
Contributor

Hey @calvin2021y

Did you tried it with latest (https://github.com/elastic/apm-agent-php/releases/tag/v1.10.0) release?

@richardklose
Copy link

Hi, we face the same issue:

2024-08-22 18:37:15.992164+02:00 [PID: 3057507] [TID: 3057507] [ERROR]    [Util] [util_for_PHP.cpp:217] [callPhpFunction] call_user_function failed. Return value: -1. PHP function name: `\Elastic\Apm\Impl\AutoInstrument\PhpPartFacade::internalFuncCallPostHook'. argsCount: 2."              │
2024-08-22 18:37:15.992202+02:00 [PID: 3057507] [TID: 3057507] [ERROR]    [Util] [util_for_PHP.cpp:230] [callPhpFunction] Exiting...; resultCode: resultFailure (6); "                                                                                                                            │
2024-08-22 18:37:15.992212+02:00 [PID: 3057507] [TID: 3057507] [ERROR]    [C-to-PHP] [tracer_PHP_part.cpp:90] [switchTracerPhpPartStateToFailed] Switching tracer PHP part state to failed; reason: Failed to call tracer PHP part, current state: tracerPhpPartState_after_bootstrap, called from│
2024-08-22 18:37:15.992226+02:00 [PID: 3057507] [TID: 3057507] [ERROR]    [C-to-PHP] [tracer_PHP_part.cpp:295] [tracerPhpPartInternalFuncCallPostHook] Exiting...; resultCode: resultFailure (6); dbgInterceptRegistrationId: 18; interceptedCallRetValOrThrown type: 2."                         │
2024-08-22 18:37:16.141905+02:00 [PID: 3057507] [TID: 3057507] [ERROR]    [C-to-PHP] [tracer_PHP_part.cpp:184] [shutdownTracerPhpPart] Exiting...; resultCode: resultFailure (6); "

PHP-fpm 8.1.28, APM Agent 1.12.0 running on Ubuntu 20.04

Anything else we can do to find the root cause here?

@intuibase
Copy link
Contributor

Hey @richardklose
Could you try latest release, we fixed similar issue and we're pretty sure that latest fix might solve your issues.
Thanks

@richardklose
Copy link

Can confirm, this solved the issue for us. Thanks. 👍

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

Successfully merging a pull request may close this issue.

7 participants