Results 1 to 10 of 10

Thread: [Solved] zcp 7 RC1 - zarafa7-upgrade issue

  1. #1
    Senior Member
    Join Date
    Jan 2008
    Posts
    159

    [Solved] zcp 7 RC1 - zarafa7-upgrade issue

    Hi,

    I get error converting zcp 6.40.5 database by zarafa7-upgrade

    (RHEL 5.4 x86_64, zcp7 RC1)

    ################################################## #########

    Skipping update: Converting database to Unicode
    Skipping update: Update stores table usernames
    Converting rules to Unicode: 0 / 20 (0%)Traceback (most recent call last):
    File "./zarafa7-upgrade", line 593, in ?
    sys.exit(main())
    File "./zarafa7-upgrade", line 587, in main
    UpdateDB(db)
    File "./zarafa7-upgrade", line 537, in UpdateDB
    update(cursor, p)
    File "./zarafa7-upgrade", line 107, in UpdateDatabaseConvertRules
    new_rule_data = MySQLdb.escape_string(decode_wtf1252(result[2]).encode('utf-8'))
    File "./zarafa7-upgrade", line 64, in decode_wtf1252
    return s.decode('utf-8').translate(wtf1252_translate_table)
    AttributeError: 'array.array' object has no attribute 'decode'


    ###########################

  2. #2

    Re: zcp 7 RC1 - zarafa7-upgrade issue

    I can't reproduce your problem but reading this seems to give a few hints:

    - Try 1.2.2 of the MysqlDB python bindings
    - Maybe try setting the charset in you my.cnf
    - Don't change database things with alter table, that sounds dangerous

    if all that fails, you can try this patch:


  3. #3
    Senior Member
    Join Date
    Jan 2008
    Posts
    159

    Re: zcp 7 RC1 - zarafa7-upgrade issue

    Hi Steve,

    thank you, like you said - I updated MySQL-python-1.2.1 package from rhel to MySQL-python-1.2.2 and the script works - db is successful converted now.

    kind regards
    Waldemar

  4. #4
    Senior Member
    Join Date
    Nov 2008
    Posts
    424

    Re: zcp 7 RC1 - zarafa7-upgrade issue

    Is there a supported package of MySQL-python-1.2.2 for Centos5.x?
    Unfortunately the patch does not work for me and I can't find updated MySQL-python.


  5. #5
    Senior Member
    Join Date
    May 2006
    Location
    Delft
    Posts
    1,935

    Re: zcp 7 RC1 - zarafa7-upgrade issue

    Hi Sasos,

    Does it work when you install the python-setuptools rpm and then use easy_install to install MySQLdb?

    Milo

  6. #6

    Re: zcp 7 RC1 - zarafa7-upgrade issue

    oh my patch was wrong, try this one:


  7. #7
    Senior Member
    Join Date
    Nov 2008
    Posts
    424

    Re: zcp 7 RC1 - zarafa7-upgrade issue

    .tostring() seems to work

  8. #8
    Senior Member
    Join Date
    Nov 2008
    Posts
    424

    Re: [Solved] zcp 7 RC1 - zarafa7-upgrade issue

    I'm having a hard time understanding this piece of code. What is it's purpose? Convert WTF-1252 encoded characters in the rules xml to UTF-8?

    I see 2 problems with that...first, the string (or let's say object, I'm trying to catch up with Python unicode handling :-)) returned by decode_wtf1252() is unicode (since the input string is first "decoded" from utf-8 to unicode object and then translated according to the unicode wtf1252_translate_table) and this unicode object is then encoded back to utf-8 and passed to MySQLdb.escape_string(). OK, but my "/usr/lib64/python2.4/site-packages/MySQLdb/cursors.py" has this code around line 145:

    Any query passed to it is encoded to the charset of the database connection. Since the query passed to it is of string type (utf-8 encoded) any additional encoding will first perform an implicit ascii decode (str().encode() attempts an implicit decoding of s with the default encoding). This will fail if the utf-8 query contains any high characters as ascii decoder cannot handle them.
    The second problem is that the zarafa7-upgrade script never defines a charset for the database connection. If it was to enter any utf-8 characters, it should specify utf-8 as the connection charset and pass full unicode string to the cursor.execute so that it is encoded to utf-8 in the cursors.py. Or am I reading this wrong?

  9. #9
    Senior Member
    Join Date
    Nov 2008
    Posts
    424

    Re: [Solved] zcp 7 RC1 - zarafa7-upgrade issue

    Still digging into this :-D

    If characters are successfully converted to UTF-8 then webaccess will not show them correctly since the propTag still indicates a PT_STRING8. So I find the "Converting rules to Unicode" function either completely redundant or severely lacking. If nothing is done, then data remains in WTF-1252, propTag indicates an ANSI string and Zarafa will internally convert it to UTF-8 when it uses it. The rule is shown correctly (aside from assuming data was 1252 in the first place).
    If data was to be converted to UTF-8 (the troubles in the above post would apply, also there is no functionality for converting decimally encoded characters (&#ddd to utf-8) then also all the propTags would need to be modified to indicate a PT_UNICODE string...

  10. #10
    Senior Member
    Join Date
    Nov 2008
    Posts
    424

    Re: [Solved] zcp 7 RC1 - zarafa7-upgrade issue

    Just an additional note - Outlook seems to show rules correctly even when "Converting rules to Unicode" function is completely skipped. It will infact, correct all the mistakes when updating the rules so after a rule update even webaccess will show all the rules correctly (all lpszA encoded in UTF8 and propTags indicating PT_UNICODE). It must use different data than webaccess?

Similar Threads

  1. zarafa7-upgrade - UnicodeDecodeError
    By KristianM in forum Installation, Configuration and Maintenance
    Replies: 1
    Last Post: 13-04-2012, 09:50 AM
  2. how to resume after mysql crash during zarafa7-upgrade
    By jbredereck in forum Installation, Configuration and Maintenance
    Replies: 2
    Last Post: 25-08-2011, 08:36 AM
  3. zarafa7-upgrade on Ubuntu 10.04 failure
    By nocturn in forum Installation, Configuration and Maintenance
    Replies: 1
    Last Post: 11-08-2011, 10:13 PM
  4. Duration of zarafa7-upgrade
    By crueb in forum Beta Feedback
    Replies: 4
    Last Post: 23-05-2011, 01:08 PM
  5. zcp 7.0.0 rc1: zarafa7-upgrade script failed
    By juergen76 in forum Beta Feedback
    Replies: 3
    Last Post: 05-05-2011, 08:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •