Unknown column error entering New Reservation page

2011-05-19 Thread Douglas Dodson

Hello,

I'm a new VCL user/admin and am also a php rookie.  Any help is appreciated.

I have deployed VCL on a single server as part of a proof of concept 
evaluation.  I'm making steady progress, but have hit a wall with this 
error.  I have VMware Server 2.0.2 deployed under CentOS 5.6 and VCL 
2.2.1 with required components up and running.  I have created an image 
named VMwareCentOS56 and I believe that I have entered it and 
associated computers into the VCL database correctly.


However, when I attempt to navigate to the New Reservation option of 
the VCL web interface either as a normal user or and admin, I get the 
following dump Emailed to me and I get an AJAX error in my browser.  
This occurs immediately when I see the New Reservation page - I don't 
even have a chance to make any selections or changes:



Unknown column '2011-05-19 09:45:00' in 'where clause'

SELECT DISTINCT COUNT(rs.managementnodeid) AS count, rs.managementnodeid AS mnid FROM reservation rs, 
request rq WHERE rs.managementnodeid IN (1) AND rq.start  2011-05-19 09:45:00 AND 
rq.start  2011-05-19 10:45:00 GROUP BY rs.managementnodeid ORDER BY count
ERROR(101): General MySQL error
Logged in user was testxyz
Mode was AJupdateWaitTime


Backtrace:
=-=-=-=-=-=-=-=-=-=-=-=
Call#:1 =  index.php:AJupdateWaitTime() (line#:86)
Call#:2 =  requests.php:isAvailable() (line#:255)
Call#:3 =  utils.php:allocComputer() (line#:3738)
Call#:4 =  utils.php:findManagementNode() (line#:3828)
Call#:5 =  utils.php:doQuery() (line#:4313)

Backtrace with Arguments:
=-=-=-=-=-=-=-=-=-=-=-=
Call#:1 =  index.php:AJupdateWaitTime() (line#:86)
Arguments(none):
---
Call#:2 =  requests.php:isAvailable() (line#:255)
Arguments(5)

Argument#: 1 =  Array
(
 [4] =  Array
 (
 [id] =  4
 [name] =  noimage
 [prettyname] =  No Image
 [ownerid] =  1
 [owner] =  admin@Local
 [platformid] =  1
 [platform] =  i386
 [osid] =  2
 [os] =  sun4x_58
 [minram] =  0
 [minprocnumber] =  1
 [minprocspeed] =  0
 [minnetwork] =  10
 [maxconcurrent] =
 [reloadtime] =  0
 [deleted] =  0
 [test] =  0
 [resourceid] =  4
 [lastupdate] =
 [forcheckout] =  0
 [maxinitialtime] =  0
 [imagemetaid] =
 [imagerevision] =  Array
 (
 [4] =  Array
 (
 [id] =  4
 [revision] =  0
 [userid] =  1
 [user] =  admin@Local
 [datecreated] =  1980-01-01 00:00:00
 [prettydate] =  1/01/80 12:00 AM
 [production] =  1
 [imagename] =  noimage
 )

 )

 )

 [19] =  Array
 (
 [id] =  19
 [name] =  vmwarelinux-VMwareCentOS5619-v0
 [prettyname] =  VMwareCentOS56
 [ownerid] =  1
 [owner] =  admin@Local
 [platformid] =  1
 [platform] =  i386
 [osid] =  36
 [os] =  vmwarelinux
 [minram] =  1024
 [minprocnumber] =  1
 [minprocspeed] =  1000
 [minnetwork] =  100
 [maxconcurrent] =
 [reloadtime] =  10
 [deleted] =  0
 [test] =  0
 [resourceid] =  32
 [lastupdate] =  2011-05-16 14:55:13
 [forcheckout] =  1
 [maxinitialtime] =  0
 [imagemetaid] =
 [imagerevision] =  Array
 (
 [17] =  Array
 (
 [id] =  17
 [revision] =  0
 [userid] =  1
 [user] =  admin@Local
 [datecreated] =  2011-05-16 14:55:13
 [prettydate] =  5/16/11 2:55 PM
 [production] =  1
 [imagename] =  vmwarelinux-VMwareCentOS5619-v0
 )

 )

 )

)

Argument#: 2 =  19
Argument#: 3 =  17
Argument#: 4 =  1305814500
Argument#: 5 =  1305819000
---
Call#:3 =  utils.php:allocComputer() (line#:3738)
Arguments(5)

Argument#: 1 =   (empty array)
Argument#: 2 =   (empty array)
Argument#: 3 =  Array
(
 [0] =  2
 [1] =  3
 [2] =  4
 [3] =  5
 [4] =  6
 [5] =  7
 [6] =  8
 [7] =  9
)

Argument#: 4 =  2011-05-19 10:15:00
Argument#: 5 =  now
---
Call#:4 =  utils.php:findManagementNode() (line#:3828)
Arguments(3)

