Message":"Error while loading file '' from storage: Invalid Amazon S3 file path 9572/03239a2b-7bc2-41e3-8454-2462efda6f04/

Hi,
I Aspose version v1.1 We are trying to generate merge document which includes QR code in it.
Input : word doc
output: PDF
Endpoint: https://api.aspose.com
Version : https://api.aspose.com/v1.1
When trying to generate document in salesforce getting below error
“Message”:“Error while loading file ‘’ from storage: Invalid Amazon S3 file path 9572/03239a2b-7bc2-41e3-8454-2462efda6f04/”
res|“System.HttpResponse[Status=Bad Request, StatusCode=400]”|

This same template /functionality is working as expected in one of our salesforce org but not working in another salesforce org.
Both the org using same keys and secret id:
Aspose App Key: 498fa6de3015827e728d7bd3baeb5492
Aspose App Sid: E8C4F52B-F08B-456F-AD91-6EC71C2A1896
Amgen Merge Template (4).docx (33.0 KB)

Hi,
Could you please investigate on this issue.

Thanks in advance.

Can we get ETA for this issue?

1 Like

I’m also facing this problem. We are waiting for a timeframe for a solution.

Do we have any further update on this?

@centris.aspose
Please provide more details and example of code.

Please find code where issue is occurring.

public String executeTemplateMerge(String FileName, String dataFile) {
String DocName, httpRequestMethod;
try {
if(asposeVersion1_1){
strURI = Aspose.BaseProductUri + ‘/words/’ + FileName + ‘/executeTemplate?cleanup=ContainingFields,EmptyParagraphs,UnusedFields,UnusedRegions,RemoveTitleRow,RemoveTitleRowInInnerTables’;
signedURI = AsposeUtils.Sign(strURI);
httpRequestMethod = ‘POST’;
}else{
FileName = FileName.replace(’ ', ‘%20’);
signedURI = Aspose.BaseProductUri + ‘/words/’ + FileName + ‘/MailMerge?withRegions=True&cleanup=UnusedFields&useWholeParagraphAsRegion=False&destFileName=merge_’+FileName;
accessToken = GetJWT();
httpRequestMethod = ‘PUT’;
}
String strJSON = AsposeUtils.ProcessCommand(signedURI, httpRequestMethod, dataFile, ‘json’, accessToken);
//String downloadURL = null;
Map<String, Object> params = (Map<String, Object>) JSON.deserializeUntyped(strJSON);
if(params.containsKey(‘Document’)){
Map<String, Object> doc = (Map<String, Object>) params.get(‘Document’);
DocName = (String) doc.get(‘FileName’);
}

        return DocName;
    }
    catch (Exception ex) {
        system.debug('ASPOSE Merge Service Exception : '+ex);
        throw new DataSourceException('ASPOSE Merge Service Exception : '+ex);
    }
}

////////////////////////
public with sharing class AsposeUtils {
public static String ProcessCommand(String strURI, String strHttpCommand, String strContent, String ContentType, String accessToken) {
try {
HttpRequest request = new HttpRequest();
Integer len = 0;
if (strContent != null && strContent != ‘’) {
request.setBody(strContent);
len = strContent.length();
}

        commonApiExecution(strURI,strHttpCommand,contentType,request,accessToken,len);
        
        if(TEST.isRunningTest() ){
        	return AhmConstants.ASPOSE_MOCK_RESPONSE_MERGE_CALL;
        } else{
        	Http http = new Http();
        	HttpResponse res = http.send(request);
        	return res.getBody();
        }
    } catch (Exception ex) {

        throw new DataSourceException('ASPOSE Service Exception : '+ex);
        return null;
    }
}

}

/////////////////////////////////

Here is the debug log
Debug log from salesforce.docx (2.8 MB)

Many of our clients are impacted by this issue.
Could you please help us on fixing the same.

We will investigate this issue; thank you for sharing the code with us.

Do we have any update on this?

I couldn’t reproduce it and asked my colleagues from the storage team to check it out. Thanks for your patience.

We would appreciate if we could get some solution or information on this since
most of our clients affected by this .

Thanks in advance.

Here is what I can find in logs:
Error while loading file ‘’ from storage: Invalid Amazon S3 file path 9572/03239a2b-7bc2-41e3-8454-2462efda6f04/ Inner Exception type: WordsApiException Inner Exception Stacktrace: at Aspose.Words.Cloud.Config.FileManagerErrorProxy.Download(String path) at Aspose.Words.Cloud.Business.MailMerge.Image.ScaleImageFieldMergingHandler.TryLoadFromFileManager(String filename) at Aspose.Words.Cloud.Business.MailMerge.Image.ScaleImageFieldMergingHandler.Handle(ImageFieldMergingArgs args, MergeFieldData data) at Aspose.Words.Cloud.Business.MailMerge.FieldMergingCallbackImpl.ImageFieldMerging(ImageFieldMergingArgs args) at Aspose.Words.MailMerging.MailMerge.(ImageFieldMergingArgs )

So, it basically fails to download images from storage as the filename is empty. Can I ask you to share data for this template?
Thanks.

Please find the data we are trying to process
participant records.docx (490.5 KB)

Thank you for sharing the data; I will try to replicate the issue.

Do we have any update on this?

I reproduced the issue, now it is in analysis. Thanks for your query.

Hi,
Any update on this issue?

The issue is more complex than we expected, so we continue the analysis. Could you share a shortened version of the data you use for the template? I need only a couple of entities that make the issue repeatable.
Thanks.

Hi please find the data as requested.
I added 10 participants while generating merge document with QR code same error is occurring.
PFA
less particiapnts.docx (16.7 KB)

participant records for qr code.docx (35.7 KB)