Migration from DirectAdmin fails: TypeError: coercing to Unicode: need string or buffer, NoneType found

Created:

2017-04-10 19:04:03 UTC

Modified:

2017-08-19 03:09:09 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Migration from DirectAdmin fails: TypeError: coercing to Unicode: need string or buffer, NoneType found

Applicable to:

  • Plesk Onyx for Linux

Note: This article has the reference to the issue with the fix available:

  • #PMT-3618 "Migration from DirectAdmin failed if a protected directory created in DirectAdmin was not physically present on the file system."
    Fixed in:
Please consider updating your server:

Symptoms

After the start of the migration from DirectAdmin, it fails with the following error:

File "/var/tmp/agent/directadmin.py", line 1714, in <module>
panel_dump = get_dump()
File "/var/tmp/agent/directadmin.py", line 1676, in get_dump
customers=get_customers(warnings, connections, 'admin'),
File "/var/tmp/agent/directadmin.py", line 1581, in get_customers
suspended
File "/var/tmp/agent/directadmin.py", line 1430, in get_subscriptions
da_customer
File "/var/tmp/agent/directadmin.py", line 381, in get_addon_domains
da_addon_domain
File "/var/tmp/agent/directadmin.py", line 1198, in get_protected_directories
"AuthUserFile"
File "/var/tmp/agent/directadmin.py", line 1151, in get_protected_directory_users
skip_error=True
File "/var/tmp/agent/directadmin.py", line 192, in get_lines
error = check_file(filename)
File "/var/tmp/agent/directadmin.py", line 126, in check_file
if not os.path.exists(filename):
File "/opt/plesk/python/2.7/lib64/python2.7/genericpath.py", line 26, in exists
os.stat(path)
TypeError: coercing to Unicode: need string or buffer, NoneType found

That is a critical error, migration was stopped.

Cause

Migration fails if protected directory does not exist.

This is a Plesk bug with ID PMT-3618 which was fixed in Plesk Migrator 2.7

Resolution

As workaround do the following:

  1. Backup /usr/local/psa/admin/plib/modules/panel-migrator/backend/lib/python/parallels/plesk/source/directadmin/agent/directadmin.py :
    # cp /usr/local/psa/admin/plib/modules/panel-migrator/backend/lib/python/parallels/plesk/source/directadmin/agent/directadmin.py{,.bk}
  2. Replace the original file with the one from the attachment:
    # wget https://support.plesk.com/hc/en-us/article_attachments/115003304305/directadmin.zip
    # unzip directadmin.zip
    # mv directadmin.py /usr/local/psa/admin/plib/modules/panel-migrator/backend/lib/python/parallels/plesk/source/directadmin/agent/directadmin.py

Attachments:

Have more questions? Submit a request
Please sign in to leave a comment.