How to delete Offline Sync Version created by Field Maps

2811
10
Jump to solution
06-07-2022 07:31 AM
JonathanDandois
Occasional Contributor

Probably just missing a step, but I keep missing it consistently. I have a Traditional versioned dataset in our Portal. The Web Map and layers is configured for sync with a version per user. Creating offline area, editing and syncing all works fine. But when I go to delete the version created for this user I get the error "Operation not allowed on a version with dependent children." I know how to fix this in the SQL Server backend, by manually deleting all the dependent children first. But am I missing a step in a typical offline editing process?  thanks!

0 Kudos
1 Solution

Accepted Solutions
JonathanDandois
Occasional Contributor

Posting a final follow-up.  I submitted a support ticket with Esri and went all the way through a number of very helpful support departments from Field Maps to Enterprise, finally landing on the SDE / DB team. This is a synopsis of how far we got.

It seems like my process is generally correct, but somewhere along the way when I remove an Offline Area from Field Maps the action to remove the child SYNC versions of the offline editing version is not making it to the back-end and so those child versions are not being deleted.

ArcGIS Pro only displays the main offline edit version, a child of DEFAULT, but does not display the other children of that version. Trying to delete the main offline edit version results in the `160361: Operation not allowed on a version with dependent children.` error, which is recognized but has no solutions, here.

WARNING: READ BELOW AT YOUR OWN RISK.

So the only solution we could identify was to access the SDE_VERSIONS table in the back-end DB and manually delete the dependent children of the main offline edit version. So in the screens below version_id = 173 is the main offline edit version that is visible in ArcGIS Pro and which cannot be deleted in Pro. The additional SYNC versions below that are all children of that version and these are not visible in ArcGIS Pro.  These versions should be deleted when the Offline Area is removed, but for some reason in my workflow that is not always happening.

So. I manually, and carefully, write out the DELETE statement for each of the child versions, double checking that it is part of the version tree of version_id = 173. Extreme caution here since this example on our dev environment is relatively easy and there are no other versions happening at the same time. In production, it is more likely that there are other versions mixed in among these, so it is an arduous task. Obviously be careful here because DEFAULT is right there! 😬 So we felt there was no "smart" SQL statement way to perform this, no range or JOIN, and that each WHERE should be typed out manually and deliberately. 

SDE_DELETE.PNG

 

 

 

 

 

 

With the versions deleted the, there are no more dependent children of the main offline edit version and that version can and should be removed in ArcGIS Pro only, don't delete it from the DB back-end!

SD_Clean.PNG

 

 

I'd say this situation comes up for me about 80% of the time.  So I will continue to test this out.   20% of the time when I remove an Offline Area after offline work is complete and the rec/post have been performed, I am able to delete the main offline edit version in ArcGIS Pro as expected without this back-end work.

At this point I am wondering if there is an issue where Field Maps isn't connected to our Enterprise Portal prior to removing the offline areas. If the credentials are somehow "stale" or if the iPad isn't fully connected to the network and signed in to Portal.

For now I think this is closed. But I will update if any new information comes up! Thanks to the Esri Support team for all their help with this!

 

View solution in original post

10 Replies
Sean_Haile
New Contributor III

The sync version should be automatically deleted when the mobile user uses Field Maps to remove the offline area from their device, assuming the mobile device is connected to a network when the remove area option is invoked.

JonathanDandois
Occasional Contributor

That is what I thought too, but that does not seem to be happening.  I will try it again with some more test cases. 

0 Kudos
JonathanDandois
Occasional Contributor

@Sean_Haile I have tried this again with another account and another iPad and I get the same result. I agree that what you said is what is supposed to happen. Remove the offline area, rec & post in the office to DEFAULT, and then be able to remove the version, but I keep getting the error. I updated Field Maps to the latest version on my iPad and get the same results. I think i was followed the guidance on this post. Guess I will try recreating the service and see if that does it. 

0 Kudos
JonathanDandois
Occasional Contributor

@Sean_Haile I re-read your comment, I do not believe that the sync version would be deleted when the offline area is removed. Deleting the version is done by the manager or user after confirming that any edits are sync'd rec/posted, and the offline area is removed. 

Alright, I've tested this a bit more.  I did the following:

Test 1:

  1. Create a new offline capable web map
  2. In Field Maps, create offline area and test adding / removing features
  3. Confirm rec / and post in back-end.
  4. Delete offline area from Field Maps
  5. Delete Version - SUCCESS.

