jfrog / jfrog-cli

JFrog CLI is a client that provides a simple interface that automates access to the JFrog products.
https://www.jfrog.com/confluence/display/CLI/JFrog+CLI
Apache License 2.0
530 stars 227 forks source link

JFrog CLI net/http: TLS handshake timeout #2591

Open DavidRadoorHummel opened 3 months ago

DavidRadoorHummel commented 3 months ago

Hello,

We have a situation where we throttle requests to Artifactory through NGINX, if requests are coming too rapidly.

However, it seems that this throttling sometimes causes issues when using the jf c add command, with the error:

[Warn] (Attempt 1) - Failure occurred while sending GET request to https://artifactory.com/api/security/encryptedPassword: Get "https://artifactory.com/api/security/encryptedPassword": net/http: TLS handshake timeout
[Info] executor timeout after 0 attempts with 0 milliseconds wait intervals
[Info] Trace ID for JFrog Platform logs: aadd224d84634252
[Error] The following error was received while trying to encrypt your password: Get "https://artifactory.com/api/security/encryptedPassword": net/http: TLS handshake timeout

We would prefer not to disable the TLS verification.

Is it possible to increase the timeout threshold for JFrog CLI?

Best regards, David

DavidRadoorHummel commented 3 months ago

So we did some digging around.

Neither NGINX nor Artifactory recognized any issues in their log files. No errors or even warnings. Not even any info messages about this.

We tried to increase the flow through NGINX which lowered the frequency of this issue.

So it seems like an issue entirely related to JFrog CLI. We also noticed the time stamps. It seems JFrog CLI waits about 10 seconds for the handshake before giving up.

However - even when disabling the TLS verification this error still occurred, which leads me to believe it is a general timeout issue for JFrog CLI.

My best guess is, that JFrog CLI does the following (very crudely set up):

This is just conjecture on my part, but based on the following observations:

It is entirely jf c add that fails. Any other JFrog CLI command (as observed) have no issue with the throttling.

Finally, this has not been an issue before, but started appearing about 2 months ago.

I hope the above can help others with this issue or help you maybe pinpointing the source of the issue.