[Spacewalk-list] Spacewalk 1.2 and postgresql sql syntax error

Michal Bruncko michal.bruncko at zssos.sk
Wed Dec 1 20:26:57 UTC 2010


Hello,

I'am receiving in periodical intervals following RHN Traceback about sql 
syntax error.
I am using spacewalk 1.2 with posgresql db on fedora13. the problem 
seems lies in 
/usr/lib/python2.6/site-packages/spacewalk/server/rhnVirtualization.py 
but I do no what is wrong with that piece of SQL code.
Can anybody helps me with this?

thanks

-----------------------------------------------------------------------
Exception reported from spacewalk.example.org
Time: Wed Dec  1 21:00:01 2010
Exception type <class 
'spacewalk.server.rhnSQL.sql_base.SQLStatementPrepareError'>
Exception while handling function registration.virt_notify
Request object information:
URI: /XMLRPC
Remote Host: zeus.example.org
Server Name: spacewalk.example.org:80
Headers passed in:
	Accept-Encoding: identity
	CONTENT_LENGTH: 7417
	CONTENT_TYPE: text/xml
	DOCUMENT_ROOT: /var/www/html
	GATEWAY_INTERFACE: CGI/1.1
	HTTP_ACCEPT_ENCODING: identity
	HTTP_HOST: spacewalk.example.org
	HTTP_USER_AGENT: rhn.rpclib.py/$Revision$
	HTTP_X_CLIENT_VERSION: 1
	HTTP_X_INFO: RPC Processor (C) Red Hat, Inc (version $Revision$)
	HTTP_X_RHN_CLIENT_CAPABILITY: 
osad.ping(1)=1,packages.verifyAll(1)=1,packages.verify(1)=1,packages.extended_profile(2)=1,osad.rhn_check(1)=1,configfiles.base64_enc(1)=1,reboot.reboot(1)=1,configfiles.deploy(1)=1,caneatCheese(1)=1,packages.rollBack(1)=1,configfiles.mtime_upload(1)=1,configfiles.diff(1)=1,packages.update(2)=2,script.run(1)=1,configfiles.upload(1)=1,packages.runTransaction(1)=1
	HTTP_X_RHN_TRANSPORT_CAPABILITY: follow-redirects=3
	HTTP_X_TRANSPORT_INFO: Extended Capabilities Transport (C) Red Hat, Inc 
(version $Revision$)
	HTTP_X_UP2DATE_VERSION: 1.1.15-1.fc13
	Host: spacewalk.example.org
	NLS_LANG: english.AL32UTF8
	ORACLE_HOME: /opt/oracle
	PATH_INFO:
	QUERY_STRING:
	REMOTE_ADDR: 172.30.0.30
	REMOTE_PORT: 54284
	REQUEST_METHOD: POST
	REQUEST_URI: /XMLRPC
	SCRIPT_FILENAME: /usr/share/rhn/wsgi/xmlrpc.py
	SCRIPT_NAME: /XMLRPC
	SCRIPT_URI: http://spacewalk.example.org/XMLRPC
	SCRIPT_URL: /XMLRPC
	SERVER_ADDR: 172.30.0.55
	SERVER_ADMIN: root at localhost
	SERVER_NAME: spacewalk.example.org
	SERVER_PORT: 80
	SERVER_PROTOCOL: HTTP/1.1
	SERVER_SIGNATURE: <address>Apache Server at spacewalk.example.org Port 
80</address>

	SERVER_SOFTWARE: Apache
	User-Agent: rhn.rpclib.py/$Revision$
	X-Client-Version: 1
	X-Info: RPC Processor (C) Red Hat, Inc (version $Revision$)
	X-RHN-Client-Capability: 
osad.ping(1)=1,packages.verifyAll(1)=1,packages.verify(1)=1,packages.extended_profile(2)=1,osad.rhn_check(1)=1,configfiles.base64_enc(1)=1,reboot.reboot(1)=1,configfiles.deploy(1)=1,caneatCheese(1)=1,packages.rollBack(1)=1,configfiles.mtime_upload(1)=1,configfiles.diff(1)=1,packages.update(2)=2,script.run(1)=1,configfiles.upload(1)=1,packages.runTransaction(1)=1
	X-RHN-Transport-Capability: follow-redirects=3
	X-Transport-Info: Extended Capabilities Transport (C) Red Hat, Inc 
