Esri / arcgis-rest-js

compact, modular JavaScript wrappers for the ArcGIS REST API
https://developers.arcgis.com/arcgis-rest-js/
Apache License 2.0
347 stars 120 forks source link

Updating feature edits for an embedded credential feature service using REST JS will timeout (504 error) #958

Closed jf990 closed 2 years ago

jf990 commented 2 years ago

Technical support submitted issue from Enterprise customer

Record#: BUG-000147513

Primary Dev Contact: Patrick Arlt

Severity: Medium

Bug Type: Failure/Error

Synopsis: Updating feature edits for an embedded credential feature service using REST JS will timeout (504 error)

Steps to Reproduce:

Reproducible with REST JS 3.4.3

Reproducible with an embedded credential feature service on a 10.9.1 Enterprise server

Not reproducible with a hosted feature service or a feature service (non-hosted) on a 10.9.1 Enterprise server

Not reproducible with a hosted feature service or an embedded credential feature service from ArcGIS Online

Updating feature edits for an embedded credential feature service using REST JS will timeout (504 error). Depending on the service, it might take at least 10 individual update feature edits in a for-loop before the requests timeout (504 error). Although the service requests times out, the edit requests are successfully applied because the changes are reflected in the query. Whether using a hosted feature service a non-hosted feature service (references a geodatabase), the issue seems specific to proxy services in Enterprise and using REST JS. Testing feature edits with chained requests from POSTMAN does not seem to reproduce 504 errors. As a workaround, applying a single bulk edit request rather than sending multiple individual edit requests will not generate a 504 error.

Issue seems similar BUG-000114163, BUG-000140115, and BUG-000114230

**Note: Keep in mind, reproducing the issue might make the Enterprise server become unresponsive until the service requests finish.

Steps to Reproduce:

-----Setting up the feature service-----

  1. Download and extract the file geodatabase
  2. Add connection to the file geodatabase from ArcGIS Pro
  3. Publish the TestPoints feature class as a hosted feature service to an Enterprise server. Ensure that it has editing capabilities.
  4. Once the hosted feature service is published, add the service again by embedding your credentials.
  5. Share the service publicly.

-----Running the app-----

  1. Launch the sample app
    1. https://jsfiddle.net/nperez00/uneo71ga/
  2. Copy-paste the service URL into line 12
  3. Open the developer console.
  4. Run the app. If the network requests do not timeout, try specifying a higher number. Otherwise, the app should generate a 504 error in the console. Specifying a lower number such as 5 should not have an issue with the proxy service. Using the original hosted feature service URL will also not have an issue.
  5. Query the features using where clause 1=1 and out fields to '*'. You will see that the feature edits are applied even though the requests had timed out.

Workaround:

Legacy Data Path:

Data Path: \esri.com\sf_filestore\PRD\Attachments\Defects\BUG-000147513

---Primary System Profile Information---

Product: ArcGIS REST JS

Version: 3.0

Service Pack:

OS Name: Windows OS

OS Version: 10.0

Language:

Extension:

Virtual Technology:

DBMS:

DBMS OS:

Web Server:

Servlet Engine:

Raster:

Mobile Device Type:

Mobile Device Model:

---Case Information---

Original Case #: 02972406

Submitted By: Nick Perez

Submit Date: 3/10/2022 5:56 PM

Account: Driscolls Inc

---Functional Map Information---

Product: Esri Rest JS

Version: No Version Found

Team: Esri Rest JS

Functional Area: Esri Rest JS

Description: Esri Rest JS API and Guide

System/End Point: GitHub

Package Assembly:

Project/View:

TFS Instance Prefix:

TFS Server URL:

TFS Project Name:

TFS Sub Project:

GitHub Server: https://github.com

GitHub Organization Name: ArcGIS

GitHub Repository Name: afd-open-source-and-third-party-doc

patrickarlt commented 2 years ago

Closing this. I've verified that ArcGIS REST JS is sending the proper requests in this scenario. The 504 error is likely the result of limited server resources. Since the fix is to do a bulk update (a best practice) anyway this isn't a REST JS issue.