I've had a problem with my geoprocessing service finding the data it needs for execution. I found out what's causing this is ArcGIS's assignment of a new variable "g_ESRI_variable_1" in the new copy of the code that lives on the server. However when I try to edit the code back to its original state it says "Permission Denied".
Here is the top few lines of my original script:
import os, regUtil, regQueries, urllib, sys
from arcpy import GetParameterAsText
outpath = GetParameterAsText(1)
root_path = r'\\NewCaspian\BanksNew\Data\tiger\TigerData'
And here are the top few lines of the copy in the arcgisserver folder made upon creation of the geoprocessing package:
import os, arcpy
g_ESRI_variable_1 = os.path.join(arcpy.env.packageWorkspace,u'tigerdata')
# Esri end of added variables
# Esri start of added imports
import sys, os, arcpy
# Esri end of added imports
import os, regUtil, regQueries, urllib, sys
from arcpy import GetParameterAsText
outpath = GetParameterAsText(1)
root_path = g_ESRI_variable_1
It seems very weird that ArcGIS would actually go in and change a variable automatically. Why does this happen and how would I either prevent this from happening or edit the script back to the way I wrote it?