<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error 3 Datasource inaccessible .....but is it?? in ArcMap Questions</title>
    <link>https://community.esri.com/t5/arcmap-questions/error-3-datasource-inaccessible-but-is-it/m-p/1294147#M4441</link>
    <description>&lt;P&gt;"&lt;SPAN&gt;Also: The same Script I've written works outside of ArcMap, on a different System with the same setup... "&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This would make me look at the two local paths you have in the script.&amp;nbsp; Does the user running the script have identical profiles on both machines?&amp;nbsp; Is the D:/Foldername the same on both machines?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Both of these settings are user specific, and could be why it works as expected on one machine, but not the other.&amp;nbsp; Also, different user woulnd't have access to the ags file in someone elses profile.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 30 May 2023 17:11:55 GMT</pubDate>
    <dc:creator>RhettZufelt</dc:creator>
    <dc:date>2023-05-30T17:11:55Z</dc:date>
    <item>
      <title>Error 3 Datasource inaccessible .....but is it??</title>
      <link>https://community.esri.com/t5/arcmap-questions/error-3-datasource-inaccessible-but-is-it/m-p/1293371#M4437</link>
      <description>&lt;P&gt;Heyho Hello,&lt;/P&gt;&lt;P&gt;relatively new to arcpy...arcmap...&lt;/P&gt;&lt;P&gt;Using ArcMap 10.7 on Win10&lt;/P&gt;&lt;P&gt;Trying to: Publish a service on an arcgis Server using a "standalone" Python Script, with the ArcMap's Python.exe set as interpreter. The layers use an oracle db. I will post some code below.&lt;/P&gt;&lt;P&gt;What works: Publishing through the ArcMap Interface, or through the Python window inside ArcMap. Creating an .sddraft externally using my script and publishing through the Arc Map python window. All layers are displayed correctly inside ArcMap and so are their datasources. Also: The same Script I've written works outside of ArcMap, on a different System with the same setup...&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically it's standard create .sddraft from .mxd, analyze it and publish code.... tried running as admin, setting arcpy.env.workspace to everything... including .sde file,&amp;nbsp; usually I set it to the folder including the .mxd .... this works on my other system... Checking Layers and Datasources, which Arcpy I'm using...hitting my head against the wall... repeatedly....&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;arcpy.mapping.ListBrokenDataSources(mxd) #returns all layer Datasources as broken so I tried the Method below&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;for&lt;/SPAN&gt; &lt;SPAN class=""&gt;brknItem&lt;/SPAN&gt; &lt;SPAN class=""&gt;in&lt;/SPAN&gt; &lt;SPAN class=""&gt;brknList&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;BR /&gt;&lt;SPAN class=""&gt;   print&lt;/SPAN&gt; &lt;SPAN class=""&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;\t&lt;/SPAN&gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt; &lt;SPAN class=""&gt;+&lt;/SPAN&gt; &lt;SPAN class=""&gt;brknItem&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;SPAN&gt;dataSource # returns path to the .sde&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;mapDoc.findAndReplaceWorkspacePaths(r"", r"&lt;SPAN&gt;C:\Users\&amp;lt;Name&amp;gt;\AppData\Roaming\Esri\&amp;lt;sdeName&amp;gt;.sde", {BOOLEAN}&lt;/SPAN&gt;)&lt;BR /&gt;# Only works with FALSE set... so it doesn't recognize the .sde as valid datasource? But its the same as in arcMap&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;arcpy&lt;BR /&gt;import os&lt;BR /&gt;import sys&lt;BR /&gt;&lt;BR /&gt;folder = &lt;SPAN&gt;raw_input&lt;/SPAN&gt;(&lt;SPAN&gt;"Enter a folder!"&lt;/SPAN&gt;)&lt;BR /&gt;wrkspc = &lt;SPAN&gt;r'D:/&amp;lt;folderName&amp;gt;/'&lt;/SPAN&gt;+folder + &lt;SPAN&gt;"/"&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;if not &lt;/SPAN&gt;os.path.isdir(wrkspc):&lt;BR /&gt;    &lt;SPAN&gt;print &lt;/SPAN&gt;&lt;SPAN&gt;"Error no such directory! " &lt;/SPAN&gt;+ wrkspc&lt;BR /&gt;    sys.exit()&lt;BR /&gt;&lt;BR /&gt;inp = &lt;SPAN&gt;raw_input&lt;/SPAN&gt;(&lt;SPAN&gt;"Enter a .mxd file or type &amp;lt;all&amp;gt; in order to select all inside "&lt;/SPAN&gt;+wrkspc+&lt;SPAN&gt;" ....:"&lt;/SPAN&gt;)&lt;BR /&gt;arcpy.env.workspace = wrkspc # tried setting to .sde and all sorts&lt;BR /&gt;arcpy.env.overwriteOutput = &lt;SPAN&gt;True&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;# mxd valid?&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;try&lt;/SPAN&gt;:&lt;BR /&gt;  mapDoc = arcpy.mapping.MapDocument(wrkspc + inp +&lt;SPAN&gt;'.mxd'&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;  print&lt;/SPAN&gt;(&lt;SPAN&gt;"Running ...."&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;except &lt;/SPAN&gt;&lt;SPAN&gt;AssertionError&lt;/SPAN&gt;:&lt;BR /&gt;&lt;SPAN&gt;  print &lt;/SPAN&gt;&lt;SPAN&gt;"Invalid file name! Hints: Do not include the .mxd ending, make sure the file is inside the "&lt;/SPAN&gt;+wrkspc+&lt;SPAN&gt;" directory!"&lt;BR /&gt;&lt;/SPAN&gt;  sys.exit()&lt;BR /&gt;&lt;BR /&gt;con = &lt;SPAN&gt;r"C:\Users\&amp;lt;user&amp;gt;\AppData\Roaming\Esri\Desktop10.7\ArcCatalog\&amp;lt;FileName&amp;gt;.ags"&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# Service Details&lt;BR /&gt;&lt;/SPAN&gt;service = inp&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# sddraft&lt;BR /&gt;&lt;/SPAN&gt;sddraft = wrkspc + service + &lt;SPAN&gt;'.sddraft'&lt;BR /&gt;&lt;/SPAN&gt;sd = wrkspc + service + &lt;SPAN&gt;'.sd'&lt;BR /&gt;&lt;/SPAN&gt;summary = &lt;SPAN&gt;'Test'&lt;BR /&gt;&lt;/SPAN&gt;tags = &lt;SPAN&gt;'MXD Upload Test'&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;# Definitiondraft&lt;BR /&gt;&lt;/SPAN&gt;arcpy.mapping.CreateMapSDDraft(mapDoc&lt;SPAN&gt;, &lt;/SPAN&gt;sddraft&lt;SPAN&gt;, &lt;/SPAN&gt;service&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'FROM_CONNECTION_FILE'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;con&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;False&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;folder&lt;SPAN&gt;, &lt;/SPAN&gt;summary&lt;SPAN&gt;, &lt;/SPAN&gt;tags)&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Analysis&lt;BR /&gt;&lt;/SPAN&gt;analysis = arcpy.mapping.AnalyzeForSD(sddraft)&lt;BR /&gt;&lt;BR /&gt;# Error is thrown in analysis.... tried skipping it.... error thrown during publish!&lt;/PRE&gt;&lt;P&gt;I feel like it's something obvious like a file path, an .env or something.... I just can't seem to find it...&lt;/P&gt;&lt;P&gt;Maybe someone has an idea! Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2023 07:19:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/error-3-datasource-inaccessible-but-is-it/m-p/1293371#M4437</guid>
      <dc:creator>DonJon</dc:creator>
      <dc:date>2023-05-26T07:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: Error 3 Datasource inaccessible .....but is it??</title>
      <link>https://community.esri.com/t5/arcmap-questions/error-3-datasource-inaccessible-but-is-it/m-p/1293620#M4438</link>
      <description>&lt;P&gt;I'd guess it's permissions on the AppData folder.&amp;nbsp; Running it in ArcMap GUI is might be a different user than standalone Python.exe.&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2023 19:06:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/error-3-datasource-inaccessible-but-is-it/m-p/1293620#M4438</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2023-05-26T19:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Error 3 Datasource inaccessible .....but is it??</title>
      <link>https://community.esri.com/t5/arcmap-questions/error-3-datasource-inaccessible-but-is-it/m-p/1294147#M4441</link>
      <description>&lt;P&gt;"&lt;SPAN&gt;Also: The same Script I've written works outside of ArcMap, on a different System with the same setup... "&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This would make me look at the two local paths you have in the script.&amp;nbsp; Does the user running the script have identical profiles on both machines?&amp;nbsp; Is the D:/Foldername the same on both machines?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Both of these settings are user specific, and could be why it works as expected on one machine, but not the other.&amp;nbsp; Also, different user woulnd't have access to the ags file in someone elses profile.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 17:11:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/error-3-datasource-inaccessible-but-is-it/m-p/1294147#M4441</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2023-05-30T17:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: Error 3 Datasource inaccessible .....but is it??</title>
      <link>https://community.esri.com/t5/arcmap-questions/error-3-datasource-inaccessible-but-is-it/m-p/1294414#M4446</link>
      <description>&lt;P&gt;Might be some permission Issue, but running it as admin does not change anything f.ex.?&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 10:05:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/error-3-datasource-inaccessible-but-is-it/m-p/1294414#M4446</guid>
      <dc:creator>DonJon</dc:creator>
      <dc:date>2023-05-31T10:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Error 3 Datasource inaccessible .....but is it??</title>
      <link>https://community.esri.com/t5/arcmap-questions/error-3-datasource-inaccessible-but-is-it/m-p/1294415#M4447</link>
      <description>&lt;P&gt;I did change the .ags file and the paths on the system accordingly, what I meant is the way I hardcoded the file paths etc. works fine on the other machine.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 10:08:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/error-3-datasource-inaccessible-but-is-it/m-p/1294415#M4447</guid>
      <dc:creator>DonJon</dc:creator>
      <dc:date>2023-05-31T10:08:02Z</dc:date>
    </item>
  </channel>
</rss>

