• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue Plesk Migration Fails with "AttributeError: 'module' object has no attribute 'getlocale'"

drelich

New Pleskian
Server operating system version
Debian 10.13
Plesk version and microupdate number
Plesk Obsidian v18.0.47_build1800221003.04 os_Debian 10.0
Hi, trying to migrate a few website from a CentOS Linux 7.9.2009 (Core) dedicated server to a Debian 10.13 VPS, both running latest versions of Plesk Obsidian (dedicated server has a Web Pro Edition licence, the VPS runs a Web Admin Edition licence).

An attempt to connect to the remote server ends up with the following error readout:

Plesk Migrator returned non-zero exit code

COMMAND: '/usr/local/psa/admin/sbin/modules/panel-migrator/plesk-migrator' 'generate-migration-list' '/opt/psa/var/modules/panel-migrator/sessions/20221006165129/config.ini' '--migration-list-format=json' '--migration-list-file=/opt/psa/var/modules/panel-migrator/sessions/20221006165129/migration-list-raw.json' '--skip-services-checks' '--include-existing-subscriptions' '--async' '--overwrite' '--reload-source-data'

EXIT CODE: 1

STDOUT:


STDERR:
Traceback (most recent call last):
File "/opt/psa/admin/sbin/modules//panel-migrator/plesk-migrator", line 44, in <module>
sys.exit(run(base_dir, var_dir, execution_path, sys.argv[1:]))
File "/usr/local/psa/admin/plib/modules/panel-migrator/backend/lib/python/parallels/core/cli/migration_cli.py", line 34, in run
datetime.strptime("2017-01-01", "%Y-%m-%d")
File "/opt/plesk/python/2.7/lib/python2.7/_strptime.py", line 274, in <module>
_TimeRE_cache = TimeRE()
File "/opt/plesk/python/2.7/lib/python2.7/_strptime.py", line 192, in __init__
self.locale_time = LocaleTime()
File "/opt/plesk/python/2.7/lib/python2.7/_strptime.py", line 70, in __init__
self.lang = _getlang()
File "/opt/plesk/python/2.7/lib/python2.7/_strptime.py", line 29, in _getlang
return locale.getlocale(locale.LC_TIME)
AttributeError: 'module' object has no attribute 'getlocale'

Could this be a bug that needs fixing by the Plesk dev team or is there something I can do to make use of the migrator? Thanks.
 
What is the output of the command:

# locale

on both servers?
 
target server (Debian):
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
source server (CentOS):
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE=UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

What puzzles me is the 'datetime.strptime("2017-01-01", "%Y-%m-%d")' in the error message. Both my servers are set to current date and time so I don't understand why the error message is showing a date from 2017. Thanks.
 
FYI: just updated locale on the source server (CentOS) to eliminate the possibility of the missing LC_CTYPE and LC_ALL locale settings and re-run the migration tool - still getting the same error.
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
 
Any update on this? My old server expires in three days and I'd hate to waste another 50 euros for that + fees for the Plesk panel. I need to migrate the site by then. Thanks
 
nvm, did rsync via terminal to accomplish my goal. still, would be great to have any sort of a response since the problem is still there...
 
Hello have this error

Plesk Migrator returned non-zero exit code

COMMAND: '/usr/local/psa/admin/sbin/modules/panel-migrator/plesk-migrator' 'generate-migration-list' '/opt/psa/var/modules/panel-migrator/sessions/20221015174149/config.ini' '--migration-list-format=json' '--migration-list-file=/opt/psa/var/modules/panel-migrator/sessions/20221015174149/migration-list-raw.json' '--skip-services-checks' '--include-existing-subscriptions' '--async' '--overwrite' '--reload-source-data'

EXIT CODE: 1

STDOUT:


STDERR:
Traceback (most recent call last):
File "/opt/psa/admin/sbin/modules//panel-migrator/plesk-migrator", line 44, in <module>
sys.exit(run(base_dir, var_dir, execution_path, sys.argv[1:]))
File "/usr/local/psa/admin/plib/modules/panel-migrator/backend/lib/python/parallels/core/cli/migration_cli.py", line 34, in run
datetime.strptime("2017-01-01", "%Y-%m-%d")
File "/opt/plesk/python/2.7/lib/python2.7/_strptime.py", line 274, in <module>
_TimeRE_cache = TimeRE()
File "/opt/plesk/python/2.7/lib/python2.7/_strptime.py", line 192, in __init__
self.locale_time = LocaleTime()
File "/opt/plesk/python/2.7/lib/python2.7/_strptime.py", line 70, in __init__
self.lang = _getlang()
File "/opt/plesk/python/2.7/lib/python2.7/_strptime.py", line 29, in _getlang
return locale.getlocale(locale.LC_TIME)
AttributeError: 'module' object has no attribute 'getlocale'
 
Guys, the problem is corrupted for some reason /opt/plesk/python/2.7/lib/python2.7/locale.py file.
Developers try to find a reason and fix it in further Plesk Migrator updates.

At the moment, as a possible workaround, you can extract this file from plesk-py27 package to which the file belongs and replace the corrupted /opt/plesk/python/2.7/lib/python2.7/locale.py file with it.

Perhaps a Plesk Migrator reinstallation would be a more straightforward solution.
 
Thanks, Igor! I'll try when I have a bit of time. I did re-install a number of times and still got that error so hoping your workaround does the trick. Cheers.
 
At the moment, as a possible workaround, you can extract this file from plesk-py27 package to which the file belongs and replace the corrupted /opt/plesk/python/2.7/lib/python2.7/locale.py file with it.
hi where is the news file ?
 
Hi all, I am still currently having this issue on my server. Is there by chance an update which will be coming anytime soon to rectify this or is it still a case of manually modifying the server installation to achieve a functional result?

H
 
Hi all, I am still currently having this issue on my server. Is there by chance an update which will be coming anytime soon to rectify this or is it still a case of manually modifying the server installation to achieve a functional result?
Developers cannot reproduce this problem to understand its cause. At this point, there is a workaround. If a complete fix is needed, I suggest you contact Plesk Support Team so that experienced supporters can investigate the problem directly on your server and pass the necessary information to the developers for further work on the complete fix.
 
Back
Top