ERROR: Updating CSV generated Feature Service with CSV

626
0
01-29-2021 01:02 PM
John_Spence
Occasional Contributor III

Ran into an interesting issue today....

While working through the mechanics of how to keep our future open data site automatically up to date using CSVs (**sigh**), I ran into an interesting works in AGOL fails in Portal situation.  Below is the very rough draft of a script that WILL update ArcGIS Online no sweat, but WON'T update ArcGIS Portal (10.8.1).

 

Spoiler

from arcgis.gis import GIS
from arcgis.features import FeatureLayerCollection

# ------------------------------------------------------------------------------
# Functions
# ------------------------------------------------------------------------------

def main():
#-------------------------------------------------------------------------------
# Name: Function - main
# Purpose: Starts the whole thing.
#-------------------------------------------------------------------------------

connectedP = connect()
overwrite(connectedP)

return

def connect ():

connectedP = GIS(url='https://www.arcgis.com', username='', password='')

return (connectedP)

def overwrite (connectedP):

# Find Item
search_result= connectedP.content.search('the item id here', 'Feature Layer')
FS_item = search_result[0]

taretedOverwrite = FeatureLayerCollection.fromitem(FS_item)

try:
taretedOverwrite.manager.overwrite(r'\\TheFileShare\Datasets\ThePayLoad.csv')
except Exception as overWrite_Failure:
print (overWrite_Failure)

return


main()

 

The errors I am seeing on the Portal side remind me of the Excel compatibility patch needed in 10.7.1.

Spoiler
Failed to publish item 'https://web.site.com/gis/rest/services/Hosted/Johns_Failure_Test/FeatureServer' (id:c9fcbc39e97c466095161b8315fc3ade). ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds. Missing publish parameter: longitudeFieldName. Failed to execute (Publish Portal Service). Failed. Failed to execute (Publish Portal Service). Failed.. Job ID: 'jdb7783e3fc054677830ca868cd154fae'

When I dig deeper into the Hosting server, I see this too:

Spoiler
SEVEREJan 29, 2021, 12:38:28 PMError executing tool. Publish Portal Service Job ID: jdb7783e3fc054677830ca868cd154fae : ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds. Missing publish parameter: longitudeFieldName. Failed to execute (Publish Portal Service). Failed. Failed to execute (Publish Portal Service).System/PublishingTools.GPServer
SEVEREJan 29, 2021, 12:38:28 PMDelegate job failed.System/PublishingTools.GPServer
SEVEREJan 29, 2021, 12:38:26 PMError executing tool. PublishPortalService Job ID: jeb5288aafb9f4a5bad3c2a3ea7aa5bd2 : ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds. Missing publish parameter: longitudeFieldName. Failed to execute (Publish Portal Service).System/PublishingToolsEx.GPServer
SEVEREJan 29, 2021, 12:38:26 PMMissing publish parameter: longitudeFieldName.System/PublishingToolsEx.GPServer

Anyone have any thoughts?

0 Replies