Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[caddy] Handle reverse proxy errors #1106

Open
LaurenceJJones opened this issue Sep 1, 2024 · 0 comments
Open

[caddy] Handle reverse proxy errors #1106

LaurenceJJones opened this issue Sep 1, 2024 · 0 comments

Comments

@LaurenceJJones
Copy link
Contributor

When caddy receives no response from upstream server it logs a JSON line such as

{
  "level": "error",
  "ts": 1712066552.3486984,
  "logger": "http.handlers.reverse_proxy",
  "msg": "aborting with incomplete response",
  "upstream": "172.19.0.8:3000",
  "duration": 0.00405423,
  "request": {
    "remote_ip": "x.x.x.x",
    "remote_port": "56973",
    "client_ip": "x.x.x.x",
    "proto": "HTTP/2.0",
    "method": "GET",
    "host": "git.mydomain.com",
    "uri": "/user/events",
    "headers": {
      "Cache-Control": [
        "no-cache"
      ],
      "Cookie": [],
      "Sec-Fetch-Dest": [
        "empty"
      ],
      "Te": [
        "trailers"
      ],
      "Pragma": [
        "no-cache"
      ],
      "X-Forwarded-Proto": [
        "https"
      ],
      "User-Agent": [
        "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0"
      ],
      "X-Forwarded-Host": [
        "git.mydomain.com"
      ],
      "Accept-Encoding": [
        "gzip, deflate, br"
      ],
      "Sec-Fetch-Mode": [
        "cors"
      ],
      "Accept": [
        "text/event-stream"
      ],
      "Accept-Language": [
        "de,en-US;q=0.7,en;q=0.3"
      ],
      "Sec-Fetch-Site": [
        "same-origin"
      ],
      "X-Forwarded-For": [
        "x.x.x.x"
      ]
    },
    "tls": {
      "resumed": false,
      "version": 772,
      "cipher_suite": 4865,
      "proto": "h2",
      "server_name": "git.mydomain.com"
    }
  },
  "error": "reading: context canceled"
}

Currently the parser is not set to handle these lines as it will attempt to grab certain variables from the JSON log line. This will cause warning to be logged to the crowdsec log file, however, this will not impact performance or the impact for CrowdSec to do its job. Its purely just adds alot of warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant