Hi,
I am having issues with PythonCaller (using arcpy scripts). It works fine on FME Desktop either on my local machine or server machine, but it failed with FME Server.
FME Desktop 2020.1.1.1 Build 20614 - win64
FME Server 2020.1.1 Build 20608-win64
The script is used for updating features from one gdb to another gdb (delete features in one gdb first, and append newly updated features from the other gdb)
import os
import fme
import fmeobjects
import arcpy
import os.path
from pathlib import Path
# Template Function interface:
# When using this function, make sure its name is set as the value of
# the 'Class or Function to Process Features' transformer parameter
def processFeature(feature):
dataset= str(feature.getAttribute('Features'))
Souce = "\\\\Mydirectory1\\DATA.gdb\\"+ dataset
Feature_Class_to_Update = "\\\\Mydirectory2\\Land\\"+ dataset
Empty_Features = Feature_Class_to_Update
Updated_features_in_VIEW = Empty_Features
# Process: Delete Features
arcpy.DeleteFeatures_management(Feature_Class_to_Update)
# Process: Append
arcpy.Append_management(Souce, Empty_Features, "TEST", "", "")
pass
# Template Class Interface:
# When using this class, make sure its name is set as the value of
# the 'Class or Function to Process Features' transformer parameter
class FeatureProcessor(object):
def __init__(self):
pass
def input(self,feature):
self.pyoutput(feature)
def close(self):
pass
1. The user who is logging in to the server machine and running the FME Engine having full control over the fmeData and Safe Software folders;
2. ArcGIS Pro has been installed and authorised in the server machine. Also, the only way to make FME server recognise our ArcGIS license was to authrosie ArcGIS Pro to work offline.
3. The user from the server machine can access all the shared folders containing geodatabases called in the scripts.
Warnings and Errors are:
2021-02-15 15:57:33| 1.4| 1.4|WARN |Failed to free sufficient memory to reach the process usage limit. To improve stability and performance please increase the memory available to FME. Available memory can be increased by adding physical RAM, increasing swap space, or closing other applications
2021-02-15 15:57:33| 1.5| 0.0|WARN |FME Configuration: Extremely low initial memory conditions detected. To improve stability and performance please increase the memory available to FME. Available memory can be increased by adding physical RAM, increasing swap space, or closing other applications
2021-02-15 15:57:52| 3.3| 1.7|ERROR |Python Exception <AttributeError>: Object: Tool or environment <DeleteFeatures_management> not found
2021-02-15 15:57:52| 3.3| 0.0|ERROR |Error encountered while calling function `processFeature'
2021-02-15 15:57:52| 3.3| 0.0|FATAL |PythonCaller (PythonFactory): PythonFactory failed to process feature
2021-02-15 15:57:52| 3.3| 0.0|ERROR |PythonCaller (PythonFactory): A fatal error has occurred. Check the logfile above for details
2021-02-15 15:57:52| 3.4| 0.0|ERROR |A fatal error has occurred. Check the logfile above for details