Create replica problem-produces exception

4136
13
06-05-2012 09:45 AM
SteveLong
New Contributor III
Hello, I don't seem to be getting the CreateReplica_management call to work. It produces an error:
arcgisscripting.ExecuteError: ERROR 000582: Error occurred during execution.
Failed to execute (CreateReplica)

The code being used is below. Any help here would be much appreciate by this newbie python person...

import arcpy
from arcpy import env
import arcgisscripting

env.workspace = "C:\Documents and Settings\longs\Application Data\ESRI\Desktop10.0\ArcCatalog\SpatialVegMgmt_NT38.sde.DEFAULT"

tableset = "Actions, BioAgents, Density, Directions, Inspectors, MethodContacted, ROW, Units, weedFollowups, Weeds, WeedTypeRelate, WeedTypes, VegetationMgmt.GIS_SDE.weedIncidents"
replica_type = "CHECK_OUT"
output_workspace = "c:\usr_proj\ArcGIS\FileGeodatabases\Weed\Mark\WeedIncidents_FileGDB.gdb"
replica_name = "MarkReplica"
access_type = "FULL"
initial_sender = "PARENT_DATA_SENDER"
expand = "USE_DEFAULTS"
reuse_schema = "DO_NOT_REUSE"
get_related = "GET_RELATED"

arcpy.MakeTableView_management("Database Connections\SpatialVegMgmt_NT38.sde\VegetationMgmt.owner.Actions", "Actions", "AID > 0")
arcpy.MakeTableView_management("Database Connections\SpatialVegMgmt_NT38.sde\VegetationMgmt.owner.WEEDFOLLOWUPS", "WEEDFOLLOWUPS", "ObjectID > 0")
arcpy.MakeTableView_management("Database Connections\SpatialVegMgmt_NT38.sde\VegetationMgmt.owner.Density", "Density", "DID > 0")
arcpy.MakeTableView_management("Database Connections\SpatialVegMgmt_NT38.sde\VegetationMgmt.owner.Directions", "Directions", "GDID > 0")
arcpy.MakeTableView_management("Database Connections\SpatialVegMgmt_NT38.sde\VegetationMgmt.owner.Inspectors", "Inspectors", "IID > 0")
arcpy.MakeTableView_management("Database Connections\SpatialVegMgmt_NT38.sde\VegetationMgmt.owner.MethodContacted", "MethodContacted", "MCID > 0")
arcpy.MakeTableView_management("Database Connections\SpatialVegMgmt_NT38.sde\VegetationMgmt.owner.ROW", "ROW", "ROWID > 0")
arcpy.MakeTableView_management("Database Connections\SpatialVegMgmt_NT38.sde\VegetationMgmt.owner.Units", "Units", "UID > 0")
arcpy.MakeTableView_management("Database Connections\SpatialVegMgmt_NT38.sde\VegetationMgmt.owner.Weeds", "Weeds", "WID > 0")
arcpy.MakeTableView_management("Database Connections\SpatialVegMgmt_NT38.sde\VegetationMgmt.owner.WeedTypeRelate", "WeedTypeRelate", "ObjectID > 0")
arcpy.MakeTableView_management("Database Connections\SpatialVegMgmt_NT38.sde\VegetationMgmt.owner.WeedTypes", "WeedTypes", "WTID > 0")
arcpy.MakeTableView_management("Database Connections\SpatialVegMgmt_NT38.sde\VegetationMgmt.owner.BioAgents", "BioAgents", "BAID > 0")

# Execute CreateReplica
arcpy.CreateReplica_management(tableset, replica_type, output_workspace, replica_name, access_type, initial_sender, expand, reuse_schema, get_related)


Steve
Tags (2)
0 Kudos
13 Replies
ChristalHigdon
New Contributor III

Thanks for your reply and ideas. Unfortunately, the results are the same. I wish it were that easy! I have tried that before and included the archiving because I was going to experiment with using archiving and comparing to not using it.

I had a theory that in trying to reuse the same replica name (after unregistering from both parent and child and deleting the child gdb), that possibly something behind-the-scenes was not getting deleted or cleared properly when the Unregister happened.

So I tried it with a brand new, never before used replica name and the above suggestion of taking off the last four parameters, to no avail. I agree that the documentation is far from complete and I wasn't sure if the archiving flag was optional or not. The default is not to use it anyway, so I just left it off.

I have tried everything I could think of. Curious that it did work going from our Workgroup SDE server to file geodatabases on my C: Drive using a new replica name, but if I unregister and delete the output/child gdbs and try again, it will fail with ERROR 000582. Also, I just tried with a new and unique replica name from our Workgroup SDE to the external NAS drive (connected as UNC path with admin credentials) and got the same ERROR 000582. It seems like I have tried every possible thing that could be the issue and am no closer to figuring out what is causing the problem.

Does anyone know of a way to tell why it's failing at this point?:

  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.

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

Often times, the error messages from doing the replication in ArcMap using the normal GUI tools provide better, or at least different, information.  If you try to replicate (no pun intended) your example workflow through the GUI, does it succeed or fail?  If it fails, what error messages does it give?

0 Kudos
ChristalHigdon
New Contributor III

It fails. The message is Cannot acquire a lock [GDB_Items] and fails. (screen shot attached)

I went back to my script and tested for locks... none of the input datasets or feature classes had locks on them, but the newly created output file geodatabase did, even though when I went into the folder, there were no '.lock' files in there. I have tried creating it through ArcCatalog ahead of time, and then closing Catalog, as well as creating the output gdb in the 'browse to' dialog in the wizard.

I have tried through the Distributed Geodatabase toolbar in ArcMap and gotten the attached error.

I have tried running the CreateReplica tool through ArcToolbox, and gotten error 000582.

I have tried running CreateReplica through the Python window within ArcMap, failed with error 000582.

I have tried running my Python Script through PythonWin (like usual), failed with error 000582.

I have tried running my Python script through the python interpreter via command line, failed with error 000582.

I have tried creating the output geodatabase on our shared NAS drive (ultimately the goal), failed with error 000582.

I have tried creating the output geodatabase on my C: drive, and sometimes get error 000582 and sometimes (when I make a new replica name that has never before been used) it occasionally works.

I was just wondering if anyone else had the same problems going from Workgroup SDE (SQL Server Express 2012) one way to file geodatabase and could possibly offer a solution. I'm about out of ideas to try.

0 Kudos
SteveLong
New Contributor III
I could not reproduce this at 10.2.2.  I successfully created a one-way replica from a SQL Server enterprise geodatabase to a File Geodatabase using a script.


It's not the file Geodatabase that's the problem. It's the personal geodatabase. After 10.0, personal geodatabases are not supported in ArcGIS server 64 bit. They continue to be supported in Desktop however. To create personal geodatabases on 64 bit server, Install Desktop also and use the method I quoted above. It will work.

Additionally, we have not been able to get replication working properly using the file geodatabase. It does, however, continue to work using personal geodatabases, for whatever reason.

Steve
0 Kudos