Skip to content

[BUG] Cannot parse IP-address from X-Forwarded-For from Azure application gateway #1672

Description

@joelharkes

Bug description

Running the datadog in php fpm (behind nginx) via Azure application gateway, creates for each request the following notice: NOTICE: PHP message: Not recognized as IP address: "1.1.1.1:23423"

I have deducted it triggers when port number is appended to the x-forwarded-for header.

Example

It fFails parsing IP address when x-forwarded-for header contains an port number:

image

creates error:

NOTICE: PHP message: Not recognized as IP address: "1.1.1.1:23423"

PHP version

PHP 7.4.28 (cli) (built: Feb 28 2022 07:33:39) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans
    with Zend OPcache v7.4.28, Copyright (c), by Zend Technologies

Tracer version

0.76.1

Installed extensions

[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
intl
json
ldap
libxml
mbstring
mysqli
mysqlnd
odbc
openssl
pcntl
pcre
PDO
pdo_dblib
pdo_mysql
PDO_ODBC
pdo_pgsql
pdo_sqlite
pdo_sqlsrv
pgsql
Phar
phpdbg_webhelper
posix
pspell
readline
Reflection
session
shmop
SimpleXML
soap
sockets
sodium
SPL
sqlite3
sqlsrv
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
xdebug
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Xdebug
Zend OPcache

OS info

NAME="Alpine Linux"
VERSION_ID=3.15.5
PRETTY_NAME="Alpine Linux v3.15"

Diagnostics and configuration

Output of phpinfo() (ddtrace >= 0.47.0)

i can add if necessary but seems a general bug.

Upgrading info

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions