Pro Version 3.1.1
ArcGIS Server 11.1
Using propy.bat the following code runs on my desktop without a hitch. When trying to run on Server it errors out with attached error.
For the life of me I can't figure why. Any insights would be appreciated!
# Imports
import os
import arcpy
from arcgis.gis import GIS
from arcgis.features import FeatureLayer
from arcgis.features import FeatureLayerCollection
from datetime import datetime
# Define paths and files
unc_path = r'\\abc.local\AdminData\GIS'
root_path = os.path.join(unc_path, 'gis')
data_path = os.path.join(root_path, 'Database')
#project_path = os.path.join(root_path, "Projects", "Overnight", "overnight.aprx")
project_path = os.path.join(root_path, "Projects", "Overnight", "overnightDEV.aprx")
sdfile_path = os.path.join(root_path, "sdFiles")
db99_sde = os.path.join(data_path,"db99.sde")
gis_test = os.path.join(data_path,"gisTest.gdb")
workspace = os.path.join(data_path, 'Workspace.gdb')
behaviorNoOSS = os.path.join(campus_sde, "dbo.NoOss")
behaviorNoInc = os.path.join(campus_sde, "dbo.NoInc")
# other setup
arcpy.env.overwriteOutput = True
gis = GIS("https://servername.abc.local/portal", username="admin", password="adminPassword")
wksp = arcpy.EnvManager(scratchWorkspace=workspace, workspace=workspace)
shrOrg = True
shrEveryone = False
shrGroups = ""
# Process: Make Query Layer (Make Query Layer) (management)
student_temp = arcpy.management.MakeQueryLayer(input_database=db99_sde, out_layer_name="out_layer", query="select * from table", oid_fields=["id_number"])