AGOL unable to enable editor tracking

4691
12
Jump to solution
02-26-2017 11:13 PM
Trippetoe
Occasional Contributor III

I have created an AGOL hosted feature service.  When I try to enable editor tracking by selecting the 'Keep track of who created and last updated features' checkbox, I get the following error message when clicking the Save button:  "Unable to update feature service definition". And that is all......

The AGOL hosted feature service contains a single feature class and three related tables. The service was published from an 'SDE' instance. That source database had editor tracking enabled on the feature class and tables. I disabled editor tracking in the SDE instance just prior to publishing to AGOL to preserve the created/edited data as the hosted feature service was being created.

In addition to trying to enable editor tracking on the AGOL feature service by clicking on the check-box, I have also tried using the REST admin endpoints on the feature service and the feature class layer.  I have tried to 'Update Layer Definition' and 'Update Service Definition' by setting the edit fields info with the following JSON element:

"editFieldsInfo" : {
  "creationDateField" : "CreationDate",
  "creatorField" : "Creator",
  "editDateField" : "EditDate",
  "editorField" : "Editor"
  }

The REST response indicates 'success' but the update is not persisted.  I have also tried the 'Add to Definition' REST endpoint. The response from there also seems to indicate success, i.e. no error error messages are displayed. But again the additional element is not preserved in the service definition.

I am the owner of the feature service.

Any thoughts on how to enable editor tracking on my AGOL hosted feature service?

0 Kudos
1 Solution

Accepted Solutions
Trippetoe
Occasional Contributor III

Hey Kelly.

I got what i was after by going the python route that you suggested in this forum posting: Publishing to AGOL overwrites editor tracking data 

I shared my SDE data as a service definition file, uploaded that sd document to AGOL, and then used the python script below to publish the data. All the editor tracking data was preserved.  Many thanks to you and Leon Scott

import arcgis
from arcgis.gis import GIS
gis = GIS("http://drcmetro.maps.arcgis.com", "user.name", "password")
sd_items = gis.content.search("owner: user.name AND title: service.title", item_type="Service Definition")
pub_params = {"editorTrackingInfo" : {"enableEditorTracking":'true', "preserveEditUsersAndTimestamps":'true'}}
sd_item = sd_items[0]
sd_item.publish(publish_parameters=pub_params, overwrite="true")

View solution in original post

0 Kudos
12 Replies
Trippetoe
Occasional Contributor III

I found this bug report from June 2014: NIM102295: If the editor tracking fields (Creation Date, Creato.. 

Surely they would have fixed that bug over the intervening 2.5 years?

0 Kudos
KellyGerrow
Esri Frequent Contributor

Hey Tom,

Try contacting technical support, they can look into the status of the bug and investigate any workarounds for the time being.

-Kelly

Trippetoe
Occasional Contributor III

Thanks for the reply Kelly.  I'll give tech support a call.  

Any ideas about a solution, or alternatives i can try, off the top of your head?

0 Kudos
KellyGerrow
Esri Frequent Contributor


Try using a web debugging program like fiddler or developer tools in chrome. You should see an update definition call, and there may be a more specific error message in the response of the update definition call. Post the error message if you get something a little more specific.

0 Kudos
Trippetoe
Occasional Contributor III

Great idea.... here is the full response when trying to Save after ticking the 'enable editor tracking' check box on the 'settings' of the feature service:

{"error":{"code":400,"message":"Unable to update feature service definition.","details":["Exception has been thrown by the target of an invocation.","Invalid edit fields definition"]}}

thank you.

0 Kudos
KellyGerrow
Esri Frequent Contributor

Hey Tom,

I have no guesses based on that error message. I think your best bet will be to work with support to see if there is anything with your specific data that is causing this.

-Kelly 

0 Kudos
Trippetoe
Occasional Contributor III

Hi Kelly,

First, thank you so much for your replies - and not just to this question. Your presence on the forums has solved many problems for me.

Back to the issue at hand.... Esri tech support did confirm that the bug still exists.  The suggested workaround is the good ol' "create new columns, calc data, publish data to agol, calc data back" process.  Not particularly satisfying, but there you go.

0 Kudos
KellyGerrow
Esri Frequent Contributor

Hey Tom,

Are you able to enable editor tracking before you publish your data using ArcMap? 

0 Kudos
Trippetoe
Occasional Contributor III

I can enable editor tracking before publishing to AGOL. However, as part of the publishing process all my existing editor tracking info gets overwritten. I need to preserve the existing, i.e. pre-publishing to AGOL, editor tracking info as part of the publishing process.

0 Kudos