CyberPanel Community

cPanel restore: local variable 'cDBUser' referenced before assignment

th
thisjrodriguez #1

Hi,

I’m testing the control panel and when I try to restore an account I get this error:
Failed to retore databases from file /home/backup/backup-9.30.2019_13-26-52_creandolared.tar.gz, error message: local variable ‘cDBUser’ referenced before assignment.

2 replies
th
thisjrodriguez #2

Hello,

The reason for this seems to be that it had an empty database, was to eliminate it and run ok.

line 663 script
for inItems in data:
if inItems.find(‘GRANT ALL PRIVILEGES’) > -1 and inItems.find(‘localhost’) > -1 and inItems.find(’_test’) == -1:
cDBName = inItems.split(’`’)[1].replace(’\\’, ‘’)
logging.statusWriter(self.logFile, inItems, 1)
if cDBName == items.replace(’.sql’, ‘’):
cDBUser = inItems.split("’")[1]
message = ‘Database user for %s is %s.’ % (cDBName, cDBUser)
logging.statusWriter(self.logFile, message, 1)
if Databases.objects.filter(dbUser=cDBUser).count() > 0:
continue
break

ha
harikarki #3

Hi @thisjrodriguez How did you fix this problem. I have a same problem, I don’t know how to fix it. Thanks

Sign in to reply