Applicable to:
- Plesk for Linux
- Plesk for Windows
Symptoms
-
On attempt to start a new import session at Domains > example.com > Mail Importing, the page gets back to the import screen and does not show any session or status.
-
Previous import sessions are missing at Domains > example.com > Mail Importing.
-
The following error is shown in
/usr/local/psa/var/modules/site-import/sessions/mail-migration-XX/debug_XXX.log
:CONFIG_TEXT: |D|MT|core.workflow.runner.by_subscription||| File "/opt/plesk/python/2.7/lib64/python2.7/json/decoder.py", line 369, in decode
|D|MT|core.workflow.runner.by_subscription||| raise ValueError(errmsg("Extra data", s, end, len(s)))
|D|MT|core.safe|||ValueError: Extra data: line 52 column 2 - line 52 column 3 (char 1748 - 1749)
|E|MT|core.safe|||Failed to write final import status to a file
Cause
Site Import cannot read or write to one of the JSON files because it has improper format.
This issue is a Plesk Migrator bug with ID PMT-4988 that is planned to be fixed in future product updates.
In case the issue occurs again, before fixing, take the corrupted .json file, site import logs, plesk debug (if possible) and attach it to the bug https://webpros.atlassian.net/browse/PMT-4988.
Resolution
For Plesk on Linux
Note: In this case, previous import sessions will be lost for the domain.
-
Connect to the Plesk server via SSH.
-
Find the ID of the domain to which mail content is being migrated:
# plesk db "select id from domains where name='example.com'"
+----+
| id |
+----+
| 89 |
+----+ -
Remove everything from the session folder of the domain. Use ID found on step 2:
-
On Linux:
# rm -rf /usr/local/psa/var/modules/site-import/sessions/mail-migration-89
-
on Windows Server
CONFIG_TEXT: %plesk_dir%var\modules\site-import\sessions\mail-migration-89
-
-
In Plesk, go to Domains > example.com > Mail Importing.
-
Cancel previous import sessions that have their status stuck at "In progress" (if there are any).
-
Connect to the Plesk server via SSH.
-
Find the ID of the domain to which mail content is being migrated:
# plesk db "select id from domains where name='example.com'"
+----+
| id |
+----+
| 89 |
+----+ -
Go to the migration session directory of this domain. Use ID found on step 2:
# cd /usr/local/psa/var/modules/site-import/sessions/mail-migration-89
-
Run the following script to find corrupted JSON files inside the direcotry:
# ls *.json | while read i; do echo $i; python -mjson.tool $i > /dev/null ; done
On some systems, the utility
python2
is used instead ofpython
. In this case, run:# ls *.json | while read i; do echo $i; python2 -mjson.tool $i > /dev/null ; done
-
Look through the output to find the corrupted JSON file:
CONFIG_TEXT: mail_migration_status.json
Extra data: line 52 column 2 - line 52 column 3 (char 1748 - 1749) -
Use any JSON syntax parser tool (for example, JSONLint JSON Validator) to fix the corrupted JSON file.
-
In Plesk, go to Domains > example.com > Mail Importing.
-
Cancel previous import sessions that have their status stuck at "In progress".
-
Connect to the Plesk server via RDP.
-
Start PowerShell prompt.
-
Find the ID of the domain to which mail content is being migrated:
PS plesk db "select id from domains where name='example.com'";
+----+
| id |
+----+
| 89 |
+----+ -
Go to the migration session directory of this domain. Use ID found on step 2:
PS cd "C:\Program Files (x86)\Plesk\var\modules\site-import\sessions\mail-migration-89"
-
Run the following script to find corrupted JSON files inside the direcotry:
PS Get-ChildItem *.json | Foreach-Object { $file = $_.FullName; echo "Checking JSON file: $file"; %{&"C:\Program Files (x86)\Plesk\python3\python.exe" -m json.tool $file 1> $null}; echo ""}
-
Look through the output to find the corrupted JSON file:
CONFIG_TEXT: Checking JSON file: C:\Plesk\Data\var\modules\site-import\sessions\mail-migration-1\mail_migration_list_2020-01-08-10-27-40.json
Extra data: line 16 column 2 - line 16 column 3 (char 386 - 387) -
Use any JSON syntax parser tool (for example, JSONLint JSON Validator) to fix the corrupted JSON file.
-
In Plesk, go to Domains > example.com > Mail Importing.
-
Cancel previous import sessions that have their status stuck at "In progress".
Comments
0 comments
Please sign in to leave a comment.