Hi, I have a piece of code that ran fine as a user however once it runs as a service account, I get the following error. Can anyone kindly assist?
File "E:\GeoprocessingWorkforce\PROD2_WORKSPACE\dev_phase2\report_handler.py", line 67, in PrintReport lyt.exportToPDF(filePath) File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\utils.py", line 191, in fn_ return fn(*args, **kw) File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\_mp.py", line 1161, in exportToPDF return convertArcObjectToPythonObject(self.c(*gp_fixargs((out_pdf, resolution, image_quality, compress_vector_graphics, image_compression, embed_fonts, layers_attributes, georef_info, jpeg_compression_quality, clip_to_elements, output_as_image, embed_color_profile), True))) OSError: E:\pdfs\abc.pdf
Just wondering if that is the actual output file name, because if python is involved, the lack of raw encoding of the name will cause issues
p ="E:\pdfs\abc.pdf" # you should use r"E:\pdfs\abc.pdf" print(p) E:\pdfsbc.pdf
nope 😞 i use os path join to join up filepath. Furthermore it works with my user account. Just not a service account
I also see this post by Igor that had the exact same error.
This has been logged as a bug in ArcGIS Enterprise 10.8.1:
Find the patch in the following link, https://support.esri.com/en/download/7834.