Skip to main content

When I run workspace its gives me error for below lines : 

Starting translation...

Starting translation...
Python version 2.7 loaded successfully
Traceback (most recent call last):
  File "<string>", line 19, in MF_Include_1611748445222
  File "<string>", line 5, in ParamFunc
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py", line 40, in __getitem__
    raise KeyError(key)
KeyError: 'FME_LOCAL_OUTPUT'
INCLUDE -- failed to evaluate Python script `def ParamFunc():
  import os, time, re
  temp_output_path = os.environ 'FME_LOCAL_OUTPUT']

But actual code is like 

 

import os, time, re, sys
 
print("before printing....")
temp_output_path =  os.environ.get('FME_LOCAL_OUTPUT')
print("printingvalue",temp_output_path)

Its not running actual code. why its is like this ? I have set up environment variable also able to get value in general python script. 

 

fmw script was running FME 2016 server. I am trying to run same script in FME 2020 workbench. This running from CLI but not from workbench.

Make sure that you run the workspace from very beginning, e.g. by disabling feature caching first.


Make sure that you run the workspace from very beginning, e.g. by disabling feature caching first.

I did disabling feature caching first. I save changes, close workbench and try restarting operation still same issue.


I did disabling feature caching first. I save changes, close workbench and try restarting operation still same issue.

FME has a tendency to take ownership and sometimes does unexpected things with anything that has a name starting with "FME_" or "fme_". Try renaming your scripted parameter to something else and try again.


I did disabling feature caching first. I save changes, close workbench and try restarting operation still same issue.

Changing "FME_LOCAL_OUTPUT" to "ABC_LOCAL_OUTPUT" will not make any impact. I tried this also no changes. Things is script changes is loading while running workspace. not even printing log message before that line. Below screenshot - I was able to see changes there when open script here but while running no change, Its still show old one only. When I run this FME script through command line its works there. Screenshot 2021-01-27 at 6.10.09 PM


I did disabling feature caching first. I save changes, close workbench and try restarting operation still same issue.

I just tested your exact setup with FME 2018, 2019 and 2020, but was unable to reproduce any of the errors, it all worked as expected. Perhaps try with an empty workspace to see if the problem persists.


I did disabling feature caching first. I save changes, close workbench and try restarting operation still same issue.

Yes I was able to run start Python script in newly created workspace but not in old .fmw script. And same script able to get output in command line but not in FME workbench


I did disabling feature caching first. I save changes, close workbench and try restarting operation still same issue.

Perhaps consider sending the workspace to Safe support for analysis. You should probably also point them back to this thread for details.


I did disabling feature caching first. I save changes, close workbench and try restarting operation still same issue.

Ok. I tried running this script in FME 2017 also but no luck. 😞


Screenshot 2021-01-29 at 7.31.07 PMI was able to solve this error by setting right environment variable in app loading. https://community.safe.com/s/question/0D54Q00008OvKRrSAN/fme-workbench-is-not-taking-environment-variable and found the script which was loading. it was located in private Workspace Parameter -> Log file scripting.

 


Reply