Skip to content

Log spam during attempt to append remote address to the XFF header when the transport is a unix domain socket #1538

Closed
@janzantinge

Description

@janzantinge

🐛 Bug Report

The annotateContext function cannot append the request's remote address if the request arrives via a Unix Domain Socket. The code attempts to parse the req.remoteAddr field and fails. This is not really a big problem except that an info level log message is printed every time the req.remoteAddr cannot be parsed.

To Reproduce

  1. Send a request to the gateway via a Unix Domain Socket (abstract in my case)

Expected behavior

No info level log, maybe update the X-Forwarded-For header (though I'm not sure if appending the Unix Domain Socket path to the header contents is valid)

Actual Behavior

While running a high traffic service, a lot of log messages are generated that look like this: invalid remote addr: @

Your Environment

Linux (container running in kubernetes)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions