Skip to main content

The WSG transformer gets following error when I try to upload files to Projectwise: 

ProjectWiseWSGConnector: Uploading file "testfile.shp" to Bentley ProjectWise
Python Exception <AttributeError>: 'NoneType' object has no attribute 'encode'
Traceback (most recent call last):
  File "webserviceconnectorfactory\webserviceconnectorfactory.py", line 227, in input
  File "webserviceconnectorfactory\webserviceconnectorfactory.py", line 1129, in _handleException
  File "webserviceconnectorfactory\webserviceconnectorfactory.py", line 200, in input
  File "webserviceconnectorfactory\webserviceconnectorfactory.py", line 467, in _doUpload
  File "webserviceconnectorfactory\webserviceconnectorfactory.py", line 511, in _uploadFile
  File "bentleyprojectwiseconnector\bentleyProjectWiseConnector.py", line 320, in uploadData
  File "bentleyprojectwiseconnector\bentleyProjectWiseConnector.py", line 282, in _uploadNewData
  File "bentleyprojectwiseconnector\bentleyProjectWiseConnector.py", line 233, in _uploadDataBlock
  File "webserviceconnector\webserviceconnector.py", line 565, in addToHeader
AttributeError: 'NoneType' object has no attribute 'encode'
Error encountered while calling method `input'
ProjectWise_-_Upload_New_files_CALLER (PythonFactory): PythonFactory failed to process feature
ProjectWise_-_Upload_New_files_CALLER (PythonFactory): A fatal error has occurred. Check the logfile above for details

Error seems to originate in upload routine. From what I can see it expects a string variable that is null and cannot decode character decoding?. 

 

Currently on FME 2021.0.0.1

 

Same error happens on FME server 2021.0.0.3

Can you post a screenshot of the ProjectWiseWSGConnector settings?


2021-06-09 15_22_13-Window Sure thing

 


2021-06-09 15_22_13-Window Sure thing

 

I'm assuming the Object ID refers to a folder and not a file?

Also, which Python version is specified in the Workspace settings? Have you tried both version 2.7 and 3.x?


Object ID is an output variable that refers to Projectwise ID for the file once uploaded. I haven't tryed switching python versions. I'm currently running Python 3.8+.

 

As suggesed I tested Python versions :

  • 2.7 and 3 (Did not work, same error)
  • 3.7+ (Did not work, same error)
  • 3.6+ (Did not work, same error)
  • 2.7 (deprecated) (Did not work, same error)

Object ID is an output variable that refers to Projectwise ID for the file once uploaded. I haven't tryed switching python versions. I'm currently running Python 3.8+.

 

As suggesed I tested Python versions :

  • 2.7 and 3 (Did not work, same error)
  • 3.7+ (Did not work, same error)
  • 3.6+ (Did not work, same error)
  • 2.7 (deprecated) (Did not work, same error)

I ought to be clearer, I was referring to the value "Project Object ID" under ProjectWise Destination, not the output attribute.


I ought to be clearer, I was referring to the value "Project Object ID" under ProjectWise Destination, not the output attribute.

Ah, my bad. Yes it refers to folder i Projectwise.


I'm getting the same error. Did you find a solution for it?


I'm getting the same error. Did you find a solution for it?

Not yet unfortunetly, had to implement a manual workaround


I was able to upload xlsx and dwg files but couldn't upload dgn files.

 

ProjectWiseWSGConnector: Uploading file "xxxxxxxxxxxxxxxxxxxxxxxxxxx.dgn" to Bentley ProjectWise

Python Exception <AttributeError>: 'NoneType' object has no attribute 'encode'

Traceback (most recent call last):

File "webserviceconnectorfactory\\webserviceconnectorfactory.py", line 227, in input

File "webserviceconnectorfactory\\webserviceconnectorfactory.py", line 1129, in _handleException

File "webserviceconnectorfactory\\webserviceconnectorfactory.py", line 200, in input

File "webserviceconnectorfactory\\webserviceconnectorfactory.py", line 467, in _doUpload

File "webserviceconnectorfactory\\webserviceconnectorfactory.py", line 511, in _uploadFile

File "bentleyprojectwiseconnector\\bentleyProjectWiseConnector.py", line 320, in uploadData

File "bentleyprojectwiseconnector\\bentleyProjectWiseConnector.py", line 282, in _uploadNewData

File "bentleyprojectwiseconnector\\bentleyProjectWiseConnector.py", line 233, in _uploadDataBlock

File "webserviceconnector\\webserviceconnector.py", line 565, in addToHeader

AttributeError: 'NoneType' object has no attribute 'encode'

Error encountered while calling method `input'

ProjectWiseWSGConnector_CALLER (PythonFactory): PythonFactory failed to process feature

ProjectWiseWSGConnector_CALLER (PythonFactory): A fatal error has occurred. Check the logfile above for details

A fatal error has occurred. Check the logfile above for details


Hi @luka_muna​,

I'm happy to report that this has been resolved by the development team for FME 2021.2 (build 21707 and higher). This issue had been caused by the mimetype not being recognized, so in the fixed build, the connector will now successfully upload the file and log a warning.

 

Please give this another try in FME 2021.2 and newer and it should work successfully now.


I’m getting the same error in 2021.2
Any progress?


Reply