Issues related to incorrect Python configuration
WorkFusion utilizes different Python versions for different purposes. For AutoML models, Python 3.7 is used.
Due to incomplete installation, Python libraries can be missing or misconfigured.
Symptoms
The main symptom of such issues is that you receive one of the following error messages when you run a Python model:
com.workfusion.vds.sdk.api.exception.SdkException: Document cannot be analysed for request ExecutionRequestCaused by: com.workfusion.vds.sdk.api.exception.SdkException: Transport connection was terminated unexpectedly(http status: 500) ExtractionDocumentProcessor cannot be instantiated for modelClass com.workfusion.checkbox.model.CheckboxDetectionModelcom.workfusion.vds.sdk.api.exception.SdkException: java.lang.IllegalStateException: Pipeline predict error occurred: No module
It's a high-level message layer, so it might not lead you to the root cause of the model failure. For that, you need to take a deeper look as described below.
Case 1: missing Python library or library version
Investigation steps
Take a look at the logs of the model's Python Worker. In the logs, you should be able to find an error message similar to the ones below:
Failed to load models module: automl.ml.lib.enhancement_pipeline.supported_models (<type 'exceptions.ImportError'>): No module named cv2ImportError: cannot import name 'joblib' from 'sklearn.externals' (/apps/workfusion/python-3.7/lib/python3.7/site-packages/sklearn/externals/__init__.py)
Solution
Gather the logs of the model's Python Worker and submit a ticket to the OPS Workfusion Support, attaching the gathered logs. Our engineers can help you install missing libraries.
Case 2: inappropriate Python version
Investigation steps
Use Kibana to check the logs of the model's Python Worker. When a Worker is starting, it lists the environment variables:
* Python sys.exe[/apps/workfusion/python-3.7/bin/python3], sys.ver[3.7.9 (default, Nov 11 2020, 06:28:34) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]], sys.path[['/apps/workfusion/vds-data/eval/swkfabd1/label_c7b1c949-63f0-42bf-9977-63f065ba8b89/work/python/bridge.pyz', '/apps/workfusion/python-3.7/lib/python37.zip', '/apps/workfusion/python-3.7/lib/python3.7', '/apps/workfusion/python-3.7/lib/python3.7/lib-dynload', '/apps/workfusion/python-3.7/lib/python3.7/site-packages', '/apps/workfusion/python-site/lib/python2.7/site-packages', '/apps/workfusion/python-site/lib64/python2.7/site-packages', '/apps/workfusion/rpms/usr/lib/python2.7/site-packages', '/apps/workfusion/rpms/usr/lib64/python2.7/site-packages']]
2022-05-05 09:51:57.158 INFO /apps/workfusion/vds-data/eval/swkfabd1/label_c7b1c949-63f0-42bf-9977-63f065ba8b89/work/python/bridge.pyz/automl/ipc/server/servers.py:init_deps:130 [PID:31277] Init dependencies:
* extract_path: /apps/workfusion/vds-data/eval/swkfabd1/label_c7b1c949-63f0-42bf-9977-63f065ba8b89/work/python/libs/deps.extracted
* install_path: /apps/workfusion/vds-data/eval/swkfabd1/label_c7b1c949-63f0-42bf-9977-63f065ba8b89/work/python/libs/deps.installed
* python_bin: /apps/workfusion/python-3.7/bin/python3
Check that the required Python version is listed first. If not, proceed to the solution.
Solution
Gather the logs of the model's Python Worker and submit a ticket to the OPS Workfusion Support, attaching the gathered logs. Our engineers can help you correct the environment variables.
View also: