I'm trying to add a feature layer to portal and I get the error, even though I include overwrite=True:
Exception: {'message': "Service name 'myService' already exists for '123abc'"}
Arguments: (Exception('Unable to Add messages Job Event\nUnable to Add messages Job Event\n(Error Code: 500)'),)I am including overwrite in the properties and in the function itself, just in case at least one might work, yet it does nothing. It's specified here .
The content.add problem can be overcome by either deleting the item from portal, or adding a script to do it, but the .publish one is fatal. I DO NOT have any item with that name and this error is still occurring. How do I make the overwrite param work?
item_properties = {
'title': itemTitle,
'type': 'File Geodatabase',
'description': item.description,
'accessInformation': item.accessInformation,
'licenseInfo': item.licenseInfo,
'overwrite': True
}
fgd = trg.content.add(item_properties=item_properties, owner=username,
data=download_result, overwrite=True)
targetService = fgd.publish(overwrite=True)
I am not looking for a better way to do this overall, but to solve this issue.