Why is there an error message when using apply edits?

406
9
Jump to solution
06-19-2019 11:04 AM
JackFairfield
Occasional Contributor II

If you try to apply an edit in this esri sample:

https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=editing-applye...

Observe the network request, it returns a 502 code.

Here is an example fetch request that should work:

fetch("https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/IncidentsReport/FeatureServer/0/applyEdits", {"credentials":"omit","headers":{"content-type":"application/x-www-form-urlencoded"},"referrer":"https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=editing-applyedits","referrerPolicy":"no-referrer-when-downgrade","body":"f=json&deletes=42558","method":"POST","mode":"cors"});

It returns a 502 error for some reason.

What am I doing wrong? Or is this a bug?

0 Kudos
1 Solution

Accepted Solutions
DavidWilson3
Occasional Contributor

Jack,

I understand your concern but DNS 502 errors mainly only happen when your site has made recent changes to its DNS server, which is a result of changing host servers or moving the site to a different IP address. As such if your customers come into this problem they should only have to deal with the DNS propagation once by flushing their DNS. I personally would not be concerned too much about the chances of it happening to customers and if it does I have outlined the trouble shooting steps previously. 

View solution in original post

9 Replies
DavidWilson3
Occasional Contributor

Hi Jack,

I am not getting any errors when applying edits with this sample no matter what I try and apply. I think perhaps it has to do with your fetch request, have you tried looking at documentation for the esri/request class? Perhaps you should try that approach instead, here is documentation: request | ArcGIS API for JavaScript 4.11 

0 Kudos
JackFairfield
Occasional Contributor II

I have tried the esri/request class.  It isn't any different.  I have additionally tried the applyEdits method on a featurelayer.  Also, using the gui and inputting the delete feature id directly, I still get the same error.

0 Kudos
JackFairfield
Occasional Contributor II

I just attempted the same post request on a different computer.  It works.  No idea what is happening on my machine.

0 Kudos
DavidWilson3
Occasional Contributor

Jack,

502 errors are bad gateway errors, most likely the issue is on your end with your browser or networking equipment. I would suggest that you either start a new browser session, clear your browser cache, delete you browser's cookies, start your browser in safe mode or try another browser. You could also try restarting your computer or networking equipment. And if none of that works perhaps try and change your DNS servers  temporarily. 

0 Kudos
DavidWilson3
Occasional Contributor

Hi Jack, 

Have any of my suggestions helped with you using your post request on your own machine?

0 Kudos
JackFairfield
Occasional Contributor II

Using a different browser, it cleared up the errors.  I tried on another machine in chrome and the same issue was occurring.  I want to prevent this from happening for my chrome users.

0 Kudos
DavidWilson3
Occasional Contributor

Jack,

Are your computer's chrome browsers using any extensions? If so try disabling those extensions, and if not try and delete the cookies and caches from your chrome browsers on your computers. One more thing I can think of is that is causing this to happen to you is your DNS server, at that point you can try and change your DNS or flush your DNS. Flushing is quite easy to do and is quick google search. Again I will say that I did not get an error when I used the example and I was using chrome myself. 

0 Kudos
JackFairfield
Occasional Contributor II

Thanks for the responses.  I tried flushing my DNS.  It fixed the issue on this computer.  But I still am worried about a potential customer running into the same issue on their machine.

0 Kudos
DavidWilson3
Occasional Contributor

Jack,

I understand your concern but DNS 502 errors mainly only happen when your site has made recent changes to its DNS server, which is a result of changing host servers or moving the site to a different IP address. As such if your customers come into this problem they should only have to deal with the DNS propagation once by flushing their DNS. I personally would not be concerned too much about the chances of it happening to customers and if it does I have outlined the trouble shooting steps previously.