-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mike,

See if the attached patch fixes the problem.  This is an issue I caught in our 
production install but didn't get the fix pushed in to the code repository.

If you put the file in /tmp and then cd to the .ht-inc directory of your 
install, you can use the following command to apply the patch:

patch < /tmp/vmhostcheck_fix.patch

You don't need to restart anything after applying the patch.  utils.php is the 
only file it will modify.  It's always a good idea to make a backup copy of a 
file before applying a patch.

Josh

On Monday June 20, 2011, Waldron, Michael H wrote:
> It is 2.2.1.
> 
> I also just got this error email after the others:
> 
> Problem processing block allocation
> Block id = 2
> Block name = MarcusClass
> Block start time = 2011-06-20 14:45:00
> Block end time = 2011-06-20 17:15:00
> Environment name = Stata 11, WinXP (vmware)
> Allocated = 0
> Block requested = 16
> ------------------------------------------------------------------------
> time: 2011-06-20 08:45:42
> caller: blockrequest.pm:process(243)
> ( 0) blockrequest.pm, process (line: 243)
> (-1) vcld, make_new_child (line: 568)
> (-2) vcld, main (line: 448)
> ------------------------------------------------------------------------
> management node: bc15-n01.isis.unc.edu
> reservation PID: 19928
> parent vcld PID: 17094
> 
> blockrequest: MarcusClass
> block request ID: 2
> blockrequest image ID: 1022
> number of machines: 16
> owner ID: 3036
> management node ID: 1
> processing flag: 0
> mode: start
> blocktime ID: 2
> blocktime start: 2011-06-20 14:45:00
> blocktime end: 2011-06-20 17:15:00
> blocktime processed flag: 0
> ------------------------------------------------------------------------
> RECENT LOG ENTRIES FOR THIS PROCESS:
> 2011-06-20 08:45:19|19928|blockrequest|blockrequest.pm:process(212)|xmlrpc
> warning: allocated= 0 unallocated= 2011-06-20
> 08:45:24|19928|blockrequest|blockrequest.pm:process(192)|processing
> blocktime_id= 2 pass 4 2011-06-20
> 08:45:24|19928|blockrequest|utils.pm:xmlrpc_call(9105)|argument_string=
> XMLRPCprocessBlockTime 2 1
> 
> |19928|blockrequest| ---- WARNING ----
> |19928|blockrequest| 2011-06-20
> |08:45:25|19928|blockrequest|utils.pm:xmlrpc_call(9121)|fault occured:
> |19928|blockrequest| Response class = RPC::XML::fault
> |19928|blockrequest| Response type = fault
> |19928|blockrequest| Response string =
> |<fault><value><struct><member><name>faultString</name><value><string>Inte
> |rnal error while processing your method call. If the problem persists,
> |please email resea...@unc.edu for further assistance. In your email
> |message, please include the time you made the call, the user you
> |connected as, the method you called, and all passed in
> |arguments.</string></value></member><member><name>faultCode</name><value>
> |<int>1</int></value></member></struct></value></fault> 19928|blockrequest|
> |Response value = HASH(0x1bf00a00)
> |19928|blockrequest| ( 0) utils.pm, xmlrpc_call (line: 9121)
> |19928|blockrequest| (-1) blockrequest.pm, process_block_time (line: 373)
> |19928|blockrequest| (-2) blockrequest.pm, process (line: 193)
> |19928|blockrequest| (-3) vcld, make_new_child (line: 568)
> |19928|blockrequest| (-4) vcld, main (line: 448)
> |19928|blockrequest| ---- WARNING ----
> |19928|blockrequest| 2011-06-20
> |08:45:25|19928|blockrequest|blockrequest.pm:process_block_time(389)|retur
> |n argument XMLRPCprocessBlockTime was not a STRUCT as
> |expectedRPC::XML::fault 19928|blockrequest| ( 0) blockrequest.pm,
> |process_block_time (line: 389) 19928|blockrequest| (-1) blockrequest.pm,
> |process (line: 193)
> |19928|blockrequest| (-2) vcld, make_new_child (line: 568)
> |19928|blockrequest| (-3) vcld, main (line: 448)
> |19928|blockrequest| ---- WARNING ----
> |19928|blockrequest| 2011-06-20
> |08:45:25|19928|blockrequest|vcld:warning_handler(610)|Use of
> |uninitialized value in concatenation (.) or string at
> |/usr/local/vcl/bin/../lib/VCL/blockrequest.pm line 212.
> |19928|blockrequest| ( 0) vcld, warning_handler (line: 610)
> |19928|blockrequest| (-1) blockrequest.pm, process (line: 212)
> |19928|blockrequest| (-2) vcld, make_new_child (line: 568)
> |19928|blockrequest| (-3) vcld, main (line: 448)
> |19928|blockrequest| ---- WARNING ----
> |19928|blockrequest| 2011-06-20
> |08:45:25|19928|blockrequest|vcld:warning_handler(610)|Use of
> |uninitialized value in concatenation (.) or string at
> |/usr/local/vcl/bin/../lib/VCL/blockrequest.pm line 212.
> |19928|blockrequest| ( 0) vcld, warning_handler (line: 610)
> |19928|blockrequest| (-1) blockrequest.pm, process (line: 212)
> |19928|blockrequest| (-2) vcld, make_new_child (line: 568)
> |19928|blockrequest| (-3) vcld, main (line: 448)
> 
> 2011-06-20 08:45:25|19928|blockrequest|blockrequest.pm:process(212)|xmlrpc
> warning: allocated= 0 unallocated= 2011-06-20
> 08:45:30|19928|blockrequest|blockrequest.pm:process(192)|processing
> blocktime_id= 2 pass 5 2011-06-20
> 08:45:30|19928|blockrequest|utils.pm:xmlrpc_call(9105)|argument_string=
> XMLRPCprocessBlockTime 2 1
> 
> |19928|blockrequest| ---- WARNING ----
> |19928|blockrequest| 2011-06-20
> |08:45:30|19928|blockrequest|utils.pm:xmlrpc_call(9121)|fault occured:
> |19928|blockrequest| Response class = RPC::XML::fault
> |19928|blockrequest| Response type = fault
> |19928|blockrequest| Response string =
> |<fault><value><struct><member><name>faultString</name><value><string>Inte
> |rnal error while processing your method call. If the problem persists,
> |please email resea...@unc.edu for further assistance. In your email
> |message, please include the time you made the call, the user you
> |connected as, the method you called, and all passed in
> |arguments.</string></value></member><member><name>faultCode</name><value>
> |<int>1</int></value></member></struct></value></fault> 19928|blockrequest|
> |Response value = HASH(0x1bd21700)
> |19928|blockrequest| ( 0) utils.pm, xmlrpc_call (line: 9121)
> |19928|blockrequest| (-1) blockrequest.pm, process_block_time (line: 373)
> |19928|blockrequest| (-2) blockrequest.pm, process (line: 193)
> |19928|blockrequest| (-3) vcld, make_new_child (line: 568)
> |19928|blockrequest| (-4) vcld, main (line: 448)
> |19928|blockrequest| ---- WARNING ----
> |19928|blockrequest| 2011-06-20
> |08:45:30|19928|blockrequest|blockrequest.pm:process_block_time(389)|retur
> |n argument XMLRPCprocessBlockTime was not a STRUCT as
> |expectedRPC::XML::fault 19928|blockrequest| ( 0) blockrequest.pm,
> |process_block_time (line: 389) 19928|blockrequest| (-1) blockrequest.pm,
> |process (line: 193)
> |19928|blockrequest| (-2) vcld, make_new_child (line: 568)
> |19928|blockrequest| (-3) vcld, main (line: 448)
> |19928|blockrequest| ---- WARNING ----
> |19928|blockrequest| 2011-06-20
> |08:45:30|19928|blockrequest|vcld:warning_handler(610)|Use of
> |uninitialized value in concatenation (.) or string at
> |/usr/local/vcl/bin/../lib/VCL/blockrequest.pm line 212.
> |19928|blockrequest| ( 0) vcld, warning_handler (line: 610)
> |19928|blockrequest| (-1) blockrequest.pm, process (line: 212)
> |19928|blockrequest| (-2) vcld, make_new_child (line: 568)
> |19928|blockrequest| (-3) vcld, main (line: 448)
> |19928|blockrequest| ---- WARNING ----
> |19928|blockrequest| 2011-06-20
> |08:45:30|19928|blockrequest|vcld:warning_handler(610)|Use of
> |uninitialized value in concatenation (.) or string at
> |/usr/local/vcl/bin/../lib/VCL/blockrequest.pm line 212.
> |19928|blockrequest| ( 0) vcld, warning_handler (line: 610)
> |19928|blockrequest| (-1) blockrequest.pm, process (line: 212)
> |19928|blockrequest| (-2) vcld, make_new_child (line: 568)
> |19928|blockrequest| (-3) vcld, main (line: 448)
> 
> 2011-06-20 08:45:30|19928|blockrequest|blockrequest.pm:process(212)|xmlrpc
> warning: allocated= 0 unallocated= 2011-06-20
> 08:45:35|19928|blockrequest|blockrequest.pm:process(192)|processing
> blocktime_id= 2 pass 6 2011-06-20
> 08:45:35|19928|blockrequest|utils.pm:xmlrpc_call(9105)|argument_string=
> XMLRPCprocessBlockTime 2 1
> 
> |19928|blockrequest| ---- WARNING ----
> |19928|blockrequest| 2011-06-20
> |08:45:37|19928|blockrequest|utils.pm:xmlrpc_call(9121)|fault occured:
> |19928|blockrequest| Response class = RPC::XML::fault
> |19928|blockrequest| Response type = fault
> |19928|blockrequest| Response string =
> |<fault><value><struct><member><name>faultString</name><value><string>Inte
> |rnal error while processing your method call. If the problem persists,
> |please email resea...@unc.edu for further assistance. In your email
> |message, please include the time you made the call, the user you
> |connected as, the method you called, and all passed in
> |arguments.</string></value></member><member><name>faultCode</name><value>
> |<int>1</int></value></member></struct></value></fault> 19928|blockrequest|
> |Response value = HASH(0x1bd3cb20)
> |19928|blockrequest| ( 0) utils.pm, xmlrpc_call (line: 9121)
> |19928|blockrequest| (-1) blockrequest.pm, process_block_time (line: 373)
> |19928|blockrequest| (-2) blockrequest.pm, process (line: 193)
> |19928|blockrequest| (-3) vcld, make_new_child (line: 568)
> |19928|blockrequest| (-4) vcld, main (line: 448)
> |19928|blockrequest| ---- WARNING ----
> |19928|blockrequest| 2011-06-20
> |08:45:37|19928|blockrequest|blockrequest.pm:process_block_time(389)|retur
> |n argument XMLRPCprocessBlockTime was not a STRUCT as
> |expectedRPC::XML::fault 19928|blockrequest| ( 0) blockrequest.pm,
> |process_block_time (line: 389) 19928|blockrequest| (-1) blockrequest.pm,
> |process (line: 193)
> |19928|blockrequest| (-2) vcld, make_new_child (line: 568)
> |19928|blockrequest| (-3) vcld, main (line: 448)
> |19928|blockrequest| ---- WARNING ----
> |19928|blockrequest| 2011-06-20
> |08:45:37|19928|blockrequest|vcld:warning_handler(610)|Use of
> |uninitialized value in concatenation (.) or string at
> |/usr/local/vcl/bin/../lib/VCL/blockrequest.pm line 212.
> |19928|blockrequest| ( 0) vcld, warning_handler (line: 610)
> |19928|blockrequest| (-1) blockrequest.pm, process (line: 212)
> |19928|blockrequest| (-2) vcld, make_new_child (line: 568)
> |19928|blockrequest| (-3) vcld, main (line: 448)
> |19928|blockrequest| ---- WARNING ----
> |19928|blockrequest| 2011-06-20
> |08:45:37|19928|blockrequest|vcld:warning_handler(610)|Use of
> |uninitialized value in concatenation (.) or string at
> |/usr/local/vcl/bin/../lib/VCL/blockrequest.pm line 212.
> |19928|blockrequest| ( 0) vcld, warning_handler (line: 610)
> |19928|blockrequest| (-1) blockrequest.pm, process (line: 212)
> |19928|blockrequest| (-2) vcld, make_new_child (line: 568)
> |19928|blockrequest| (-3) vcld, main (line: 448)
> 
> 2011-06-20 08:45:37|19928|blockrequest|blockrequest.pm:process(212)|xmlrpc
> warning: allocated= 0 unallocated= 2011-06-20
> 08:45:42|19928|blockrequest|blockrequest.pm:process(197)|attempted 6
> passes to complete block_request 2
> 
> |19928|blockrequest| allocated= 0
> |19928|blockrequest| blockrequest_number_machines= 16
> 
> Mike Waldron
> Systems Specialist
> ITS Research Computing
> University of North Carolina at Chapel Hill
> CB #3420, ITS Manning, Rm 2509
> 919-962-9778
> ________________________________________
> From: Josh Thompson [josh_thomp...@ncsu.edu]
> Sent: Monday, June 20, 2011 9:30 AM
> To: vcl-user@incubator.apache.org
> Subject: Re: FW: Error with VCL XMLRPC call
> 
> - gpg control packet
> Mike,
> 
> What version of VCL do you have installed?
> 
> Josh
> 
> On Monday June 20, 2011, Waldron, Michael H wrote:
> > I have a block allocation setup for 16 machines. When it was processed
> > this morning, I received 6 emails identical to the one below with an
> > error about table VMhostCheck already existing. When I look in the
> > blockComputers table, there are 10 computers listed, so it appears it
> > reserved 10 out of the 16 machines, and the remaining 6 got this error.
> > 
> > Any ideas what the source of the problem could be?
> > 
> > 
> > Mike Waldron
> > Systems Specialist
> > ITS Research Computing
> > University of North Carolina at Chapel Hill
> > CB #3420, ITS Manning, Rm 2509
> > 919-962-9778
> > ________________________________________
> > From: mwald...@email.unc.edu [mwald...@email.unc.edu]
> > Sent: Monday, June 20, 2011 8:45 AM
> > To: Waldron, Michael H
> > Subject: Error with VCL XMLRPC call
> > 
> > Table 'VMhostCheck' already exists
> > 
> > CREATE TEMPORARY TABLE VMhostCheck ( RAM mediumint unsigned NOT NULL,
> > allocRAM mediumint unsigned NOT NULL, vmhostid smallint unsigned NOT NULL
> > ) ENGINE=MEMORY ERROR(101): General MySQL error
> > Logged in user was vclsystem
> > Mode was xmlrpccall
> > 
> > 
> > Backtrace:
> > =-=-=-=-=-=-=-=-=-=-=-=
> > Call#:1 => index.php:xmlrpccall() (line#:86)
> > Call#:2 => utils.php:xmlrpc_server_call_method() (line#:8355)
> > Call#:3 => unknown:xmlRPChandler() (line#:unknown)
> > Call#:4 => utils.php:call_user_func_array() (line#:8431)
> > Call#:5 => unknown:XMLRPCprocessBlockTime() (line#:unknown)
> > Call#:6 => xmlrpcWrappers.php:isAvailable() (line#:1081)
> > Call#:7 => utils.php:doQuery() (line#:3693)
> > Call#:8 => utils.php:abort() (line#:1044)
> > 
> > Backtrace with Arguments:
> > =-=-=-=-=-=-=-=-=-=-=-=
> > Call#:1 => index.php:xmlrpccall() (line#:86)
> > Arguments(none):
> > -----------------------
> > Call#:2 => utils.php:xmlrpc_server_call_method() (line#:8355)
> > Arguments(3)
> > 
> > Argument#: 1 => Resource id #26
> > Argument#: 2 => <?xml version="1.0"
> > encoding="us-ascii"?><methodCall><methodName>XMLRPCprocessBlockTime</meth
> > o
> > dName><params><param><value><int>2</int></value></param><param><value><i
> > nt> 1</int></value></param></params></methodCall> Argument#: 3 =>  (empty
> > string)
> > -----------------------
> > Call#:3 => unknown:xmlRPChandler() (line#:unknown)
> > Arguments(3)
> > 
> > Argument#: 1 => XMLRPCprocessBlockTime
> > Argument#: 2 => Array
> > (
> > 
> >     [0] => 2
> >     [1] => 1
> > 
> > )
> > 
> > Argument#: 3 =>  (empty string)
> > -----------------------
> > Call#:4 => utils.php:call_user_func_array() (line#:8431)
> > Arguments(2)
> > 
> > Argument#: 1 => XMLRPCprocessBlockTime
> > Argument#: 2 => Array
> > (
> > 
> >     [0] => 2
> >     [1] => 1
> > 
> > )
> > 
> > -----------------------
> > Call#:5 => unknown:XMLRPCprocessBlockTime() (line#:unknown)
> > Arguments(2)
> > 
> > Argument#: 1 => 2
> > Argument#: 2 => 1
> > -----------------------
> > Call#:6 => xmlrpcWrappers.php:isAvailable() (line#:1081)
> > Arguments(8)
> > 
> > Argument#: 1 => Array
> > (
> > 
> >     [1022] => Array
> >     
> >         (
> >         
> >             [id] => 1022
> >             [name] => vmwarewinxp-Stata11WinXPvmware1022-v5
> >             [prettyname] => Stata 11, WinXP (vmware)
> >             [ownerid] => 8
> >             [owner] => mwaldron@UNC
> >             [platformid] => 1
> >             [platform] => i386
> >             [osid] => 16
> >             [os] => vmwarewinxp
> >             [minram] => 1024
> >             [minprocnumber] => 1
> >             [minprocspeed] => 500
> >             [minnetwork] => 10
> >             [maxconcurrent] => 75
> >             [reloadtime] => 20
> >             [deleted] => 0
> >             [test] => 0
> >             [resourceid] => 1047
> >             [lastupdate] => 2011-02-01 09:13:44
> >             [forcheckout] => 1
> >             [maxinitialtime] => 0
> >             [imagemetaid] => 41
> >             [checkuser] => 0
> >             [rootaccess] => 1
> >             [usergroupid] =>
> >             [usergroup] =>
> >             [sysprep] => 0
> >             [subimages] => Array
> >             
> >                 (
> >                 )
> >             
> >             [imagerevision] => Array
> >             
> >                 (
> >                 
> >                     [831] => Array
> >                     
> >                         (
> >                         
> >                             [id] => 831
> >                             [revision] => 4
> >                             [userid] => 8
> >                             [user] => mwaldron@UNC
> >                             [datecreated] => 2010-12-28 10:13:28
> >                             [prettydate] => 12/28/10 10:13 AM
> >                             [production] => 0
> >                             [imagename] =>
> > 
> > vmwarewinxp-Stata11WinXPvmware1022-v4 )
> > 
> >                     [867] => Array
> >                     
> >                         (
> >                         
> >                             [id] => 867
> >                             [revision] => 5
> >                             [userid] => 8
> >                             [user] => mwaldron@UNC
> >                             [datecreated] => 2011-02-01 08:43:46
> >                             [prettydate] => 2/01/11 8:43 AM
> >                             [production] => 1
> >                             [imagename] =>
> > 
> > vmwarewinxp-Stata11WinXPvmware1022-v5 )
> > 
> >                 )
> >         
> >         )
> > 
> > )
> > 
> > Argument#: 2 => 1022
> > Argument#: 3 => 867
> > Argument#: 4 => 1308594448
> > Argument#: 5 => 1308604500
> > Argument#: 6 =>  (empty integer)
> > Argument#: 7 =>  (empty integer)
> > Argument#: 8 => 1
> > -----------------------
> > Call#:7 => utils.php:doQuery() (line#:3693)
> > Arguments(2)
> > 
> > Argument#: 1 => CREATE TEMPORARY TABLE VMhostCheck ( RAM mediumint
> > unsigned NOT NULL, allocRAM mediumint unsigned NOT NULL, vmhostid
> > smallint unsigned NOT NULL ) ENGINE=MEMORY Argument#: 2 => 101
> > -----------------------
> > Call#:8 => utils.php:abort() (line#:1044)
> > Arguments(2)
> > 
> > Argument#: 1 => 101
> > Argument#: 2 => CREATE TEMPORARY TABLE VMhostCheck ( RAM mediumint
> > unsigned NOT NULL, allocRAM mediumint unsigned NOT NULL, vmhostid
> > smallint unsigned NOT NULL ) ENGINE=MEMORY -----------------------
- -- 
- -------------------------------
Josh Thompson
VCL Developer
North Carolina State University

