Hello ESRI Support,
I'm using AttachmentListModel QML object to add/upload multiple pictures to multiple feature service layer and it is working okay until we do find out the issue while application is deployed in load balancer environment which has multiple AGS server instance.
When I have analyzed the web traffic through Fiddler, it is learnt that ESRI QML API is using two separate REST API calls to AGS server adding the attachment. It seems the upload call is staging the image to ESRI AGS server directory and then later AddAttachment is using that image to actual upload to feature. This is working expected in non load balancer environment.
arcgis/rest/services/***/*****/FeatureServer/uploads/upload
arcgis/rest/services/**/***/FeatureServer/123/114702/addAttachment
However, we are seeing an issue while same code is being deployed with load balancer having multiple AGS machines. We are seeing following error during the "addAttachment" REST API call because both REST call are made to different server for the same attachment and that causing error as AddAttachment unable to find upload image part of upload REST call.
ERROR: code:500, Unable to find uploaded item ibaae3c8d-d0fd-436d-970b-4932eba204f0 information. null, Internal server error.
Please let us know if any reason why API choses two separate call to add an attachment and is there any way to make only one call in QML?
Thanks,
Vipal
Hi @VipalShah1 . Thanks for reaching out to the Runtime team.
I checked with our engineers and unfortunately there is no way with the Runtime to switch to the addAttachment API call alone.
One possibility you could try would be to disable supportsAttachmentsByUploadId feature on the service, but I don't know the details on how to do that. If the server doesn't support that, the Runtime should fallback to only using the addAttachment REST Api call.
Thanks James! I will try your suggested approach and will update you.