I cannot seem to overwrite a feature layer by uploading a file geodatabase via the Python API. I have triple checked and re-tried from start to finish uploading a .zipped file GDB, publishing a hosted feature service and attempt to update the file GDB with the EXACT SAME name as when I started. I throws the 'Cannot find related data item used to publish this Feature Layer' error. It works fine however if I use the tools in ArcGIS online, navigate to the same file GDB and overwrite.
gis = GIS(baseurl, username, password, verify_cert=False)
gdbpath = r"c:\temp\gdb.zip'
item = gis.content.get('guid') # feature layer collection
fs = item.layers[0].container
print(fs.manager.overwrite(gdbpath))`
I have to think there's something with how you enter the path to the gdb for it to recongnize it as the same file name. Any ideas? Thanks!