I have recently published a geoprocessing service and there is a path it replaces with the correct location on the server. I use a registered folder for my data and the publisher and server locations of that folder are different; this the path the g_ESRI_variable is attempting to replace. This is what the registered folder is set up as:
In my script, I have hardcoded the path needed to access files, this is the publisher folder path:
workspace = r'E:\ArcGIS_RegisteredFolders_DO_NOT_DELETE\HabitatMapPrint'
The g_ESRI_variable being created and used to replace the above value for the workspace variable is this:
g_ESRI_variable_4 = 'D:\\RegisteredFolders_DO_NOT_DELETE\\HabitatMapPrint't'
Note that it is adding t' to the end. I have no clue why, but it is causing an invalid syntax error if I try to run the geoprocessing tool from the server:
These are the settings when I overwrite the service:
I have also deleted the service and attempted to publish brand new, it doesn't make a difference.