Hello there
Normally, it should be possible to create a geoprocessing-service which creates a text file with the script below:
<SPAN class="keyword token">import</SPAN> os
<SPAN class="comment token"># input variable of type String</SPAN>
input_from_client <SPAN class="operator token">=</SPAN> str<SPAN class="punctuation token">(</SPAN>arcpy<SPAN class="punctuation token">.</SPAN>GetParameterAsText<SPAN class="punctuation token">(</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
file_path <SPAN class="operator token">=</SPAN> os<SPAN class="punctuation token">.</SPAN>path<SPAN class="punctuation token">.</SPAN>join<SPAN class="punctuation token">(</SPAN>arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>packageWorkspace<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"test.txt"</SPAN><SPAN class="punctuation token">)</SPAN>
text_file <SPAN class="operator token">=</SPAN> open<SPAN class="punctuation token">(</SPAN>file_path<SPAN class="punctuation token">,</SPAN><SPAN class="string token">"w"</SPAN><SPAN class="punctuation token">)</SPAN>
text_file<SPAN class="punctuation token">.</SPAN>write<SPAN class="punctuation token">(</SPAN>input_from_client<SPAN class="punctuation token">)</SPAN>
text_file<SPAN class="punctuation token">.</SPAN>close<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Output variable of type file</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>SetParameter<SPAN class="punctuation token">(</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> text_file<SPAN class="punctuation token">.</SPAN>name<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>
A service created with the above code can be published without problems to ArcGIS Server 10.6.1 But when I try to publish the same service on a Machine with ArcGIS Server 10.7.1, I get the following error(s):
WARNING 15 Oct 2020 14:51:50 Thumbnail is not avaliable on this layer Conservation_forest_province Rest
SEVERE 15 Oct 2020 14:51:43 Error executing tool. PublishServiceDefinition Job ID: j323c6e9585524bc7973f7b1cd3f948f8 : ERROR 001369: Failed to create the service. Failed to execute (Publish Service Definition). Failed. Failed to execute (Publish Service Definition). System/PublishingTools.GPServer
SEVERE 15 Oct 2020 14:51:43 Delegate job failed. System/PublishingTools.GPServer
SEVERE 15 Oct 2020 14:51:41 Error executing tool. PublishServiceDefinition Job ID: j267b052ffdcd47e5bcda9064e9e151df : ERROR 001369: Failed to create the service. Failed to execute (Publish Service Definition). System/PublishingToolsEx.GPServer
SEVERE 15 Oct 2020 14:51:41 Failed to create the service. System/PublishingToolsEx.GPServer
SEVERE 15 Oct 2020 14:51:41 Failed generating the service definition name mapping. System/PublishingToolsEx.GPServer
SEVERE 15 Oct 2020 14:51:41 Failed to add the dbMapping object. System/PublishingToolsEx.GPServer
SEVERE 15 Oct 2020 14:51:41 Failed to add the dsMapping object. System/PublishingToolsEx.GPServer
SEVERE 15 Oct 2020 14:51:41 Invalid manifest. Unable to find dataset in extracted geodatabase. System/PublishingToolsEx.GPServer
WARNING 15 Oct 2020 14:51:29 Metadata is not avaliable on this layer Conservation_forest_province Rest<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>
Any idea what I can try to make it work on the 10.7.1 Server as well? Is it possible that I have to define the file path differently?
I would be very thankful for help or advise.