I am still having trouble with this. I am using:
ArcGIS 10.2.2 with Python 2.7 (installed through ArcGIS)
Windows 7 64-bit machine
SQL Server Express 2012 (Workgroup SDE, NOT Enterprise)
Pythonwin site-package for Python 2.7
I am using the 32-bit Python interpreter:
PythonWin 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32.
Below is the Traceback from the arcpy.CreateReplica_management line in my script:
Traceback (most recent call last):
File "C:\WorkSpace\tools\scripts\CreateTNF1WayReplica\R10Create1wayReplica2fGDBNAS_10_2.py", line 157, in makeReplica
arcpy.CreateReplica_management(featureList, "ONE_WAY_REPLICA", outGDB, replicaName, "FULL", "PARENT_DATA_SENDER", "ALL_ROWS", "", "", "", "DO_NOT_USE_ARCHIVING")
File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\management.py", line 803, in CreateReplica
raise e
ExecuteError: ERROR 000582: Error occurred during execution.
So I stepped through in the debugger and stepped into the management.py script and also into the _base.py from there. Here is the point that the error occurs:
Traceback (most recent call last):
File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\management.py", line 800, in CreateReplica
retval = convertArcObjectToPythonObject(gp.CreateReplica_management(*gp_fixargs((in_data, in_type, out_geodatabase, out_name, access_type, initial_data_sender, expand_feature_classes_and_tables, reuse_schema, get_related_data, geometry_features, archiving), True)))
File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\geoprocessing\_base.py", line 498, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
ExecuteError: ERROR 000582: Error occurred during execution.
I stepped through the gp_fixargs and at line 40 of _base.py, my args turned into new_args as follows:
['"C:\\WorkSpace\\temp\\CreateReplicas\\inputs\\Activities.sde\\Activities.DBO.Activities\\Activities.DBO.ProjectArea;C:\\WorkSpace\\temp\\CreateReplicas\\inputs\\Activities.sde\\Activities.DBO.Activities\\Activities.DBO.TMCompartment;C:\\WorkSpace\\temp\\CreateReplicas\\inputs\\Activities.sde\\Activities.DBO.Activities\\Activities.DBO.ActivityPoint;C:\\WorkSpace\\temp\\CreateReplicas\\inputs\\Activities.sde\\Activities.DBO.Activities\\Activities.DBO.CoverType;C:\\WorkSpace\\temp\\CreateReplicas\\inputs\\Activities.sde\\Activities.DBO.Activities\\Activities.DBO.ValueComparisonUnit;C:\\WorkSpace\\temp\\CreateReplicas\\inputs\\Activities.sde\\Activities.DBO.Activities\\Activities.DBO.ActivityPolygon;C:\\WorkSpace\\temp\\CreateReplicas\\inputs\\Activities.sde\\Activities.DBO.Activities\\Activities.DBO.ActivityLine;C:\\WorkSpace\\temp\\CreateReplicas\\inputs\\Activities.sde\\Activities.DBO.Activities\\Activities.DBO.CoverType_Topology;C:\\WorkSpace\\temp\\CreateReplicas\\inputs\\Activities.sde\\Activities.DBO.Activities\\Activities.DBO.VCU_TMComp_Topology"', 'ONE_WAY_REPLICA', '\\\\199.131.000.000\\TNFRef\\GISData\\Activities.gdb', 'Activities_1WayRO2NAS', 'FULL', 'PARENT_DATA_SENDER', 'ALL_ROWS', '', '', '', 'DO_NOT_USE_ARCHIVING']
Every once in a while I can get this to work but can't find rhyme or reason as to why it works every once in a while. I have tried the output file geodatabase location on my C: drive ('C:\\WorkSpace\\temp\\CreateReplicas\\outputs\\gdbs\\Activities.gdb'), on the external share mapped as UNC path (as above: '\\\\199.131.000.000\\TNFRef\\GISData\\Activities.gdb'), and mapped as a drive letter ('Y:\\GISData\\Activities.gdb'), all with the same results (Error 00582).
[The IP address has been changed to 0s on purpose for posting here, it is the real IP address in the script.]
Attached is the code block from my script, with inputs being:
parentGDS = Database connection .sde file on C: drive that points to our Workgroup SDE instance for the database in the list of databases (in this case, "Activities")
GDBPath = the output location for the file GDB to be stored. I have tried local C: drive and our NAS drive as UNC and mapped as a drive letter
gdbName = the name of the database in the list. In this case "Activities"
If the output geodatabase (in this case Activities.gdb) does not exist, it is created before getting to the create replica part, using:
if not arcpy.Exists(outGDBPath + os.sep + gdbName):
createTargetGDB(outGDBPath,gdbName)
I tried running it in ArcMap, using the Create Replica tool in Toolbox and got the following:
Executing: CreateReplica Activities.DBO.CoverType_Topology;Activities.DBO.VCU_TMComp_Topology;ActivityPoint;ActivityLine;ProjectArea;Activities.DBO.TMCompartment;CoverType;Activities.DBO.ValueComparisonUnit;ActivityPolygon ONE_WAY_REPLICA C:\WorkSpace\temp\CreateReplicas\outputs\gdbs\Activities.gdb ArcMapToolboxTest FULL PARENT_DATA_SENDER ALL_ROWS DO_NOT_REUSE GET_RELATED # DO_NOT_USE_ARCHIVING
Start Time: Wed Oct 28 15:12:27 2015
Executing CreateReplica...
ERROR 000582: Error occurred during execution.
Failed to execute (CreateReplica).
Is there any way to tell which input parameter is causing the error? Could this still be a bug in the GP tool? I'm about to go to ArcObjects and write a C#.NET executable to do the replica creation like I used to before I thought Bug NIM-073906 was fixed (http://support.esri.com/en/bugs/nimbus/TklNMDczOTA2).