[storm] more about my little problem with relations ( i think )
shawn bright
nephish at gmail.com
Tue Aug 7 15:38:02 BST 2007
I don't know, could be something else.
this is what i get in the debug lines of what goes haywire.
update v-sensor values
create the data hit
UPDATE volt_sensors SET last_report=%s, last_value=%s, last_raw=%s WHERE
volt_sensors.id = %s (datetime.datetime(2007, 8, 7, 9, 32, 48, 125063),
13.17934, 899.0, 3116)
INSERT INTO volt_sensors (date_time, raw, value, volt_sensor_id) VALUES (%s,
%s, %s, %s) (datetime.datetime(2007, 8, 7, 9, 32, 48, 125426), 899.0,
13.17934, 3116)
Exception in thread Thread-5:
Traceback (most recent call last):
File "threading.py", line 442, in __bootstrap
self.run()
File "/home/piv/forge/main/orbcomm_input_email.py", line 570, in run
self.process_flow_meter(monitor, raw)
File "/home/piv/forge/main/orbcomm_input_email.py", line 166, in
process_flow_meter
FlowSensor.monitor == unicode(monitor)).one()
File "/usr/lib/python2.4/site-packages/storm-0.9-py2.4.egg/storm/store.py",
line 133, in find
File "/usr/lib/python2.4/site-packages/storm-0.9-py2.4.egg/storm/store.py",
line 274, in flush
File "/usr/lib/python2.4/site-packages/storm-0.9-py2.4.egg/storm/store.py",
line 313, in _flush_one
File "/usr/lib/python2.4/site-packages/storm-0.9-py2.4.egg/storm/database.py",
line 136, in execute
File "/usr/lib/python2.4/site-packages/storm-0.9-py2.4.egg/storm/database.py",
line 125, in _raw_execute
File "/usr/lib/python2.4/site-packages/MySQLdb/cursors.py", line 163, in
execute
self.errorhandler(self, exc, value)
File "/usr/lib/python2.4/site-packages/MySQLdb/connections.py", line 35,
in defaulterrorhandler
raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'date_time' in 'field list'")
# update volt sensor
print 'update v-sensor values'
volt_sensor.last_raw = raw
volt_sensor.last_value = value
volt_sensor.last_report = datetime.datetime.now()
print 'create the data hit'
hit = VoltageHit(volt_sensor.id, raw, value)
self.store.add(hit)
and here are the two classes
class VoltSensor(Storm):
__storm_table__ = "volt_sensors"
id = Int(primary=True, default = AutoReload)
adder, multiplier = Float(), Float()
last_value, last_raw, highest_value = Float(), Float(), Float()
monitor = Unicode()
last_report = DateTime()
#voltage_hits = ReferenceSet(id, "VoltageHit.volt_sensor_id")
class VoltageHit(Storm):
__storm_table__ = "volt_sensors"
id = Int(primary = True)
volt_sensor_id = Int()
raw, value = Float(), Float()
date_time = DateTime()
def __init__(self, volt_sensor_id, raw, value):
self.volt_sensor_id = volt_sensor_id
self.raw = raw
self.value = value
self.date_time = datetime.datetime.now()
it looks like this actually happens in a different function.
I think that it fails when it reaches the commit / insert / update point
thanks for any tips
shawn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/storm/attachments/20070807/150ef393/attachment.htm
More information about the storm
mailing list