ARTIFACTORY: How to resolve the "Cannot deploy file 'xxx'. 503: Failed to stream binary to sub provider" error when using S3 Sharding template

ARTIFACTORY: How to resolve the "Cannot deploy file 'xxx'. 503: Failed to stream binary to sub provider" error when using S3 Sharding template

AuthorFullName__c
Yunzong Guo
articleNumber
000006328
ft:sourceType
Salesforce
FirstPublishedDate
2025-01-13T14:35:56Z
lastModifiedDate
2025-01-13
VersionNumber
2
Introduction 

When using the S3 Sharding template, you may encounter an error "Cannot deploy file 'xxx'. 503: Failed to stream binary to sub provider" when uploading a file, for example, upload a file via the UI, the error is:

User-added image 

This issue often occurs when multiple S3 endpoints in S3 sharding use different HTTP protocols, such as one using HTTP and the other using HTTPS.


Resolution 

Here are the steps for checking and resolving this issue:

Step 1:
Refer to the S3 Sharding template, and ensure that the parameters and the format for your S3 configuration are correct, configuration file path: $ARTIFACTORY_HOME/var/etc/artifactory/binarystore.xml

Step 2:
If the configuration is correct and the error still persists, check if you have multiple S3 endpoints with different protocols, such as one using HTTP and the other using HTTPS:
<?xml version="1.0" encoding="UTF-8"?>
<config version="2">
… 
   <provider type="state-aware-s3" id="s3-shard1">
      <bucketName>test1</bucketName>
      <endpoint>s3.amazonaws.com</endpoint>
      <credential>secretAccessKey</credential>
      <identity>accessKeyId</identity>
   </provider>

   <provider type="state-aware-s3" id="s3-shard2">
      <bucketName>test2</bucketName>
      <endpoint>http://locahost2</endpoint>
      <port>9000</port>
      <credential>secretAccessKey</credential>
      <identity>accessKeyId</identity>
      <useHttp>true</useHttp> 
   </provider>
</config>
According to the above configuration, the “s3-shard2” endpoint uses HTTP protocol, and the “s3-shard1” uses HTTPS (by default).

Step 3:
You could change the protocols of both S3 endpoints to the same. For example, add the parameter <useHttp>true</useHttp> to “s3-shard1” endpoint to use HTTP:
<?xml version="1.0" encoding="UTF-8"?>
<config version="2">
… 
   <provider type="state-aware-s3" id="s3-shard1">
      <bucketName>test1</bucketName>
      <endpoint>s3.amazonaws.com</endpoint>
      <credential>secretAccessKey</credential>
      <identity>accessKeyId</identity>
      <useHttp>true</useHttp> 
   </provider>

   <provider type="state-aware-s3" id="s3-shard2">
      <bucketName>test2</bucketName>
      <endpoint>http://locahost2</endpoint>
      <port>9000</port>
      <credential>secretAccessKey</credential>
      <identity>accessKeyId</identity>
      <useHttp>true</useHttp> 
   </provider>
</config>
After changing both endpoints to use the same protocol (HTTP), deploy the file again, and it will be successful.

If you refer to the default S3 sharding template and configure both endpoints to use HTTPS protocol), uploading the file will also be successful.
(Notes: without configuring the parameter <useHttp>true</useHttp>, HTTPS is used by default.) 


Conclusion 

This article introduces how to resolve the issue "Cannot deploy file 'xxx'. 503: Failed to stream binary to sub provider" that occurred when using the different protocols in the S3 Sharding template. The error can be fixed by ensuring that all S3 endpoints are configured with the same protocol (HTTP or HTTPS).