I am confused as to why the arcpy.CreateReplica doesn't work when my script gets a list of versioned layers and puts them into a variable to load into the function verses me hard coding versioned layer fields into the script and it working fine. Any ideas?
<SPAN class="keyword token">import</SPAN> arcpy
<SPAN class="keyword token">import</SPAN> os
<SPAN class="comment token"># Local info</SPAN>
userName <SPAN class="operator token">=</SPAN> os<SPAN class="punctuation token">.</SPAN>environ<SPAN class="punctuation token">.</SPAN>get<SPAN class="punctuation token">(</SPAN> <SPAN class="string token">"USERNAME"</SPAN> <SPAN class="punctuation token">)</SPAN>
pcVersion <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Desktop10.7"</SPAN>
in_data <SPAN class="operator token">=</SPAN> <SPAN class="string token">""</SPAN>
<SPAN class="comment token"># Data connections</SPAN>
ws <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"C:\Users\%s\AppData\Roaming\ESRI\%s\ArcCatalog\server.sde"</SPAN> <SPAN class="operator token">%</SPAN> <SPAN class="punctuation token">(</SPAN>userName<SPAN class="punctuation token">,</SPAN>pcVersion<SPAN class="punctuation token">)</SPAN>
gdb <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"C:\Users\%s\AppData\Roaming\ESRI\%s\ArcCatalog\local.sde"</SPAN> <SPAN class="operator token">%</SPAN> <SPAN class="punctuation token">(</SPAN>userName<SPAN class="punctuation token">,</SPAN>pcVersion<SPAN class="punctuation token">)</SPAN>
rName <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"TEST"</SPAN><SPAN class="comment token"># % (userName)</SPAN>
in_data <SPAN class="operator token">=</SPAN> <SPAN class="string token">""</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>workspace <SPAN class="operator token">=</SPAN> ws
dataList <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>ListDatasets<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">+</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>ListFeatureClasses<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">for</SPAN> dataset <SPAN class="keyword token">in</SPAN> dataList<SPAN class="punctuation token">:</SPAN>
desc <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Describe<SPAN class="punctuation token">(</SPAN>dataset<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">if</SPAN> desc<SPAN class="punctuation token">.</SPAN>isVersioned<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="string token">"__ATTACH"</SPAN> <SPAN class="keyword token">in</SPAN> desc<SPAN class="punctuation token">.</SPAN>name<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Removing __ATTACH"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">elif</SPAN> <SPAN class="string token">"NEO.DBO.cities"</SPAN> <SPAN class="keyword token">in</SPAN> desc<SPAN class="punctuation token">.</SPAN>name<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Removing NEO.DBO.cities"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">elif</SPAN> <SPAN class="string token">"NEO.DBO.P_AlignmentSheet_test"</SPAN> <SPAN class="keyword token">in</SPAN> desc<SPAN class="punctuation token">.</SPAN>name<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Removing NEO.DBO.P_AlignmentSheet_test"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN>
in_data <SPAN class="operator token">=</SPAN> in_data <SPAN class="operator token">+</SPAN> <SPAN class="string token">'"%s",'</SPAN> <SPAN class="operator token">%</SPAN> <SPAN class="punctuation token">(</SPAN>desc<SPAN class="punctuation token">.</SPAN>name<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> desc<SPAN class="punctuation token">.</SPAN>name
in_data <SPAN class="operator token">=</SPAN> in_data<SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">:</SPAN><SPAN class="operator token">-</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="keyword token">print</SPAN> in_data
<SPAN class="keyword token">try</SPAN><SPAN class="punctuation token">:</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>workspace <SPAN class="operator token">=</SPAN> ws
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"BuildReplica..."</SPAN><SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>CreateReplica_management<SPAN class="punctuation token">(</SPAN>in_data<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'TWO_WAY_REPLICA'</SPAN><SPAN class="punctuation token">,</SPAN>gdb<SPAN class="punctuation token">,</SPAN>rName<SPAN class="punctuation token">,</SPAN><SPAN class="string token">'FULL'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'CHILD_DATA_SENDER'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'USE_DEFAULTS'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'DO_NOT_REUSE'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'GET_RELATED'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">''</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'DO_NOT_USE_ARCHIVING'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"BuildReplica done"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">except</SPAN> Exception<SPAN class="punctuation token">:</SPAN>
e <SPAN class="operator token">=</SPAN> sys<SPAN class="punctuation token">.</SPAN>exc_info<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN>e<SPAN class="punctuation token">.</SPAN>args<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>"NEO.SDE.ArchivedProposedMainline","NEO.SDE.Directory_Mwetzel","NEO.SDE.Misc_Companies","NEO.SDE.Misc_NEOFiles","NEO.SDE.Misc_OhioLayers","NEO.SDE.P_Integrity","NEO.SDE.P_PipeSystem","NEO.SDE.Parcels","NEO.SDE.Roads","NEO.SDE.TransmissionPipeline","NEO.SDE.StandaloneVersions","NEO.SDE.StandaloneLayers","NEO.SDE.Inspections","NEO.SDE.ArchivedLayers","NEO.SDE.P_AbandonedDevice","NEO.SDE.P_AbandonedPipe","NEO.SDE.P_AbandonedService","NEO.SDE.P_AlignmentSheet","NEO.SDE.P_CapitalProject","NEO.SDE.P_Coupon","NEO.SDE.P_CPArea","NEO.SDE.P_DrinkingWater","NEO.SDE.P_EcologicalArea","NEO.SDE.P_ExcavationDamage","NEO.SDE.P_ExposedPipeInspect","NEO.SDE.P_GasLeak","NEO.SDE.P_GasLeakInspect","NEO.SDE.P_IdentifiedIssue","NEO.SDE.P_LeakRepairs","NEO.SDE.P_LeakSurvey","NEO.SDE.P_LeakSurveyArea","NEO.SDE.P_NavigableWaterway","NEO.SDE.P_OtherPopulatedArea","NEO.SDE.P_OutsideArea","NEO.SDE.P_PipeCasing","NEO.SDE.P_PipeJobSeparator","NEO.SDE.P_PipelineMarker","NEO.SDE.P_REGULATORINSPECTION","NEO.SDE.P_SqueezeOff","NEO.SDE.P_StationStructure","NEO.SDE.P_StructureFootPrint","NEO.SDE.P_StructurePoint","NEO.SDE.P_Vault","NEO.SDE.P_WorkOrder","NEO.SDE.Atmospheric_Corrosion_Sites",
BuildReplica...
ERROR 000582: Error occurred during execution.
Failed to execute (CreateReplica).<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>