Question

I use the custom-transformer WordToPDFWriter. On my desktop it works fine. When I run this workspace on the server I have a failure. What causes this error and how can I solve this?

  • 13 February 2023
  • 6 replies
  • 7 views

Badge +2

Install: WordToPDFWriter

 

Dependencies

1 comtypes python package To install this depenency, 

start a command prompt as an administrator and execute the following command: 

fme.exe python -m pip install comtypes --target "C:\\Users\\<YOURUSERNAME>\\Documents\\FME\\Plugins\\Python"

2 Microsoft Word must me installed on your machine.

 

========================================================

Error running on FME server:

 

119 2023-2-13 15:08:46 | Python Exception <ValueError>: NULL COM pointer access

120 2023-2-13 15:08:46 | Traceback (most recent call last):

121 2023-2-13 15:08:46 | File "<string>", line 47, in input

122 2023-2-13 15:08:46 | File "C:\\Users\\xxx_fme\\Documents\\FME\\Plugins\\Python\\comtypes\\_meta.py", line 13, in _wrap_coclass

123 2023-2-13 15:08:46 | result = punk.QueryInterface(itf)

124 2023-2-13 15:08:46 | File "C:\\Users\\xxx_fme\\Documents\\FME\\Plugins\\Python\\comtypes\\__init__.py", line 1197, in QueryInterface

125 2023-2-13 15:08:46 | self.__com_QueryInterface(byref(iid), byref(p))

126 2023-2-13 15:08:46 | ValueError: NULL COM pointer access

127 2023-2-13 15:08:46 |

128 2023-2-13 15:08:46 | Error encountered while calling method `input'

129 2023-2-13 15:08:46 | Lus_bestanden_2_WordToPDFWriter_PythonCaller (PythonFactory): PythonFactory failed to process feature

 

 

 


6 replies

Userlevel 1
Badge +11

Hi,

The WordToPDFWriter has 2 dependencies, as you mention yourself in your post...

So, the question is:

1) did you import the comtypes python package to your FME Server (for more information, see: Importing Custom Python Modules to FME Server)

2) is Microsoft Word installed on your server?

 

BR,

 

Egge-Jan

Badge +2

Hi,

Yes, Word is installed and also Python. Reinstal will confirm that Python is installed in the folder mentioned. We have also tried to upload the package to the server using the upload in resources.

 

This also results in an error:

192023-2-13 18:29:24 | Python Exception <ValueError>: NULL COM pointer access1202023-2-13 18:29:24 | Traceback (most recent call last):1212023-2-13 18:29:24 | File "<string>", line 47, in input1222023-2-13 18:29:24 | File "C:\\Users\\sala_fme\\Documents\\FME\\Plugins\\Python\\comtypes\\_meta.py", line 13, in _wrap_coclass1232023-2-13 18:29:24 | result = punk.QueryInterface(itf)1242023-2-13 18:29:24 | File "C:\\Users\\sala_fme\\Documents\\FME\\Plugins\\Python\\comtypes\\__init__.py", line 1197, in QueryInterface1252023-2-13 18:29:24 | self.__com_QueryInterface(byref(iid), byref(p))1262023-2-13 18:29:24 | ValueError: NULL COM pointer access1272023-2-13 18:29:24 |1282023-2-13 18:29:24 | Error encountered while calling method `input'1292023-2-13 18:29:24 | Lus_bestanden_2_WordToPDFWriter_PythonCaller (PythonFactory): PythonFactory failed to process feature

Badge +5

Hello,

 

Would you be able to create a case with the following information-

 

  • Build and version of FME Server
  • Build and version of FME Desktop
  • Full job log file on the Server
  • Said workspace with sample data

 

Badge +2

I have asked my suppier to make a case because they already have all my info.

thanks for your reply and I hope to have a solution soon.

Good day - I am having the same error. I just validated that the user who runs FME Server (Flow) has an E5 MS License and I installed Word to the server. I have further installed Comtypes using the FME process. What is very odd, I run the workspace which is simple ( Creator then WordToPFWriter ) using the same account that the FME services run under using FME Desktop (Form) and everything works fine. Publish to FME Server, which is the same machine we just ran the workbench on and I get the same errors as reported by Perry:

762023-7-21 12:58:35 | Python Exception <ValueError>: NULL COM pointer access772023-7-21 12:58:35 | Traceback (most recent call last):782023-7-21 12:58:35 | File "<string>", line 47, in input792023-7-21 12:58:35 | File "C:\\Users\\sqlengine\\Documents\\FME\\Plugins\\Python\\comtypes\\_meta.py", line 13, in _wrap_coclass802023-7-21 12:58:35 | result = punk.QueryInterface(itf)812023-7-21 12:58:35 | ^^^^^^^^^^^^^^^^^^^^^^^^822023-7-21 12:58:35 | File "C:\\Users\\sqlengine\\Documents\\FME\\Plugins\\Python\\comtypes\\__init__.py", line 831, in QueryInterface832023-7-21 12:58:35 | self.__com_QueryInterface(byref(iid), byref(p))842023-7-21 12:58:35 | ValueError: NULL COM pointer access852023-7-21 12:58:35 |862023-7-21 12:58:35 | Error encountered while calling method `input'872023-7-21 12:58:35 | WordToPDFWriter_PythonCaller (PythonFactory): PythonFactory failed to process feature

-----------------

From the FME Desktop Log you can see we are successful:

 

WordToPDFWriter_Tester (TestFactory): Tested 1 input feature(s) -- 1 feature(s) passed and 0 feature(s) failed

WordToPDFWriter_Aggregator (AggregateFactory): Combined 1 input feature(s) into 1 output feature(s), including 0 singleton(s)

WordToPDFWriter_FilenamePartExtractor (TeeFactory): Cloned 1 input feature(s) into 1 output feature(s)

WordToPDFWriter_Output1685639261 Output Collector (TeeFactory): Cloned 1 input feature(s) into 1 output feature(s)

WordToPDFWriter Output Output Renamer/Nuker (TeeFactory): Cloned 1 input feature(s) into 1 output feature(s)

Destination Feature Type Routing Correlator (RoutingFactory): Tested 0 input feature(s), wrote 0 output feature(s): 0 matched merge filters, 0 were routed to output, 0 could not be routed.

Final Output Nuker (TeeFactory): Cloned 0 input feature(s) into 0 output feature(s)

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

              Features Read Summary

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

==============================================================================

Total Features Read                             0

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

              Features Written Summary

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

==============================================================================

Total Features Written                            0

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-

-~                                       ~-

-~  Feature caches have been recorded at every stage of the translation.   ~-

-~           To inspect the recorded features,           ~-

-~       click the feature cache icons next to the ports.        ~-

-~                                       ~-

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-

Translation was SUCCESSFUL with 7 warning(s) (0 feature(s) output)

FME Session Duration: 9 seconds. (CPU: 0.7s user, 0.8s system)

END - ProcessID: 19264, peak process memory usage: 149440 kB, current process memory usage: 149440 kB

Translation was SUCCESSFUL

 

 

Why does this work nicely in the desktop workbench for the exact same user that runs the FME services on the same machine where FME Server is located.

 

Issue is when run via FME server we get errors and no document is created?

Thank you

Tim

Userlevel 1
Badge +6

Please note that the WordToPDFWriter transformer is not supported by all FME Flow installations. Typically Windows Services, such as fmeengine, aren't allowed to interact with the GUI which is a dependency of the underlying comtypes Python package.

 

We apologize for the inconvenience.

Reply