deislabs / bindle

Bindle: Object Storage for Collections
Apache License 2.0
263 stars 37 forks source link

Bindle server doesn't log error when it fails writing the bindle to disk #297

Closed adamreese closed 2 years ago

adamreese commented 2 years ago

When the bindle process doesn't have write permissions to the bindle directory it silently fails.

To test you can create a temp directory as root. Pushing a bindle will return a 500 error but the server doesn't log an error.

bindle-server --unauthenticated  -d $(sudo mktemp -d)
thomastaylor312 commented 2 years ago

@adamreese What was your RUST_LOG set to by chance?

adamreese commented 2 years ago

RUST_LOG=error,warp=info,bindle=debug

adamreese commented 2 years ago

When pushing to the server the server logs don't report that the bindle wasn't stored.

2022-02-03T20:22:38.579769Z  INFO request{method=POST path=/v1/_i version=HTTP/1.1 remote.addr=127.0.0.1:65376}: warp::filters::trace: processing request
2022-02-03T20:22:38.580526Z  INFO request{method=POST path=/v1/_i version=HTTP/1.1 remote.addr=127.0.0.1:65376}: bindle::invoice::verification: No signatures on invoice id=adamreese/hiphip/0.1.0
2022-02-03T20:22:38.581150Z DEBUG request{method=POST path=/v1/_i version=HTTP/1.1 remote.addr=127.0.0.1:65376}: bindle::server::reply: Parsed accept header into list accept_value=application/toml accept_items=["application/toml"]
2022-02-03T20:22:38.581183Z DEBUG request{method=POST path=/v1/_i version=HTTP/1.1 remote.addr=127.0.0.1:65376}: bindle::server::reply: Selected a best-fit MIME best_fit=application/toml
2022-02-03T20:22:38.581234Z  INFO request{method=POST path=/v1/_i version=HTTP/1.1 remote.addr=127.0.0.1:65376}: warp::filters::trace: finished processing with success status=500
thomastaylor312 commented 2 years ago

Definitely a bug then!