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

Agent error tracing does not work and throws errors to stderr itself #1216

Open
savemetenminutes opened this issue Sep 3, 2024 · 2 comments
Assignees
Labels
agent-php bug Something isn't working

Comments

@savemetenminutes
Copy link

savemetenminutes commented Sep 3, 2024

Describe the bug

[Elastic APM PHP Tracer] 2024-09-03 19:13:10.806440+00:00 [PID: 1647] [TID: 1647] [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.
[Elastic APM PHP Tracer] 2024-09-03 19:13:10.806570+00:00 [PID: 1647] [TID: 1647] [ERROR]    [Util] [util_for_PHP.cpp:230] [callPhpFunction] Exiting...; resultCode: resultFailure (6);
[Elastic APM PHP Tracer] 2024-09-03 19:13:10.806603+00:00 [PID: 1647] [TID: 1647] [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 tracerPhpPartInternalFuncCallPostHook
[Elastic APM PHP Tracer] 2024-09-03 19:13:10.806638+00:00 [PID: 1647] [TID: 1647] [ERROR]    [C-to-PHP] [tracer_PHP_part.cpp:295] [tracerPhpPartInternalFuncCallPostHook] Exiting...; resultCode: resultFailure (6); dbgInterceptRegistrationId: 8; interceptedCallRetValOrThrown type: 2.

To Reproduce
Steps to reproduce the behavior:

  1. Use this config
; This file contains the various settings for the Elastic APM PHP agent. For
; further details refers to the following URL:
; https://www.elastic.co/guide/en/apm/agent/php/current/configuration-reference.html
;

[elastic]
elastic_apm.enabled = ${ELASTIC_APM_AGENT_ENABLED}
elastic_apm.abort_on_memory_leak = ${ELASTIC_APM_AGENT_ABORT_ON_MEMORY_LEAK}
elastic_apm.server_url = ${ELASTIC_APM_AGENT_SERVER_URL}
elastic_apm.server_timeout = ${ELASTIC_APM_AGENT_SERVER_TIMEOUT}
elastic_apm.verify_server_cert = ${ELASTIC_APM_AGENT_VERIFY_SERVER_CERTIFICATE}
;elastic_apm.api_key = "REPLACE_WITH_API_KEY"
;elastic_apm.secret_token = "REPLACE_WITH_SECRET_TOKEN"
elastic_apm.disable_instrumentations = ${ELASTIC_APM_AGENT_DISABLE_INSTRUMENTATIONS}
elastic_apm.transaction_max_spans = ${ELASTIC_APM_AGENT_TRANSACTION_MAX_SPANS}
elastic_apm.transaction_sample_rate = 1.0
elastic_apm.environment = "${ELASTIC_APM_AGENT_ENVIRONMENT}"
elastic_apm.hostname = ${ELASTIC_APM_AGENT_HOSTNAME}
elastic_apm.service_name = "${ELASTIC_APM_AGENT_SERVICE_NAME}"
elastic_apm.service_node_name = "${ELASTIC_APM_AGENT_SERVICE_NODE_NAME}"
elastic_apm.service_version = "${ELASTIC_APM_AGENT_SERVICE_VERSION}"
elastic_apm.global_labels = "${ELASTIC_APM_AGENT_GLOBAL_LABELS}"
elastic_apm.log_level = "${ELASTIC_APM_AGENT_LOG_LEVEL}"
elastic_apm.log_level_stderr = "${ELASTIC_APM_AGENT_LOG_LEVEL_STDERR}"
elastic_apm.capture_errors = "${ELASTIC_APM_AGENT_CAPTURE_ERRORS}"
elastic_apm.stack_trace_limit = "${ELASTIC_APM_AGENT_STACK_TRACE_LIMIT}"

the env values are as follows:

ELASTIC_APM_AGENT_ABORT_ON_MEMORY_LEAK=false
ELASTIC_APM_AGENT_ENABLED=true
ELASTIC_APM_AGENT_SERVICE_VERSION=N/A
ELASTIC_APM_AGENT_DISABLE_INSTRUMENTATIONS=
ELASTIC_APM_AGENT_LOG_LEVEL=info
ELASTIC_APM_AGENT_SERVICE_NAME=php8-fpm_1
ELASTIC_APM_AGENT_LOG_LEVEL_STDERR=info
ELASTIC_APM_AGENT_SERVER_TIMEOUT=5s
ELASTIC_APM_AGENT_HOSTNAME=adex-php8-fpm_1
ELASTIC_APM_AGENT_VERSION=1.12.0
ELASTIC_APM_AGENT_GLOBAL_LABELS=
ELASTIC_APM_AGENT_ENVIRONMENT=local
ELASTIC_APM_AGENT_TRANSACTION_MAX_SPANS=500
ELASTIC_APM_AGENT_CAPTURE_ERRORS=on
ELASTIC_APM_AGENT_SERVER_URL=http://elastic-apm-server:8200
ELASTIC_APM_AGENT_VERIFY_SERVER_CERTIFICATE=false
ELASTIC_APM_AGENT_STACK_TRACE_LIMIT=-1
ELASTIC_APM_AGENT_SERVICE_NODE_NAME=N/A
  1. Run a console script that throws an exception
@savemetenminutes savemetenminutes added the bug Something isn't working label Sep 3, 2024
@intuibase
Copy link
Contributor

Hey @savemetenminutes
Thank you for reporting this bug. I think it might be solved in latest v1.14.1 release. Could you please give it a try and let us know if it fixed issue for you?

@intuibase intuibase self-assigned this Sep 11, 2024
@savemetenminutes
Copy link
Author

@intuibase I should've thought about the obvious troubleshooting step. Updating to v1.14.1 seems to have fixed the issue. Thanks and sorry for wasting your time with such a trivial matter!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-php bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants