error message: local variable 'zone' referenced before assignment

Provider: Hetzner

Virtualization Type: KVM (cloud server model cx21)

System: CentOS Linux release 7.9.2009 (Core)

Installation option:

OLS or Enterprise?
OLS

Installing from official server or mirror server?
official
sh <(curl https://cyberpanel.net/install.sh || wget -O - https://cyberpanel.net/install.sh)

Install Memcached extension for PHP?
no

Install LiteSpeed Memcached?
no

Install Memcached?
no

Install Redis extension for PHP?
no

Install Redis?
no

Problem:

Hi:

cPanel importer not working.

step to reproduce:
1._ /scripts/pkgacct example (it from cpanel server)
2._ transfer cpmove-example.tar.gz from cpanel server to cyberpanel server by rsync
3._ create a folder in root folder with name michael and move cpmove-example.tar.gz to this
4._ run /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/cPanelImporter.py --path /michael

log /home/cyberpanel/7922
Extracting main cPanel archive file: /michael/cpmove-example.tar.gz
/michael/cpmove-example.tar.gz successfully extracted.
Creating main account from archive file: /michael/cpmove-example.tar.gz
Detected main domain for this file is: example.com.
Finding PHP version for example.com.
PHP version of example.com is PHP 7.4.
Finding Server Admin email for example.com.
Server Admin email for ejemplo.com is [email protected].
Calling core to create example.com.
Websites matching query does not exist.
Successfully created example.com from core.
Detecting SSL for examplecom.
SSL found for example, setting up.
SSL set up OK for example.com.
Restoring document root files for example.com.
Main site ejemplo.com created from archive file: /michael/cpmove-example.tar.gz
Creating child domains from archive file: /michael/cpmove-example.tar.gz
Finding Addon/Subdomains from backup file /michael/cpmove-example.tar.gz. Account main domain was example.com.
Following Addon/Subdomains found for backup file /michael/cpmove-example.tar.gz. Account main domain was example.com.
Starting Addon/Subdomains creation from backup file /michael/cpmove-example.tar.gz. Account main domain was example.com.
We are going to create DNS records now, please note we will not create DKIM records. Make sure to create them from CyberPanel interface using our DKIM manager.
Creating DNS records for example.com
Failed to create DNS records from file /michael/cpmove-example.tar.gz, error message: local variable ‘zone’ referenced before assignment.

can you please give some clues to solve this? thanks in advance.

best regards

I face the same error when import form cPanel full backup.

Can you share your details? Like cPanel version? How you generated that file etc?

I’ve discovered that I need to create a dns zone first so that the import doesn’t fail.

I’ve created and restored backups from cPanel v100.0.4.

Can you private message me with your cPanel login details. I will have to check the cPanel dump file.

1 Like

Yes sure, check my pm :slight_smile:

How do you solve it?

  • I delete the failed created websites ( I ran couple of backups )

Then on dns/createDNSZone I added the domain for the sites i want to migrate.

site1.com && site2.com

But still the same error:

Failed to create DNS records from file /mybackups/backup-11.29.2021_05-53-24_site1.tar.gz, error message: local variable ‘zone’ referenced before assignment.
Failed to create DNS records from file /mybackups/backup-11.30.2021_21-07-43_site2.tar.gz, error message: local variable ‘zone’ referenced before assignment.

It is a clean instalation there is 0 sites in the box.

Provider: Contabo
System: Ubuntu 20.04 (64 Bit)
Installation option:
OLS or Enterprise?
OLS

Installing from official server or mirror server?
official script

Install Memcached extension for PHP?
Y
Install LiteSpeed Memcached?
Y
Install Memcached?
Y
Install Redis extension for PHP?
Y
Install Redis?
Y

1 Like

@Dsousa can you send me the backup file via google drive? Because last time someone sent me a cPanel login and it didnt work.

So I tested on my instance and it works.

1 Like

@usmannasir Sure, can you pm me so i can send the link privately.

Thanks

@usmannasir How can I share the backup link?

Kindly send me a link in message.

@usmannasir Have you downloaded it?

Resolved it here → bug fix: https://community.cyberpanel.net/t/error-message-local-varia… · usmannasir/cyberpanel@f038ea2 · GitHub

Now use this guide and upgrade CyberPanel → 02 - Upgrading CyberPanel

Let me know if that fixes your issue.

1 Like

@usmannasir I am very glad :slight_smile: to confirm that It does the restore. :white_check_mark:

But new problem found:

@usmannasir Found the issue. I deleted the sites and run again the migration and I found that the DNS records was not created.

Do you see the files are restored in public_html of the site ?

Yes, files were successfully restored.

Did you install CyberPanel without DNS support?

I did install with DNS support, could the update change that?

How can I validate

I think the DNS file generated by cPanel created an issue. If you host your dns for now on Cloudflare that would do the trick. Checking this may take some time. I will revert to you.

1 Like