(version $Revision$)
	X-Up2Date-Version: 1.1.15-1.fc13
	mod_wsgi.application_group: aphrodite.example.org|/xmlrpc
	mod_wsgi.callable_object: application
	mod_wsgi.handler_script:
	mod_wsgi.input_chunked: 0
	mod_wsgi.listener_host:
	mod_wsgi.listener_port: 80
	mod_wsgi.process_group:
	mod_wsgi.request_handler: wsgi-script
	mod_wsgi.script_reloading: 1
	mod_wsgi.version: (3, 1)
	wsgi.errors: <mod_wsgi.Log object at 0x7ffc3a9de2b0>
	wsgi.file_wrapper: <built-in method file_wrapper of mod_wsgi.Adapter 
object at 0x7ffc3a907918>
	wsgi.input: <mod_wsgi.Input object at 0x7ffc3ac7aef0>
	wsgi.multiprocess: True
	wsgi.multithread: False
	wsgi.run_once: False
	wsgi.url_scheme: http
	wsgi.version: (1, 1)
Extra information about this error:
SQL Error generated: ('syntax error at or near "name"\nLINE 8: 
        rvii.name             name,\n 
            ^\n', 0, '\n            SELECT\n                rvi.id 
           rvi_id,\n                rvi.host_system_id 
host_system_id,\n                rvi.virtual_system_id 
virtual_system_id,\n                rvi.confirmed         confirmed,\n 
               rvit.label            instance_type,\n 
rvii.name             name,\n                rvii.memory_size_k 
memory_size_k,\n                rvii.instance_id      instance_id,\n 
             rvii.vcpus            vcpus,\n                rvis.label 
          state\n            FROM\n 
rhnVirtualInstanceInfo rvii,\n                rhnVirtualInstanceType 
rvit,\n                rhnVirtualInstanceState rvis,\n 
rhnVirtualInstance rvi\n            WHERE\n 
((rvi.uuid=%(uuid)s and\n                  NOT EXISTS (SELECT 1\n
                                 FROM rhnServer host_system,\n 
                            rhnServer matching_uuid_system\n 
                    WHERE matching_uuid_system.id = 
rvi.virtual_system_id\n                                 AND 
host_system.id = %(host_id)s\n                                 AND 
host_system.org_id != matching_uuid_system.org_id)) or\n 
  (%(uuid)s is null and \n                      rvi.uuid is null and \n 
                      rvi.host_system_id=%(host_id)s)) and\n 
     rvi.id = rvii.instance_id and\n                rvit.id = 
rvii.instance_type and\n                rvis.id = rvii.state\n        ')

Exception Handler Information
Traceback (most recent call last):
   File 
"/usr/lib/python2.6/site-packages/spacewalk/server/apacheRequest.py", 
line 118, in call_function
     response = apply(func, params)
   File "/usr/share/rhn/server/handlers/xmlrpc/registration.py", line 
950, in virt_notify
     rhnVirtualization._virt_notify(server_id, actions)
   File 
"/usr/lib/python2.6/site-packages/spacewalk/server/rhnVirtualization.py", line 
811, in _virt_notify
     handler.handle(server_id, action)
   File 
"/usr/lib/python2.6/site-packages/spacewalk/server/rhnVirtualization.py", line 
210, in handle
     handler(system_id, timestamp, properties)
   File 
"/usr/lib/python2.6/site-packages/spacewalk/server/rhnVirtualization.py", line 
240, in _handle_domain_exists
     row = self.__db_get_domain(system_id, uuid)
   File 
"/usr/lib/python2.6/site-packages/spacewalk/server/rhnVirtualization.py", line 
519, in __db_get_domain
     query.execute(host_id = host_id, uuid = uuid)
   File 
"/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/sql_base.py", 
line 166, in execute
     return apply(self._execute_wrapper, (self._execute, ) + p, kw)
   File 
"/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py", 
line 262, in _execute_wrapper
     raise rhnSQL.SQLStatementPrepareError(0, str(e), self.sql)
SQLStatementPrepareError: ('syntax error at or near "name"\nLINE 8: 
             rvii.name             name,\n 
                 ^\n', 0, '\n            SELECT\n                rvi.id 
                rvi_id,\n                rvi.host_system_id 
host_system_id,\n                rvi.virtual_system_id 
virtual_system_id,\n                rvi.confirmed         confirmed,\n 
               rvit.label            instance_type,\n 
rvii.name             name,\n                rvii.memory_size_k 
memory_size_k,\n                rvii.instance_id      instance_id,\n 
             rvii.vcpus            vcpus,\n                rvis.label 
          state\n            FROM\n 
rhnVirtualInstanceInfo rvii,\n                rhnVirtualInstanceType 
rvit,\n                rhnVirtualInstanceState rvis,\n 
rhnVirtualInstance rvi\n            WHERE\n 
((rvi.uuid=%(uuid)s and\n                  NOT EXISTS (SELECT
   1\n                                FROM rhnServer host_system,\n 
                                 rhnServer matching_uuid_system\n 
                         WHERE matching_uuid_system.id = 
rvi.virtual_system_id\n                                 AND 
host_system.id = %(host_id)s\n                                 AND 
host_system.org_id != matching_uuid_system.org_id)) or\n 
  (%(uuid)s is null and \n                      rvi.uuid is null and \n 
                      rvi.host_system_id=%(host_id)s)) and\n 
     rvi.id = rvii.instance_id and\n                rvit.id = 
rvii.instance_type and\n                rvis.id = rvii.state\n        ')

Local variables by frame
Frame _execute_wrapper in 
/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py 
at line 262
	            function = <type 'instancemethod'> <bound method 
Cursor._execute of <spacewalk.server.rhnSQL.driver_postgresql.Cursor 
instance at 0x7ffc3b1e8fc8>>
	                   e = <class 'psycopg2.ProgrammingError'> syntax error 
at or near "name"
LINE 8:                 rvii.name             name,
                                               ^

	                self = <type 'instance'> 
<spacewalk.server.rhnSQL.driver_postgresql.Cursor instance at 
0x7ffc3b1e8fc8>
	               value = <type 'str'> 1fcccc1a6e4f3c7c9780f6517fbfff2f
	                   p = <type 'tuple'> ()
	                  kw = <type 'dict'> {'host_id': 1000010003, 'uuid': 
'1fcccc1a6e4f3c7c9780f6517fbfff2f'}
	                 key = <type 'str'> uuid
	              params = <type 'str'> host_id: 1000010003,uuid: 
1fcccc1a6e4f3c7c9780f6517fbfff2f

Frame execute in 
/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/sql_base.py at 
line 166
	                   p = <type 'tuple'> ()
	                self = <type 'instance'> 
<spacewalk.server.rhnSQL.driver_postgresql.Cursor instance at 
0x7ffc3b1e8fc8>
	                  kw = <type 'dict'> {'host_id': 1000010003, 'uuid': 
'1fcccc1a6e4f3c7c9780f6517fbfff2f'}

Frame __db_get_domain in 
/usr/lib/python2.6/site-packages/spacewalk/server/rhnVirtualization.py 
at line 519
	               query = <type 'instance'> 
<spacewalk.server.rhnSQL.driver_postgresql.Cursor instance at 
0x7ffc3b1e8fc8>
	                self = <type 'instance'> 
<spacewalk.server.rhnVirtualization.VirtualizationEventHandler instance 
at 0x7ffc3b250320>
	                uuid = <type 'str'> 1fcccc1a6e4f3c7c9780f6517fbfff2f
	             host_id = <type 'int'> 1000010003
	          select_sql = <type 'str'>
             SELECT
                 rvi.id                rvi_id,
                 rvi.host_system_id    host_system_id,
                 rvi.virtual_system_id virtual_system_id,
                 rvi.confirmed         confirmed,
                 rvit.label            instance_type,
                 rvii.name             name,
                 rvii.memory_size_k    memory_size_k,
                 rvii.instance_id      instance_id,
                 rvii.vcpus            vcpus,
                 rvis.label            state
             FROM
                 rhnVirtualInstanceInfo rvii,
                 rhnVirtualInstanceType rvit,
                 rhnVirtualInstanceState rvis,
                 rhnVirtualInstance rvi
             WHERE
                 ((rvi.uuid=:uuid and
                   NOT EXISTS (SELECT 1
                                 FROM rhnServer host_system,
                                      rhnServer matching_uuid_system
                                WHERE matching_uuid_system.id = 
rvi.virtual_system_id
                                  AND host_system.id = :host_id
                                  AND host_system.org_id != 
matching_uuid_system.org_id)) or
                  (:uuid is null and
                       rvi.uuid is null and
                       rvi.host_system_id=:host_id)) and
                 rvi.id = rvii.instance_id and
                 rvit.id = rvii.instance_type and
                 rvis.id = rvii.state
----------------------------------------------------------------------- 


-- 
Ing. Michal Bruncko, CCNP
Linux systems and network administrator

Coupled school of business and services Ruzomberok
Slovak Republic




More information about the Spacewalk-list mailing list