Unable to Save/Edit Features to ArcGIS Online

429
2
Jump to solution
06-30-2023 09:00 AM
Labels (3)
neomapper
Occasional Contributor

I downloaded Esri's latest Gas As-Builting solution and have been trying to move data from our UPDM2016 database to ArcGIS Online. I've been getting a 504 error on ArcGIS Pro (append, field calculate update/saving), which means that a gateway timeout occurred during my attempt at moving several hundred records at a time. Is there anyone out there with some ideas or scripts that might make this easier?

 

I've spent three weeks trying to get data pushed to AGOL using ArcGIS Pro, and I've found the process very frustrating.

0 Kudos
1 Solution

Accepted Solutions
RhettZufelt
MVP Frequent Contributor

I have a script that calculates values for AGOL hosted feature layers, and come across the 504 error frequently.  In fact, I pretty much expect it to fail most days if you are calculating very many records.

So, I createa list of the unique id's for the features I want to update, and an empty list called doneList.

Every iteration that succeeds appends the ID for that feature to the doneList.

Then, I have the call to the function that does the updates in a try: within a try: and while true statement similar to :

 

try:

    CreateIDlist()  # runs function to populate the list of features I want to process

    while True:
        try:
            DotheCalcs()
            break  # stop the loop if the function completes sucessfully
        except Exception as e:
            print("Function errored out!", e)
            print("Retrying ... ")
        print("Done with inner try")

 

 

So, the try function creates the list of ID's to process, then enters the While True: try: block.

that sends it to the function that does the calculations, and if it succeeds without error, it will "break" and end the whle/try loop and we are done.  If it errors, it prints the Function error out/Retrying message and sends it back to the DotheCalcs() function again.

In beginning of the DotheCalcs() function, 

 

for ID in toUpdateList:

  if ID not in donelist:
      (fl.calculate(where=sqlclause, calc_expression={"field": "Description", "value" : DescrDict[mc]}))  # Do the Calculation
      donelist.append(mc)

 

So, if it fails, it will try to run again, but, already has a list of what has been done already.

If the ID is not in the list, then the calculation has not succeeded on that feature, so it tries it again.

Some days it will process all 11,000 records without fail, others, it will restart itself one to many times until the list is completed.

R_

 

View solution in original post

2 Replies
RhettZufelt
MVP Frequent Contributor

I have a script that calculates values for AGOL hosted feature layers, and come across the 504 error frequently.  In fact, I pretty much expect it to fail most days if you are calculating very many records.

So, I createa list of the unique id's for the features I want to update, and an empty list called doneList.

Every iteration that succeeds appends the ID for that feature to the doneList.

Then, I have the call to the function that does the updates in a try: within a try: and while true statement similar to :

 

try:

    CreateIDlist()  # runs function to populate the list of features I want to process

    while True:
        try:
            DotheCalcs()
            break  # stop the loop if the function completes sucessfully
        except Exception as e:
            print("Function errored out!", e)
            print("Retrying ... ")
        print("Done with inner try")

 

 

So, the try function creates the list of ID's to process, then enters the While True: try: block.

that sends it to the function that does the calculations, and if it succeeds without error, it will "break" and end the whle/try loop and we are done.  If it errors, it prints the Function error out/Retrying message and sends it back to the DotheCalcs() function again.

In beginning of the DotheCalcs() function, 

 

for ID in toUpdateList:

  if ID not in donelist:
      (fl.calculate(where=sqlclause, calc_expression={"field": "Description", "value" : DescrDict[mc]}))  # Do the Calculation
      donelist.append(mc)

 

So, if it fails, it will try to run again, but, already has a list of what has been done already.

If the ID is not in the list, then the calculation has not succeeded on that feature, so it tries it again.

Some days it will process all 11,000 records without fail, others, it will restart itself one to many times until the list is completed.

R_

 

TomKukitz
New Contributor III

Hi,

Yes I am getting the error as well. I am trying to edit 10572 features, which is about 25MB of data and it 504's me all the time. I put in a support ticket and Esri is working with me to remedy the issue. The last suggestion is to run ArcPro as an administrator and see if this works. Years ago ArcMap would only work if you were a local admin, so maybe Pro is having a similar issue. I won't be able to test admin rights until Thursday, when I will have temp admin rights to install PostgreSql and PostGIS. I was thinking maybe this will help if I editing locally in a sql server then try to copy and paste new edits to my AGO feature services. IF you have admin rights on your machine and you still get the error please let me know, so I know admin rights will not make any difference on a 504.

So many issues for such expensive software. I was actually thinking of going back to using QGIS and another mapping service because ArcPro needs so much work, and they are trying to stop people from using ArcMap, best ever mapping software!

0 Kudos