Hi, we’re facing a challenge with uploading large files using this component. Specifically, when the file size exceeds 1GB, we consistently encounter a communication exception (with a 502 or 504 error code), even though our platform configuration allows uploads up to 2GB. To give you a bit more context, these uploads are directed toward MSFT SharePoint, which itself supports files up to 250GB.
We’ve read through the MSFT best practices (driveItem: createUploadSession - Microsoft Graph v1.0 | Microsoft Learn) that suggest resuming or retrying the upload process when a connection timeout occurs. With that in mind, I’d like to know if the component offers any built-in mechanism to support this approach—namely, the ability to identify the last successfully processed chunk and then continue the upload from that point, rather than starting over (also because it would continue to go in timeout error).
Hello Lorenzo,
Thank you for your message and explanation, that really helps.
Could you post any error messages and stack traces you get when an error occurs.
Also can you please confirm what value you are setting on the Site Property "UploadFileTimeoutSeconds".
This should help me understand what is failing.
Also, this component only uploads files to OutSystems database, not to SharePoint. If there is a failure uploading to sharepoint it is unlikely I will be able to help. The notification for an uploaded file is only sent when the file has successfully been stored in OutSystems, so retrying a chunk will not likely be of any help to you.
I will wait for your response.
Kind regards,
Stuart
Hi Stuart, thanks for reply.
The Site Property is set to 180 seconds. Actually I don't have the entire stack trace for the error. I will try to replicate in non productive environment and I'll attach later.
The message that we got is: "Request failed with status 502 ". The stack that I can share now is:
Action Name: Upload_OtherDocumentsEndpoint: screenservices/PUI_Documents/MainFlow/OtherDocuments/ActionUpload_OtherDocuments CommunicationException: Request failed with status 502 at request.onSuccess (https://edisonspa.outsystemsenterprise.com/PUI_Documents/scripts/OutSystems.js?ZTMnhR7E1vQlowP8aibdpg:5142:36) at XMLHttpRequest.<anonymous> (https://edisonspa.outsystemsenterprise.com/PUI_Documents/scripts/OutSystems.js?ZTMnhR7E1vQlowP8aibdpg:4833:17)
With regards to the integration with SharePoint, let me better explain: we upload on OutSystems and then we send the chunks to SharePoint, but the error is not in the integration with SharePoint as we don't have errors on integration logs, it's on OutSystems side.
Hope this might help, thank you.
Hi Lorenzo,
Thanks for the additional information.
To understand what is happening we must confirm at what point the error is occurring. Once you retrieve the full stace trace that will help.
It seems most likely that SharePoint is returning a 502, but without the stack trace its impossible to be sure. Have you checked the SharePoint Unified LoggingService logs, or SharePoint IIS logs?
You could also check the details of the temporary file uploaded to the component database to see if it uploaded to OutSystems correctly.
Can you explain more about how the upload to SharePoint is triggered and at what stage? Also, can you explain how the chunking is working when sending to SharePoint?
I know I am asking alot of questions, but you need to provide this information if I am going to be able to help.
This final point, and up to you whether you accept this or not, but for this scenario, this component is not the most efficient because it stores an intermediate copy of the file in OutSystems prior to uploading to SharePoint.
A better solution would be to chunk the file in the browser, then send each chunk to OutSystems which immediately uploads to SharePoint without the temporary storage in OutSystems. This would be much quicker and more efficient.
I hope this helps!
Hi, The gateway is killing the request since the backend is heavy processing. have you tried this process in your lower environments ?
Aravind, there is no evidence the gateway is killing the request, and if it did, it would most likely return a 504 not a 502. Please wait for further information and only comment if you genuinely have something that could help.
Hi, I've made several tests today with always the same result (502) and without getting further info in the stack trace. I'm pretty convinced that the problem is not on the component-side, neither in the logic, and I'm going to say why: the large file is splitted into chunks and the sending of the chunks regularly happens (SendFileChunk30). Also, this ends with the action SendFileChunksVerify. Then, the integration with SharePoint through GraphAPI starts and no errors occurred there. At this point, when the file is <1Gb the server action that contains this simple logic (a for each with the integration with SharePoint and the update of the variables for the iterations), ends successfully. When the file is >1Gb the action terminates with the error code 502. So, I guess that this interruption happens at infrastructure level and the component is not responsible at all for that. Please, let me know your point of view. Thanks
I need more information to understand what is happening.
From what you are describing, it sounds like you have modified the component at the point where it uploads a chunk. Is that correct? If it is, could you communicate what those changes are.
Also it would be the Send180 action if the component is configured with the timeout site property as 180.
If you can identify exactly where the error is occurring, we can start to get an idea of what is going wrong. The action you mentioned original is not part of the component as available in the Forge.
I would like to be able to help, but you need to provide enough information. Please respect my time and effort in supporting this component and provide reasonable information in order to diagnose, otherwise I cannot help any further.
Hi Stuart, that action that I've mentioned is not within the component. It's an application logic outside the component.
Now I'm going to check with infrastructure-team and outsystems itself (it's a cloud instance) if the problem resides on that level.
Then, I'll try to apply that suggestion that you mentioned before, so chunking the file in the browser, then send each chunk to OutSystems that acts as a bridge to SharePoint without the temporary storage.
I'll keep you updated
Thanks, regards