ARTIFACTORY: How to Resolve "Actual bytes sent to client are different than expected" Warnings and Client Timeouts

Products
Frog_Artifactory
Content Type
REST_API
AuthorFullName__c
Andrew Roellig
articleNumber
000007144
FirstPublishedDate
2026-08-30T07:02:40Z
lastModifiedDate
2026-08-30

ARTIFACTORY: How to Resolve "Actual bytes sent to client are different than expected" Warnings and Client Timeouts

Overview / Introduction
When downloading artifacts through a Remote Repository in Artifactory, downstream client requests (such as curl or automated CI/CD build scripts) may hang and time out. One possible reason for this is when the upstream remote server returns a different payload size during a GET request than what was originally reported during an initial metadata HEAD request. Configuring Artifactory to bypass HEAD requests on the affected remote repository resolves these response-size mismatches and prevents client download timeouts.


Symptoms & Error Messages
  • Downstream client build jobs hang indefinitely or hit a read/operation timeout during artifact downloads.
  • artifactory-service.log records a WARN entry indicating a byte discrepancy between expected and actual bytes transferred.
Artifactory Log Entry (artifactory-service.log):
Plaintext
2026-08-25T11:17:23.396Z [jfrt ] [WARN ] [0695490a38016ff595e7bcb13b34cd14]
[a.r.ArtifactoryResponseBase:81] [p-nio-8081-exec-5487] -
Actual bytes sent to client (165) are different than expected (276).
Client Terminal Error (e.g., curl):
Plaintext
curl: (28) Operation timed out after 30000 milliseconds with 165 out of 277 bytes received


Root Cause
When an artifact download request passes through an Artifactory Remote Repository, Artifactory first issues an HTTP HEAD request to the upstream source server to check metadata and fetch the expected Content-Length. Artifactory then forwards this header value to the requesting client.
Afterward, Artifactory executes an HTTP GET request to retrieve the actual file payload. If the upstream server modifies the file dynamically, applies transport compression (such as GZIP), or misreports file sizes between HEAD and GET calls, the received payload will be smaller or larger than advertised. Because the downstream client expects the exact byte count provided in the initial header, it keeps the connection open waiting for the remaining data until reaching a client timeout.


Step-by-Step Solution
Step 1: Enable "Bypass HEAD Requests" via UI
  1. Log into your Artifactory Web UI with Administrator privileges.
  2. Navigate to Administration > Repositories > Repositories.
  3. Select the Remote tab and click on the affected remote repository key.
  4. Open the Advanced configuration sub-tab.
  5. Check the Bypass HEAD Requests option.
  6. Click Save & Finish to apply the configuration.


Alternative: Enable via REST API
To apply this setting across automated environments, update the remote repository configuration using the Artifactory REST API:
Bash
curl -u admin:<PASSWORD> -X POST
"https://<ARTIFACTORY_URL>/artifactory/api/repositories/<REPO_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "bypassHeadRequests": true
  }'


Step 2: Clear Cached Artifact Metadata
To prevent clients from reading previously cached header states:
  1. Navigate to Application > Artifactory > Artifacts.
  2. Locate the target file in the <REPO_KEY>-cache repository.
  3. Right-click the file or parent folder and select Delete.


Verification
  1. Execute a fresh download request from your terminal:
Bash
curl -s -o /dev/null -w "%{http_code}\n" --max-time 30
"https://<ARTIFACTORY_URL>/artifactory/<REPO_KEY>/<PATH_TO_FILE>"
  1. Confirm that the request returns an immediate 200 status code without hanging, and verify that artifactory-service.log no longer produces byte-mismatch WARN entries for the transaction.


Related Resources