Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-33506

Original IP not shown in network related error messages when proxy_protocol is in use




      When the proxy_protocol is in use, the IP address of the proxy is replaced with the IP address of the client being proxied for authentication. This replaced IP is then also used in all error messages and other information that is logged. This makes it very difficult to diagnose any network errors that happen for a client that's behind a proxy which uses proxy_protocol.

      Here's an example: we have two proxies, proxy A at and proxy B at, and a client at If there's a problem on proxy A that results in a network error, the error that is logged is:

      [Warning] Aborted connection 123 to db: 'foo' user: 'bar' host: '' (Got an error reading communication packets)

      What I think would be an improvement is an error like this:

      [Warning] Aborted connection 123 to db: 'foo' user: 'bar' host: '' proxy: '' (Got an error reading communication packets)

      With this, it'd be immediately known that the proxy A is the origin of the error and the link between these two nodes is the problem. With the current error message, all links that connect to the database must be inspected.

      As can be seen, for setups where there are multiple proxies, finding out which proxy to look into when looking for related errors takes a lot of work and leads to potentially ambiguous results if the connection IDs on the database aren't logged by the proxy for any errors that it faces. The improved error would both remove the ambiguity and reduce that amount of work that needs to be done to find the proxy to look at.


        Issue Links



              wlad Vladislav Vaintroub
              markus makela markus makela
              2 Vote for this issue
              7 Start watching this issue



                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.