Skip to main content
Solved

Projectwise transformers gets 'NoneType' object has no attribute 'encode' error on upload


roman1
Contributor
Forum|alt.badge.img+3

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 227in input
  File "webserviceconnectorfactory\webserviceconnectorfactory.py", line 1129in _handleException
  File "webserviceconnectorfactory\webserviceconnectorfactory.py", line 200in input
  File "webserviceconnectorfactory\webserviceconnectorfactory.py", line 467in _doUpload
  File "webserviceconnectorfactory\webserviceconnectorfactory.py", line 511in _uploadFile
  File "bentleyprojectwiseconnector\bentleyProjectWiseConnector.py", line 320in uploadData
  File "bentleyprojectwiseconnector\bentleyProjectWiseConnector.py", line 282in _uploadNewData
  File "bentleyprojectwiseconnector\bentleyProjectWiseConnector.py", line 233in _uploadDataBlock
  File "webserviceconnector\webserviceconnector.py", line 565in 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

Best answer by jovitaatsafe

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.

View original
Did this help you find an answer to your question?

11 replies

david_r
Celebrity
  • June 9, 2021

Can you post a screenshot of the ProjectWiseWSGConnector settings?


roman1
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • June 9, 2021

2021-06-09 15_22_13-Window Sure thing

 


david_r
Celebrity
  • June 9, 2021
roman1 wrote:

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?


roman1
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • June 9, 2021

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)

david_r
Celebrity
  • June 9, 2021
roman1 wrote:

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.


roman1
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • June 9, 2021
david_r wrote:

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?


roman1
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • May 11, 2022
luka_muna wrote:

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


jovitaatsafe
Safer
Forum|alt.badge.img+11
  • Safer
  • Best Answer
  • June 20, 2022

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.


bilal
Contributor
Forum|alt.badge.img+4
  • Contributor
  • February 29, 2024

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings