zhaofengli / attic

Multi-tenant Nix Binary Cache
https://docs.attic.rs
Other
1.02k stars 77 forks source link

ERROR attic_server::error: Database error: Failed to acquire connection from pool: Connection pool timed out #117

Open JonBoyleCoding opened 8 months ago

JonBoyleCoding commented 8 months ago

I keep getting these database errors with the connection pool timing out. This then seems to completely stop the uploading of whichever package is uploading at the time.

Any thoughts?

I'm launching atticd via a custom systemd unit as I'm running it on a non-NixOS system. Everything is default in the config other than the storage location which is being placed on a btrfs raid. I'm trying with a smaller amount of jobs at the moment to see if it makes a difference.

Mar 05 21:01:32 january atticd[3253282]: 2024-03-05T21:01:32.196557Z ERROR attic_server::error: Database error: Failed to acquire connection from pool: Connection pool timed out
Mar 05 21:01:32 january atticd[3253282]:    0: attic_server::api::v1::upload_path::upload_path
Mar 05 21:01:32 january atticd[3253282]:              at server/src/api/v1/upload_path.rs:117
Mar 05 21:01:32 january atticd[3253282]:    1: tower_http::trace::make_span::request
Mar 05 21:01:32 january atticd[3253282]:            with method=PUT uri=/_api/v1/upload-path version=HTTP/1.1
Mar 05 21:01:32 january atticd[3253282]:              at /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-vendor-cargo-deps/c19b7c6f923b580ac259164a89f2577984ad5ab09ee9d583b888f934adbbe8d0/tower-http-0.4.4/src/trace/make_span.rs:109
Mar 05 21:01:32 january atticd[3253282]:    2: tokio::task::runtime.spawn
Mar 05 21:01:32 january atticd[3253282]:            with kind=task task.name= task.id=4767072 loc.file="/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-vendor-cargo-deps/c19b7c6f923b580ac259164a89f2577984ad5ab09ee9d583b888f934adbbe8d0/hyper-0.14.27/src/common/exec.rs" loc.line=49 loc.col=21
Mar 05 21:01:32 january atticd[3253282]:              at /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-vendor-cargo-deps/c19b7c6f923b580ac259164a89f2577984ad5ab09ee9d583b888f934adbbe8d0/tokio-1.34.0/src/util/trace.rs:17
Mar 05 21:01:32 january atticd[3253282]: 2024-03-05T21:01:32.196592Z ERROR tower_http::trace::on_failure: response failed classification=Status code: 500 Internal Server Error latency=30001 ms
Mar 05 21:02:10 january atticd[3253282]: 2024-03-05T21:02:10.166840Z ERROR attic_server::error: Database error: Failed to acquire connection from pool: Connection pool timed out
Mar 05 21:02:10 january atticd[3253282]:    0: tokio::task::runtime.spawn
Mar 05 21:02:10 january atticd[3253282]:            with kind=task task.name= task.id=4909372 loc.file="server/src/api/v1/upload_path.rs" loc.line=408 loc.col=13
Mar 05 21:02:10 january atticd[3253282]:              at /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-vendor-cargo-deps/c19b7c6f923b580ac259164a89f2577984ad5ab09ee9d583b888f934adbbe8d0/tokio-1.34.0/src/util/trace.rs:17
Mar 05 21:02:10 january atticd[3253282]:    1: attic_server::api::v1::upload_path::upload_path
Mar 05 21:02:10 january atticd[3253282]:              at server/src/api/v1/upload_path.rs:117
Mar 05 21:02:10 january atticd[3253282]:    2: tower_http::trace::make_span::request
Mar 05 21:02:10 january atticd[3253282]:            with method=PUT uri=/_api/v1/upload-path version=HTTP/1.1
Mar 05 21:02:10 january atticd[3253282]:              at /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-vendor-cargo-deps/c19b7c6f923b580ac259164a89f2577984ad5ab09ee9d583b888f934adbbe8d0/tower-http-0.4.4/src/trace/make_span.rs:109
Mar 05 21:02:10 january atticd[3253282]:    3: tokio::task::runtime.spawn
Mar 05 21:02:10 january atticd[3253282]:            with kind=task task.name= task.id=4767074 loc.file="/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-vendor-cargo-deps/c19b7c6f923b580ac259164a89f2577984ad5ab09ee9d583b888f934adbbe8d0/hyper-0.14.27/src/common/exec.rs" loc.line=49 loc.col=21
Mar 05 21:02:10 january atticd[3253282]:              at /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-vendor-cargo-deps/c19b7c6f923b580ac259164a89f2577984ad5ab09ee9d583b888f934adbbe8d0/tokio-1.34.0/src/util/trace.rs:17
Mar 05 21:02:10 january atticd[3253282]: 2024-03-05T21:02:10.166891Z ERROR tower_http::trace::on_failure: response failed classification=Status code: 500 Internal Server Error latency=819791 ms
jpds commented 7 months ago

I think this is the same as #24