• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue Site Import Error UnicodeEncodeError: 'ascii'

maffi

New Pleskian
Server operating system version
Ubuntu 22.04.2 LTS
Plesk version and microupdate number
18.0.51
Hello Community,

unfortunately I always get the following message when using the extension "Site Import". Does anyone have an idea what this could be? I am wondering about the "UnicodeEncodeError: 'ascii' codec can't encode character u'\xa7' in position 7: ordinal not in range(128)":

Failed to copy files of source folder '/var/www/html/www.domain1.de/htdocs/web' to '/var/www/vhosts/domain1.de/httpdocs/' on the target server.
Transfer the folder manually to the target server. [Details ausblenden]
Command execution failed on the local server with non-zero exit code.
command: su admdomain1 --shell /bin/sh -c '/usr/local/psa/admin/plib/modules/site-import/backend/lib/python/parallels/core/extras/ftp-migrator/ftp-migrator --config-file -'
exit code: 1
stdout:
stderr: [2023-04-06 15:21:32,807] [INFO] Try to connect to FTP host 'domain1.de'
[2023-04-06 15:21:32,819] [INFO] Successfully connected to FTP host 'domain1.de', host replied: 220 web02.xyz.de
[2023-04-06 15:21:32,819] [INFO] Try to login to FTP host 'domain1.de' with username 'admdomain1'
Traceback (most recent call last):
File "/usr/local/psa/admin/plib/modules/site-import/backend/lib/python/parallels/core/extras/ftp-migrator/ftp-migrator", line 5, in <module>
main()
File "/opt/psa/admin/plib/modules/site-import/backend/lib/python/parallels/core/extras/ftp-migrator/ftp_migrator/main.py", line 278, in main
config.use_ftps, config.encoding, config.ignore_passive_mode_server_ip
File "/opt/psa/admin/plib/modules/site-import/backend/lib/python/parallels/core/extras/ftp-migrator/ftp_migrator/ftp.py", line 50, in __init__
self.connect()
File "/opt/psa/admin/plib/modules/site-import/backend/lib/python/parallels/core/extras/ftp-migrator/ftp_migrator/ftp.py", line 72, in connect
self._ftp.login(self._username, self._password)
File "/opt/plesk/python/2.7/lib/python2.7/ftplib.py", line 682, in login
return FTP.login(self, user, passwd, acct)
File "/opt/plesk/python/2.7/lib/python2.7/ftplib.py", line 395, in login
if resp[0] == '3': resp = self.sendcmd('PASS ' + passwd)
File "/opt/plesk/python/2.7/lib/python2.7/ftplib.py", line 250, in sendcmd
self.putcmd(cmd)
File "/opt/plesk/python/2.7/lib/python2.7/ftplib.py", line 183, in putcmd
self.putline(line)
File "/opt/plesk/python/2.7/lib/python2.7/ftplib.py", line 178, in putline
self.sock.sendall(line)
File "/opt/plesk/python/2.7/lib/python2.7/ssl.py", line 741, in sendall
v = self.send(data[count:])
File "/opt/plesk/python/2.7/lib/python2.7/ssl.py", line 707, in send
v = self._sslobj.write(data)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa7' in position 7: ordinal not in range(128)
 
This can be caused by an invisible control character that was inserted at the beginning or the end of a file of the website you are trying to import. The correct solution is probably to find the file where the character is in (or the files) and to remove it, then migrate again. Remove: # tr -d '\xa7' < input_file.txt > output_file.txt. But a faster and easier solution is to zip the whole directory, copy it to the target and unzip it.
 
Back
Top