FME Server and Packages: Python Exception <ModuleNotFoundError>

Liz Sanderson
Liz Sanderson
  • Updated

Symptom 

A workspace that contains a package Reader/Writer/Transformer is failing once it is published to FME Server. The error in the job log is similar to below, replacing the red highlight with the name of the package component: 

Python Exception <ModuleNotFoundError>: No module named 'fmepy_microsoft_sharepoint'


Cause 

When a package is published the .fpkg file gets uploaded to Resources > Engine and the first time a workspace is run that contains a component of this package, it will extract the contents of the .fpkg and distribute it across a series of subfolders within Resources > Engine > Packages. Sometimes, this extraction process does not complete successfully, but it will not retry and instead reports missing modules. 


Resolution

  1. From the FME Server Web UI please look in Resources > Engine for a <package>-<version>.fpkg file, if it is present move on to (2), if it is not, move to (4).
  2. Within Resources > Engine go to Packages > <fmebuild>-<OS> and then look in each of the subfolders for a folder named after the package e.g. safe.s3connector and delete it. (Note: Each package should only be present in a subset of these folders, for example, the safe.s3connector should be present in PackageFiles, python, resources, transformers and webfilesystems. For this error to occur it is likely that the package failed to successfully extract into one of them so it is best to clear them all out and start over).
  3. Re-run the job that contains the package component and it should try to re-extract, hopefully, this time successfully. 
  4. If the .fpkg file in (1) is missing, try re-publishing the workspace and make sure the package is selected for upload. Alternatively, download the .fpkg file from FME Hub and manually place it in Resources > Engine. After uploading, re-run the job to extract the package.
  5. If the steps above don't resolve the issue, you may need to check that the Packages folder has the correct permissions. In a linux / container environment change directories to /data/fmeserverdata/resources/engine and run ls -la and check that the Packages folder is owned by fmeserver:

    Packages folder permissions

    If that folder is owned by a different user to fmeserver (or root) you will need to do a chown so that fmeserver owns that folder (fmeserver uid and gui is 1363). Adding a -R flag will recursively change permissions of all of the files within that directory.

    chown fmeserver:fmeserver -R Packages
    ​​​​​​​chown 1363:1363 -R Packages

     


Troubleshooting

If this does not resolve the problem please check whether you have the PYTHONHOME environment variable set, according to the best answer in this Community Post this could also be interfering. 

If the suggested instructions do not resolve your problem please contact Safe Software Support for further troubleshooting. 
 

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.