ispCP - Board - Support
Can't use string ("") as an ARRAY ref... - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Support Area (/forum-30.html)
+--- Forum: Update/Upgrade (/forum-44.html)
+--- Thread: Can't use string ("") as an ARRAY ref... (/thread-7376.html)



Can't use string ("") as an ARRAY ref... - Norri - 08-03-2009 05:38 PM

Hi there Smile

I've upgraded from VHCS 4.7.1 to ispCP 1.0.0 and everything seems to have gone well except none of my email works and all my subdomain statuses are still set to 'change'.

If I update my domain status to 'change' and then run ispcp-rqst-mngr, I get this error:

Can't use string ("") as an ARRAY ref while "strict refs" in use at /var/www/ispcp/engine/ispcp-rqst-mngr line 190.

Please help! I have no idea where to begin looking to fix this.

PS: I had a few problems running the ispcp-update (during the database part) but I then commented out a number of ALTER statements until it worked. THEN I went back and re-ran all those ALTERS to ensure the correct modifications were done to the database. So I think the database is okay but maybe not.
I'm not much of a Perl programmer but I am a good PHP coder so I added this code to see what's inside those variables:

Code:
use Data::Dumper;
print Dumper $rs;
print Dumper $rdata;
exit;

I added it after this:

Code:
$sql = "select mail_id, mail_acc, status from mail_users where status != 'ok' and status != 'ordered' order by mail_id";
  ($rs, $rdata) = doSQL($sql);

And got this:

Code:
$VAR1 = -1;
$VAR1 = '';

The weird thing is that SAME sql query results in over 20 rows from the mail_users table. So I know it's not empty an, in any case, if it was empty, the second variable above should be 0, not "".

So what do I do now? I really need to get this working soon!


RE: Can't use string ("") as an ARRAY ref... - Norri - 08-03-2009 06:40 PM

Okay, I got a bit further and it doesn't seem to be an ispCP issue after all!

I added:

Code:
warn $main::db->errstr;

before:

Code:
push_el(\@main::el, 'doSQL()', 'ERROR: Incorrect SQL Query -> '.$main::db -> errstr);

in ispcp_common_methods.pl and got:
MySQL server has gone away at /var/www/ispcp/engine/ispcp_common_methods.pl line 295.

Any advice on how to fix this? I don't know much about MySQL :/
I upped the MySQL timeout in my.cnf (after reading this) and it's working! Smile

Hope this helps someone else out there! What a small silly issue and definitely NOT ispCP's fault!


RE: Can't use string ("") as an ARRAY ref... - joximu - 08-04-2009 07:34 AM

Great - a self-helper... :-)

Would be good to add this somewhere to the wiki...

/J