kopano-migration-pst / illegal UTF-16 surrogate

While trying to import a specific .pst file with kopano-migration-pst, I always get the following Traceback:

2017-02-01 20:58:32,402 - migration-pst - INFO - importing folder 'Oberste Ebene des Persönlichen Ordners/Gelöschte Objekte1'
2017-02-01 20:58:32,655 - migration-pst - WARNING - could not resolve user 'peter'
2017-02-01 20:58:33,919 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 91, in import_pst
    for message in pst.message_generator(folder):
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/pst.py", line 1964, in message_generator
    message = Message(submessage.nid, self.ltp)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/pst.py", line 1361, in __init__
    self.pc = ltp.get_pc_by_nid(nid)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/pst.py", line 1161, in get_pc_by_nid
    return PC(hn)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/pst.py", line 931, in __init__
    pc_prop = PCBTHData(bth_data, hn)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/pst.py", line 661, in __init__
    self.value = ptype.value(''.join(datas))
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/pst.py", line 733, in value
    return bytes.decode('utf-16-le') # unicode
  File "/usr/lib/python2.7/encodings/utf_16_le.py", line 16, in decode
    return codecs.utf_16_le_decode(input, errors, True)
UnicodeDecodeError: 'utf16' codec can't decode bytes in position 2834-2835: illegal UTF-16 surrogate

2017-02-01 20:58:33,921 - migration-pst - INFO - importing folder 'Oberste Ebene des Persönlichen Ordners/Gelöschte Objekte1/Kontakte'
2017-02-01 20:58:33,973 - migration-pst - INFO - importing folder 'Oberste Ebene des Persönlichen Ordners/Gelöschte Objekte'
2017-02-01 20:58:34,014 - migration-pst - INFO - imported 34 items in 2.26 seconds (15.07/sec, 1 errors)
2017-02-01 20:58:34,014 - migration-pst - INFO - stopping migration-pst

There are around 800 items in the .pst file (in this folder). I am using the kopano-migration-pst_8.2.0.485-18.2_amd64.deb on Ubuntu 14.04.
Can someone give me a hint on what to do?

Hello @schrorg ,

can you test if you get the same error, when using kopano-migration-pst from the master directory? For this you can just install this one package and don’t have to upgrade your complete installation.

Hello @fbartels,

the version from the master directory gives much more output, but the result is worse:

2017-02-02 08:12:57,955 - migration-pst - INFO - importing folder 'Gelöschte Objekte1'
2017-02-02 08:12:58,115 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,125 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,134 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,143 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,167 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,182 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,200 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,255 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,278 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,287 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,299 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,310 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,337 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,353 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,364 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,385 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,400 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,411 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,422 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,560 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,576 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,593 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,613 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,627 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,636 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,651 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,671 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,684 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,707 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,722 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,735 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,745 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,759 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,768 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 109, in import_pst
    self.import_props(message, message2.mapiobj)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 22, in import_props
    if proptype in (PT_CURRENCY, PT_MV_CURRENCY, PT_ACTIONS, PT_SRESTRICT, PT_SVREID):
NameError: global name 'PT_SRESTRICT' is not defined

2017-02-02 08:12:58,774 - migration-pst - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kopano/__init__.py", line 4326, in log_exc
    try: yield
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/__init__.py", line 105, in import_pst
    for message in p.message_generator(folder):
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/pst.py", line 1971, in message_generator
    message = Message(submessage.nid, self.ltp)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/pst.py", line 1367, in __init__
    self.pc = ltp.get_pc_by_nid(nid)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/pst.py", line 1166, in get_pc_by_nid
    return PC(hn)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/pst.py", line 936, in __init__
    pc_prop = PCBTHData(bth_data, hn)
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/pst.py", line 661, in __init__
    self.value = ptype.value(''.join(datas))
  File "/usr/lib/python2.7/dist-packages/kopano_migration_pst/pst.py", line 734, in value
    return bytes.decode('utf-16-le') # unicode
  File "/usr/lib/python2.7/encodings/utf_16_le.py", line 16, in decode
    return codecs.utf_16_le_decode(input, errors, True)
UnicodeDecodeError: 'utf16' codec can't decode bytes in position 2834-2835: illegal UTF-16 surrogate

2017-02-02 08:12:58,777 - migration-pst - INFO - importing folder 'Gelöschte Objekte1/Kontakte'
2017-02-02 08:12:58,854 - migration-pst - INFO - importing folder 'Gelöschte Objekte'
2017-02-02 08:12:58,918 - migration-pst - INFO - imported 0 items in 1.60 seconds (0.00/sec, 35 errors)
2017-02-02 08:12:58,919 - migration-pst - INFO - stopping migration-pst

After that, 34 totally empty elements are imported.
I used kopano-migration-pst_8.3.0~694-73.1_amd64.deb this time.
Unfortunately, I don’t have any python knowledge…

Thank you so far,
Robin

Hi,

The version in master depends on some changes in python-mapi, so you probably want to upgrade that to master as well…

As for the UTF-16 issue, I can’t really explain it. Would it perhaps be possible to send it to us/me in private, so I can have a look…? Or to create a smaller version somehow that exhibits the same problem?

Thanks!
Mark.

@mark-dufour The file is about 200MB in size and contains some confidential stuff. I will try to make a smaller version and provide it to you in the afternoon.

@mark-dufour I created a smaller PST file now (2MB) and would like to send it to you in private. How can I do it?

@schrorg if you have a subscription your could attach it to a support case. If you don’t have a subscription please mail it to feedback@kopano.com and we’ll forward it internally.

@fbartels I sent it by mail because the “Create Ticket” process didn’t let me upload the file. Please feel free to open a support ticket for me. I do have a subscription (any only one).

Thank you for your efforts!

@schrorg no not necessary. Attachment has been forwarded.

@schrorg

I had the same issue with the latest kopano-migrate-pst; Basically “PT_SRESTRICT” is misspelled in the defintion file which you can either correct manually or install the refering MAPI version:
For more information see:
https://forums.zarafa.com/showthread.php?13221-Import-pst-files-to-Kopano&p=57856&viewfull=1#post57856

Cheers

Log in to reply

Looks like your connection to Kopano Community Forum was lost, please wait while we try to reconnect.