dmikusa / binding-tool

Generate Kubernetes service bindings for use with Cloud Native Buildpacks
Apache License 2.0
27 stars 4 forks source link

Client timeout when downloading artifacts #73

Closed M3hdi closed 1 year ago

M3hdi commented 1 year ago

Hi,

I'm encountering an error when running the following command : bt dependency-mapping -b paketo-buildpacks/bellsoft-liberica

Output : thread '<unnamed>' panicked at 'Download of https://github.com/bell-sw/Liberica/releases/download/20.0.1+10/bellsoft-jre20.0.1+10-linux-amd64.tar.gz failed with error https://github.com/bell-sw/Liberica/releases/download/20.0.1+10/bellsoft-jre20.0.1+10-linux-amd64.tar.gz: Network Error: Network Error: Error encountered in the status line: timed out reading response', src/deps.rs:128:33 note: run with "RUST_BACKTRACE=1" environment variable to display a backtrace thread '<unnamed>' panicked at 'unable to get lock: PoisonError { .. }', src/deps.rs:125:45 Error: thread panic: Download of https://github.com/bell-sw/Liberica/releases/download/20.0.1+10/bellsoft-jre20.0.1+10-linux-amd64.tar.gz failed with error https://github.com/bell-sw/Liberica/releases/download/20.0.1+10/bellsoft-jre20.0.1+10-linux-amd64.tar.gz: Network Error: Network Error: Error encountered in the status line: timed out reading response

The client seems to timeout when downloading the archive : 2023-06-26 13:08:05 GET https://objects.githubusercontent.com/github-production-release-asset-2e65be/115621629/264958f3-8da1-4418-9788-ad8625f60147?X-Amz-Algorithm=AWS4-HMAC- SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230626%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230626T110806Z&X-Amz-Expires=300&X-Amz-Signature= 102da5228d79ffda9853275d12687c9a139d2cec1ce6305b84aae18c91ec965d&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=115621629&response-content-dispo sition=attachment%3B%20filename%3Dbellsoft-jre20.0.1%2B10-linux-amd64.tar.gz&response-content-type=application%2Foctet-stream ← Client disconnected.

Would it be possible to override the default timeout configurations for the command ?

dmikusa commented 1 year ago
  1. Please go grab the latest version (or at least 1.19). That will get you this fix, which handles timeouts in a more sensible way.
  2. If that still isn't sufficient, you can control the timeout settings with env variables. See the docs here.
  3. It may not be a timeout that is causing the issue, but that may be just the symptom. If you're behind a proxy or on a corporate network, you may need to configure a proxy for your network.
  4. Make sure that your network admin doesn't block connections to the location in question. The bt tool needs to have network access to download the resources.

Hope that helps!

M3hdi commented 1 year ago

Hi Daniel,

I'm happy to report that increasing the read timeout solves the issue (I'm using the tool behind a corporate proxy on which the connection can be shaky at times)

Thank you very much for your quick and detailed answer.

Cheers