Test 2:

  1. Using map from above
  2. Create new offline version, confirm editing, sync, etc.
  3. Attempt to delete version in Pro - FAIL "Operation not allowed on version with dependent children"
  4. Oh shoot! I forgot to remove offline areas.
  5. Remove offline area 
  6. Delete Version - FAIL
  7. Close app, sign out/sign into Field Maps new offline area, remove offline area.
  8. Delete Version - FAIL

It seems that the issue comes up if I try to delete the version and there is still an offline area. This throws the error as noted, but can no longer be fixed in ArcGIS Pro regardless of what is done in Field Maps (e.g., removing the offline area, adding a new one, removing, etc.,). Trying to delete the version when there is still an offline area out there (for example, forgetting about that offline area, forgetting about a device) seems to orphan a replica that can no longer be removed unless I go into the SDE_Version table in the DB backend and remove the versions. 

Still feels like I am missing something. 

0 Kudos
JonathanDandois
Occasional Contributor

Posting a final follow-up.  I submitted a support ticket with Esri and went all the way through a number of very helpful support departments from Field Maps to Enterprise, finally landing on the SDE / DB team. This is a synopsis of how far we got.

It seems like my process is generally correct, but somewhere along the way when I remove an Offline Area from Field Maps the action to remove the child SYNC versions of the offline editing version is not making it to the back-end and so those child versions are not being deleted.

ArcGIS Pro only displays the main offline edit version, a child of DEFAULT, but does not display the other children of that version. Trying to delete the main offline edit version results in the `160361: Operation not allowed on a version with dependent children.` error, which is recognized but has no solutions, here.

WARNING: READ BELOW AT YOUR OWN RISK.

So the only solution we could identify was to access the SDE_VERSIONS table in the back-end DB and manually delete the dependent children of the main offline edit version. So in the screens below version_id = 173 is the main offline edit version that is visible in ArcGIS Pro and which cannot be deleted in Pro. The additional SYNC versions below that are all children of that version and these are not visible in ArcGIS Pro.  These versions should be deleted when the Offline Area is removed, but for some reason in my workflow that is not always happening.

So. I manually, and carefully, write out the DELETE statement for each of the child versions, double checking that it is part of the version tree of version_id = 173. Extreme caution here since this example on our dev environment is relatively easy and there are no other versions happening at the same time. In production, it is more likely that there are other versions mixed in among these, so it is an arduous task. Obviously be careful here because DEFAULT is right there! 😬 So we felt there was no "smart" SQL statement way to perform this, no range or JOIN, and that each WHERE should be typed out manually and deliberately. 

SDE_DELETE.PNG

 

 

 

 

 

 

With the versions deleted the, there are no more dependent children of the main offline edit version and that version can and should be removed in ArcGIS Pro only, don't delete it from the DB back-end!

SD_Clean.PNG

 

 

I'd say this situation comes up for me about 80% of the time.  So I will continue to test this out.   20% of the time when I remove an Offline Area after offline work is complete and the rec/post have been performed, I am able to delete the main offline edit version in ArcGIS Pro as expected without this back-end work.

At this point I am wondering if there is an issue where Field Maps isn't connected to our Enterprise Portal prior to removing the offline areas. If the credentials are somehow "stale" or if the iPad isn't fully connected to the network and signed in to Portal.

For now I think this is closed. But I will update if any new information comes up! Thanks to the Esri Support team for all their help with this!

 

DougBrowning
MVP Esteemed Contributor

I am seeing this in AGOL also.  It seems to be if the user removes the offline area while they are not connected it gets lost.  

See my post here @JonathanDandois .  I reported it about a year ago.  https://community.esri.com/t5/arcgis-field-maps-questions/replica-not-removed-if-offline-area-remove... 

Hope that helps

JonathanDandois
Occasional Contributor

Thanks @DougBrowning . this is my suspicion as well. Even though I am pretty sure our users are on wifi on the iPad device when they remove offline areas, I wonder if the Field Maps connection to our enterprise Portal is stale, even though it technically thinks it still logged in, or something buggy there. 

I am going to test by having the users log out and log back in to the Enterprise Portal in Field Maps prior to removing offline areas to see if that avoids the issue. Unfortunately though, once it happens one time, the orphans are stuck in the SDE versions table and need to be removed manually. 

DougBrowning
MVP Esteemed Contributor

I wonder if you use my script and get a list of replicas via REST you could see them?  May want to give it a shot.

JonathanDandois
Occasional Contributor

will take a look...

0 Kudos