my GPG/PGP key can be found at pgp.mit.edu
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)

iEYEARECAAYFAk3/VnoACgkQV/LQcNdtPQO4BQCfaPdOK0gIW85JUQ/stw6waHaX
7WoAn2hM+wY2ZQeChCBDKKi0bNV+M8ZX
=0gUa
-----END PGP SIGNATURE-----
--- utils.php.orig	2011-06-20 10:05:57.526283574 -0400
+++ utils.php	2011-06-20 10:10:23.655283065 -0400
@@ -3497,6 +3497,7 @@
 		$requestData = getRequestInfo($requestid);
 	$startstamp = unixToDatetime($start);
 	$endstamp = unixToDatetime($end + 900);
+	$vmhostcheckdone = 0;
 	foreach($requestInfo["images"] as $key => $imageid) {
 		# check for max concurrent usage of image
 		if($images[$imageid]['maxconcurrent'] != NULL) {
@@ -3681,24 +3682,30 @@
 			#   available because they would already fit within the host's available
 			#   RAM
 
-			$query = "CREATE TEMPORARY TABLE VMhostCheck ( "
-			       .    "RAM mediumint unsigned NOT NULL, "
-			       .    "allocRAM mediumint unsigned NOT NULL, "
-			       .    "vmhostid smallint unsigned NOT NULL "
-			       . ") ENGINE=MEMORY";
-			doQuery($query, 101);
-
-			$query = "INSERT INTO VMhostCheck "
-			       . "SELECT c.RAM, "
-			       .        "SUM(i.minram), "
-			       .        "v.id "
-			       . "FROM vmhost v "
-			       . "LEFT JOIN computer c ON (v.computerid = c.id) "
-			       . "LEFT JOIN computer c2 ON (v.id = c2.vmhostid) "
-			       . "LEFT JOIN image i ON (c2.currentimageid = i.id) "
-			       . "WHERE c.stateid = 20 "
-			       . "GROUP BY c.id";
-			doQuery($query, 101);
+			if(! $vmhostcheckdone) {
+				$vmhostcheckdone = 1;
+				$query = "DROP TEMPORARY TABLE IF EXISTS VMhostCheck";
+				doQuery($query, 101);
+
+				$query = "CREATE TEMPORARY TABLE VMhostCheck ( "
+				       .    "RAM mediumint unsigned NOT NULL, "
+				       .    "allocRAM mediumint unsigned NOT NULL, "
+				       .    "vmhostid smallint unsigned NOT NULL "
+				       . ") ENGINE=MEMORY";
+				doQuery($query, 101);
+
+				$query = "INSERT INTO VMhostCheck "
+				       . "SELECT c.RAM, "
+				       .        "SUM(i.minram), "
+				       .        "v.id "
+				       . "FROM vmhost v "
+				       . "LEFT JOIN computer c ON (v.computerid = c.id) "
+				       . "LEFT JOIN computer c2 ON (v.id = c2.vmhostid) "
+				       . "LEFT JOIN image i ON (c2.currentimageid = i.id) "
+				       . "WHERE c.stateid = 20 "
+				       . "GROUP BY c.id";
+				doQuery($query, 101);
+			}
 
 			$inids = implode(',', $computerids);
 			// if want overbooking, modify the last part of the WHERE clause

Reply via email to