Skip to content

Slight difference in combined log format visavi nginx #33

Open

Description

@mskyttner

With duckdb 1.2 and httpserver 0.1.15 (yay!) I noticed the following differences in combined log format when running an nginx proxy before the service:

nginx-1  | 172.27.0.1 - - [07/Feb/2025:13:58:04 +0000] "GET /dux/?url=/dux/ HTTP/1.1" 200 32737 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:134.0) Gecko/20100101 Firefox/134.0" "-"
nginx-1  | 172.27.0.1 - default [07/Feb/2025:13:58:10 +0000] "POST /dux/?add_http_cors_header=1&default_format=JSONCompact&max_result_rows=1000&max_result_bytes=10000000&result_overflow_mode=break HTTP/1.1" 200 2446 "http://localhost/dux/?url=/dux/" "Mozilla/5.0 (X11; Linux x86_64; rv:134.0) Gecko/20100101 Firefox/134.0" "-"
duckserve-1  | 172.27.0.2 - - [07/Feb/2025:13:58:04 +0000] "GET /duckserve/ HTTP/HTTP/1.0" 200 32737 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:134.0) Gecko/20100101 Firefox/134.0" "172.27.0.1"
duckserve-1  | 172.27.0.2 - - [07/Feb/2025:13:58:10 +0000] "POST /duckserve/ HTTP/HTTP/1.0" 200 2446 "http://localhost/dux/?url=/dux/" "Mozilla/5.0 (X11; Linux x86_64; rv:134.0) Gecko/20100101 Firefox/134.0" "172.27.0.1"

HTTP/HTTP/1.0 looks like it is "doubled" (perhaps the logged variable value already contains the "HTTP" string?)

Activity

  1. added
    bugSomething isn't working
    help wantedExtra attention is needed
    on Feb 7, 2025
  2. mskyttner commented on Sep 9, 2025

    @mskyttner
    Author

    I think that maybe req.version.c_str() reports the http protocol version and that duckdb_httplib_openssl::Request returns strings like "HTTP/1.0" or "HTTP/1.1", "HTTP/2" etc.

    So a quick fix might be to change the format string when logging to not explicitly have the "HTTP/" in it, then the log format would match what nginx gives.

    sed -i 's/%s HTTP\//%s /g' src/httpserver_extension.cpp

    However, I haven't set up the build chain to double check this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions