apm-agent-php
apm-agent-php copied to clipboard
Getting 502 when using in combination with Azure Application Gateway
Hi there,
I was testing the extension with my PHP 7.3.14 (Ubuntu) which runs an Apache server. As load balancer solution we are using Azure Application Gateway. So basically the requests go first to Application Gateway and then it hits my Apache server.
Checking the logs I can see that my Apache is responding the requests with 200 but the application gateway is responding with 502. Disabling the APM extension everything starts working fine again. Even getting 502 I am able to see the traces being sent to APM dashboard.
Any thoughts on what can be the issue here?
Hi @romulo-dbts,
Could you please provide agent's logs? The agent logs to syslog by default.
@SergeyKleyman here it goes https://pastebin.com/Tpz5Lwpa
I see a few messages of the following kind
AH00051: child pid 91 exit signal Segmentation fault (11), possible coredump in /etc/apache2
Also I don't see any messages from PHP Agent - please add elastic_apm.log_level_syslog = TRACE to php.ini.
- If you remove elastic_apm extension from
php.inido messagesexit signal Segmentation faultstill occur? - If the answer to the previous question is no (which means elastic_apm extension crashes Apache) please remove
elastic_apm.bootstrap_php_part_file=<repo root>/src/bootstrap_php_part.phpline fromphp.ini(but leaveextension=elastic_apm.so) - does Apache still crash?
Please provide the logs (with elastic_apm.log_level_syslog = TRACE) for both with and without elastic_apm.bootstrap_php_part_file=<repo root>/src/bootstrap_php_part.php line.
Do you have any additional non-standard extensions? I would like to make sure that there are no other extensions that might conflict with elastic_apm like the one mentioned in #123.
These are my modules
[24-Aug-2020 11:21:20 UTC] PHP Warning: Module 'imagick' already loaded in Unknown on line 0
[PHP Modules]
apcu
bcmath
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
geoip
gettext
hash
iconv
imagick
intl
json
libxml
mbstring
mysqlnd
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
SimpleXML
soap
sodium
SPL
sqlite3
standard
tidy
timezonedb
tokenizer
xdebug
xml
xmlreader
xmlwriter
Zend OPcache
zip
zlib
[Zend Modules]
Xdebug
Zend OPcache
@SergeyKleyman Here is the outcome performing the tests that you asked.
- No. The errors does not occur
- Removing
elastic_apm.bootstrap_php_part_file=<repo root>/src/bootstrap_php_part.phpapache does not crash, works fine
Below you can find the requested logs
- With
elastic_apm.bootstrap_php_part_file=<repo root>/src/bootstrap_php_part.php- https://pastebin.com/3LbRN5uv - Without
elastic_apm.bootstrap_php_part_file=<repo root>/src/bootstrap_php_part.php- https://pastebin.com/6miqsj4c
@romulo-dbts HI. Could you please check if the problem still occurs with the latest agent release (it's v1.9.1 at the moment)?