Argument#: 1 =  2
Argument#: 2 =  2011-05-19 10:15:00

Re: Unknown column error entering New Reservation page

2011-05-19 Thread Josh Thompson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Doug,

That's a strange one.  I don't see anything wrong with the SQL statement it 
gives.  The only thing I can think of is that you have a more recent version 
of mysql than I've ever used, and it doesn't like the double quotes ().

Try running the sql statement from the mysql command line.  In case you're 
also new to mysql, here are the steps to test it:

Run 'mysql' to start the command line interface.
Then, at the prompt, enter 'use vcl'.
Next, type

SELECT DISTINCT COUNT(rs.managementnodeid) AS count, rs.managementnodeid
AS mnid FROM reservation rs, request rq WHERE rs.managementnodeid IN (1)
AND rq.start  2011-05-19 09:45:00 AND rq.start  
2011-05-19 10:45:00 GROUP BY rs.managementnodeid ORDER BY count;

If it gives you the same error, try it again, but replace the double quotes 
() with single quotes (').

As a side note, there is a bug in that SQL statement because there is no 
conditional to join the two tables together.  However, it won't cause any 
undesired results if you only have one management node.

Josh

On Thursday May 19, 2011, Douglas Dodson wrote:
 Hello,
 
 I'm a new VCL user/admin and am also a php rookie.  Any help is
 appreciated.
 
 I have deployed VCL on a single server as part of a proof of concept
 evaluation.  I'm making steady progress, but have hit a wall with this
 error.  I have VMware Server 2.0.2 deployed under CentOS 5.6 and VCL
 2.2.1 with required components up and running.  I have created an image
 named VMwareCentOS56 and I believe that I have entered it and
 associated computers into the VCL database correctly.
 
 However, when I attempt to navigate to the New Reservation option of
 the VCL web interface either as a normal user or and admin, I get the
 following dump Emailed to me and I get an AJAX error in my browser.
 This occurs immediately when I see the New Reservation page - I don't
 
 even have a chance to make any selections or changes:
  Unknown column '2011-05-19 09:45:00' in 'where clause'
  
  SELECT DISTINCT COUNT(rs.managementnodeid) AS count, rs.managementnodeid
  AS mnid FROM reservation rs, request rq WHERE rs.managementnodeid IN (1)
  AND rq.start  2011-05-19 09:45:00 AND rq.start  2011-05-19
  10:45:00 GROUP BY rs.managementnodeid ORDER BY count ERROR(101):
  General MySQL error
  Logged in user was testxyz
  Mode was AJupdateWaitTime
  
  
  Backtrace:
  =-=-=-=-=-=-=-=-=-=-=-=
  Call#:1 =  index.php:AJupdateWaitTime() (line#:86)
  Call#:2 =  requests.php:isAvailable() (line#:255)
  Call#:3 =  utils.php:allocComputer() (line#:3738)
  Call#:4 =  utils.php:findManagementNode() (line#:3828)
  Call#:5 =  utils.php:doQuery() (line#:4313)
  
  Backtrace with Arguments:
  =-=-=-=-=-=-=-=-=-=-=-=
  Call#:1 =  index.php:AJupdateWaitTime() (line#:86)
  Arguments(none):
  ---
  Call#:2 =  requests.php:isAvailable() (line#:255)
  Arguments(5)
  
  Argument#: 1 =  Array
  (
  
   [4] =  Array
   
   (
   
   [id] =  4
   [name] =  noimage
   [prettyname] =  No Image
   [ownerid] =  1
   [owner] =  admin@Local
   [platformid] =  1
   [platform] =  i386
   [osid] =  2
   [os] =  sun4x_58
   [minram] =  0
   [minprocnumber] =  1
   [minprocspeed] =  0
   [minnetwork] =  10
   [maxconcurrent] =
   [reloadtime] =  0
   [deleted] =  0
   [test] =  0
   [resourceid] =  4
   [lastupdate] =
   [forcheckout] =  0
   [maxinitialtime] =  0
   [imagemetaid] =
   [imagerevision] =  Array
   
   (
   
   [4] =  Array
   
   (
   
   [id] =  4
   [revision] =  0
   [userid] =  1
   [user] =  admin@Local
   [datecreated] =  1980-01-01 00:00:00
   [prettydate] =  1/01/80 12:00 AM
   [production] =  1
   [imagename] =  noimage
   
   )
   
   )
   
   )
   
   [19] =  Array
   
   (
   
   [id] =  19
   [name] =  vmwarelinux-VMwareCentOS5619-v0
   [prettyname] =  VMwareCentOS56
   [ownerid] =  1
   [owner] =  admin@Local
   [platformid] =  1
   [platform] =  i386
   [osid] =  36
   [os] =  vmwarelinux
   [minram] =  1024
   [minprocnumber] =  1
   [minprocspeed] =  1000
   [minnetwork] =