Elastic APM PHP Tracer. Sending events to APM Server failed. Exiting...; resultCode: resultFailure (6);

Hi All, got error when I install APM agent for PHP. I have follow the documentation from APM PHP Agent Reference [1.x] | Elastic

But I still got no clues what is the problem.

Kibana version: 8.12

Elasticsearch version: 8.12

APM Server version: 8.12

APM Agent language and version: php v1

Browser version: any version

Original install method (e.g. download page, yum, deb, from source, etc.) and version: download page

Fresh install or upgraded from other version? fresh install

Is there anything special in your setup? For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? No

Steps to reproduce:

  1. Install APM Server
  2. Install APM Agent for PHP on linux
  3. Restart httpd and php-fpm server

Provide logs and/or server output (if relevant): Sending events to APM Server failed; URL: http://jlnfleetsvr.julian.local:8200/intake/v2/events';error message: Couldn't connect to server'; curl info: {version: 7.76.1, ssl_version:OpenSSL/3.0.7, libz_version: 1.2.11, host: x86_64-redhat-linux-gnu. Exiting...; resultCode: resultFailure (6);

I got those error from php service status.

Hope someone can help me here. I found the previous topic that match my problem, but the topic was closed without any resolution Elastic APM PHP Tracer - Sending events to APM Server failed. Hope someone can help me for this.

Thanks

Welcome back @Julian_Fazri

Could you please enable verbose log for agent's communication with APM Server as described at Troubleshooting | APM PHP Agent Reference [1.x] | Elastic
and provide the resulted logs?

Please note that log might contain security sensitive data (such as your API key or secret token) so make sure to redact the logs before pasting here.

Curl result code 6 might be related to problem with name resolution. Could you please follow instructions from Sergey and verify if you can reach (ping) jlnfleetsvr.julian.local domain from host/container with PHP application (and agent installed)?

Hi Sergey,

I have change the domain with IP and enable verbose mode. On log written Immediate connect fail for 192.168.12.225: Permission denied. I am not using api key and write the secret correctly. What I need to check next?

Hi Pawel,

ping works fine from php host. I also change the domain with IP, but got the same error. I enable verbose mode. On log written "Immediate connect fail for 192.168.12.225: Permission denied". I am not using api key and write the secret correctly. What I need to check next?

Hi @Sergey_Kleyman and @Pawel_Filipczak,

I have solved my problem. I don't know why, but I need to disable my selinux on apm-agent host. After I set selinux disabled and restart the host, data successfully sent to apm-server.

1 Like