valeriansaliou / bloom

:cherry_blossom: HTTP REST API caching middleware, to be used between load balancers and REST API workers.

Home Page:https://crates.io/crates/bloom-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Still getting extra leading slashes

explody opened this issue · comments

Surely related to #7. I'm trying out the current HEAD and we're getting "501 Not Extended" from Bloom, and seeing this on the API worker, using PostMan (note the double slash):

127.0.0.1 - - [21/May/2019:20:20:13 +0000] "GET //api/ipam/prefixes HTTP/1.0" 404 16686 "-" "PostmanRuntime/7.13.0"

The same call directly to the API worker, changing only the host/port, works fine.

Did you pull master and build it manually? There’s no release for this patch ATM, you need to build from Git latest.

I've released v1.26.0 (available on Crates.io and Docker Hub). Pull this version to ensure you're using the fixed code. If it still happens after running Bloom v1.26.0 you may re-open this issue.

I pulled v1.26.0 from docker, the double / problem still exists:
My backend get this message: message:UT005023: Exception handling request to //api/authenticate

I built with the latest source code and run it from command-line as:
./target/release/bloom -c /var/opt/bloom/config.cfg

the link is like: nginx-> bloom -> app server.
In bloom log, it showed the request has been received, but there was some error((ERROR) - failed unwrapping body value for key: bloom:1:c:2e0351c2:7054186e, ignoring
). The app server never get the request.

Below is the bloom log:
(DEBUG) - accepted new connection (192.168.31.146:56710)
(DEBUG) - handled new request
(DEBUG) - scheduling Read for: 0
(DEBUG) - adding I/O source: 16777218
(DEBUG) - scheduling Read for: 2
(DEBUG) - loop poll - 31.115µs
(DEBUG) - loop time - Instant { tv_sec: 2423144, tv_nsec: 296483731 }
(DEBUG) - loop process, 6.864µs
(DEBUG) - read 846 bytes
(DEBUG) - parsed 15 headers (789 bytes)
(DEBUG) - incoming body is content-length (57 bytes)
(DEBUG) - called proxy serve
(INFO) - handled request: POST on /api/authenticate
(DEBUG) - hashing value: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImF1dGgiOiJST0xFX0FETUlOLFJPTEVfVVNFUiIsImV4cCI6MTU2NTUxODAxNn0.HVw3CG5b3A7hggrKxAn_Ho909irF3xEEF4VIx2t4Id8HrivVo0DZHSo1KQwHFBtpp4cEgp8FNus1wP8u_ZmorQ
(DEBUG) - hashing value: [HTTP/1.0|POST|/api/authenticate||http://localhost:8081]
(DEBUG) - generated bucket: [HTTP/1.0|POST|/api/authenticate||http://localhost:8081] with hash: 7054186e
(INFO) - tunneling for ns = bloom:1:c:2e0351c2:7054186e
(DEBUG) - key: bloom:1:c:2e0351c2:7054186e not cacheable, ignoring (will pass through)
(DEBUG) - connecting to 192.168.31.149:18081
(DEBUG) - adding I/O source: 20971523
(DEBUG) - scheduling Write for: 3
(DEBUG) - loop poll - 198.285µs
(DEBUG) - loop time - Instant { tv_sec: 2423144, tv_nsec: 296692089 }
(DEBUG) - loop process, 7.086µs
(DEBUG) - loop poll - 235.288µs
(DEBUG) - loop time - Instant { tv_sec: 2423144, tv_nsec: 296938967 }
(DEBUG) - loop process, 7.73µs
(DEBUG) - scheduling Read for: 3
(DEBUG) - flushed 846 bytes
(DEBUG) - loop poll - 59.124µs
(DEBUG) - loop time - Instant { tv_sec: 2423144, tv_nsec: 297008371 }
(DEBUG) - loop process, 7.033µs
(DEBUG) - incoming body completed
(DEBUG) - loop poll - 8.286µs
(DEBUG) - loop time - Instant { tv_sec: 2423144, tv_nsec: 297027264 }
(DEBUG) - loop process, 6.774µs
(DEBUG) - scheduling Read for: 3
(DEBUG) - loop poll - 8.203µs
(DEBUG) - loop time - Instant { tv_sec: 2423144, tv_nsec: 297045363 }
(DEBUG) - loop process, 6.462µs
(DEBUG) - read 742 bytes
(DEBUG) - parsed 11 headers (542 bytes)
(DEBUG) - incoming body is until end-of-file
(DEBUG) - loop poll - 130.010284ms
(DEBUG) - loop time - Instant { tv_sec: 2423144, tv_nsec: 427065475 }
(DEBUG) - loop process, 8.993µs
(DEBUG) - loop poll - 20.779µs
(DEBUG) - loop time - Instant { tv_sec: 2423144, tv_nsec: 427101011 }
(DEBUG) - loop process, 7.683µs
(DEBUG) - scheduling Read for: 3
(DEBUG) - loop poll - 11.857µs
(DEBUG) - loop time - Instant { tv_sec: 2423144, tv_nsec: 427123811 }
(DEBUG) - loop process, 7.237µs
(DEBUG) - read 10 bytes
(DEBUG) - loop poll - 878.778µs
(DEBUG) - loop time - Instant { tv_sec: 2423144, tv_nsec: 428013034 }
(DEBUG) - loop process, 10.642µs
(DEBUG) - loop poll - 5.654µs
(DEBUG) - loop time - Instant { tv_sec: 2423144, tv_nsec: 428033491 }
(DEBUG) - loop process, 6.98µs
(DEBUG) - read 0 bytes
(DEBUG) - incoming body completed
(DEBUG) - dropping I/O source: 3
(DEBUG) - loop poll - 46.919µs
(DEBUG) - loop time - Instant { tv_sec: 2423144, tv_nsec: 428090570 }
(DEBUG) - loop process, 7.368µs
(DEBUG) - loop poll - 5.901µs
(DEBUG) - loop time - Instant { tv_sec: 2423144, tv_nsec: 428107282 }
(DEBUG) - loop process, 6.638µs
(ERROR) - failed unwrapping body value for key: bloom:1:c:2e0351c2:7054186e, ignoring
(DEBUG) - flushed 103 bytes
(DEBUG) - dropping I/O source: 2

Do you have anything for me to reproduce? ie. a snippet of code you could replicate the issue with and that you can send there. The logs don’t tell much unfortunately.