java.sql.SQLException: Could not perform raw query for SELECT sensorVariableId, MIN(min) AS min, MAX(max) AS max, SUM(avg*samples)/SUM(samples) AS avg, SUM(samples) AS samples, 1484940146167 AS timestamp FROM metrics_double_type_device WHERE sensorVariableId=2,827 AND timestamp > 1484940086167 AND timestamp <= 1484940146167 GROUP BY sensorVariableId

GitHub | Redferne | 2 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    GitHub comment 305#274158198

    GitHub | 2 months ago | Redferne
    java.sql.SQLException: Could not perform raw query for SELECT sensorVariableId, MIN(min) AS min, MAX(max) AS max, SUM(avg*samples)/SUM(samples) AS avg, SUM(samples) AS samples, 1484940146167 AS timestamp FROM metrics_double_type_device WHERE sensorVariableId=2,827 AND timestamp > 1484940086167 AND timestamp <= 1484940146167 GROUP BY sensorVariableId
  2. 0

    constraint primary index

    GitHub | 7 months ago | cimba007
    java.sql.SQLException: Unable to run insert stmt on object MetricsDoubleTypeDevice(sensorVariable=SensorVariable(id=46, sensor=Sensor(id=35, sensorId=0, type=S_LIGHT_LEVEL, name=Photoresistor GL5549 (v4), lastSeen=1471356147821, node=Node(id=12, eui=11, gatewayTable=GatewayTable(id=1, enabled=true, name=mosquitto, networkType=MY_SENSORS, timestamp=1470659030270, state=UP, statusMessage=Connected Successfully, statusSince=1471002435640, type=MQTT, properties={p=, u=, bh=tcp://localhost:1883, tp=mysensors-in, cid=mycontroller-mqtt-client, ts=mysensors-out}), name=LightClass_Test, version=Aug 15 2016 | 19:01:30, type=S_ARDUINO_NODE, libVersion=null, batteryLevel=100, eraseConfig=null, firmware=null, state=UP, lastSeen=1471356147804, rssi=null, properties={}, parentNodeEui=null, registrationState=REGISTERED), room=null, variableTypes=[Light level]), variableType=V_LIGHT_LEVEL, metricType=DOUBLE, timestamp=1471356147829, value=25.0, previousValue=25.0, unitType=U_LIGHT_LEVEL, readOnly=false, offset=0.0, priority=100, graphProperties={color=#ff7f0e, interpolate=linear, subType=line, useGlobal=true, type=lineChart}), timestamp=1471356147829, samples=1, min=null, max=null, avg=25.0, aggregationType=RAW, timestampFrom=null, timestampTo=null): INSERT INTO `metrics_double_type_device` (`sensorVariableId` ,`timestamp` ,`samples` ,`min` ,`max` ,`avg` ,`aggregationType` ) VALUES (?,?,?,?,?,?,?)
  3. 0

    GitHub comment 253#242234204

    GitHub | 7 months ago | cimba007
    java.sql.SQLException: Unable to run insert stmt on object MetricsDoubleTypeDevice(sensorVariable=SensorVariable(id=3, sensor=Sensor(id=2, sensorId=0, type=S_MOTION, name=, lastSeen=1472079176717, node=Node(id=2, eui=20, gatewayTable=GatewayTable(id=1, enabled=true, name=mosquitto, networkType=MY_SENSORS, timestamp=1472065324018, state=UP, statusMessage=Connected Successfully, statusSince=1472078288689, type=MQTT, properties={p=, u=, bh=tcp://localhost:1883, tp=mygateway-in, cid=mycontroller_mqtt_client, ts=mygateway-out}), name=MicrowaveTest, version=Aug 25 2016 | 00:52:22, type=S_ARDUINO_NODE, libVersion=2.0.0, batteryLevel=null, eraseConfig=null, firmware=null, state=UP, lastSeen=1472079174284, rssi=100%|100%, properties={}, parentNodeEui=0, registrationState=REGISTERED), room=null, variableTypes=[Variable 1, Variable 2]), variableType=V_VAR2, metricType=DOUBLE, timestamp=1472079176762, value=1.0, previousValue=4.0, unitType=U_NONE, readOnly=false, offset=0.0, priority=100, graphProperties={color=#ff7f0e, interpolate=linear, subType=line, useGlobal=true, type=lineChart}), timestamp=1472079176762, samples=1, min=1.0, max=1.0, avg=1.0, aggregationType=RAW, timestampFrom=null, timestampTo=null): INSERT INTO `metrics_double_type_device` (`sensorVariableId` ,`timestamp` ,`samples` ,`min` ,`max` ,`avg` ,`aggregationType` ) VALUES (?,?,?,?,?,?,?)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.h2.jdbc.JdbcSQLException

    Syntax error in SQL statement "SELECT SENSORVARIABLEID, MIN(MIN) AS MIN, MAX(MAX) AS MAX, SUM(AVG*SAMPLES)/SUM(SAMPLES) AS AVG, SUM(SAMPLES) AS SAMPLES, 1484940146167 AS TIMESTAMP FROM METRICS_DOUBLE_TYPE_DEVICE WHERE SENSORVARIABLEID=2,[*]827 AND TIMESTAMP > 1484940086167 AND TIMESTAMP <= 1484940146167 GROUP BY SENSORVARIABLEID "; SQL statement: SELECT sensorVariableId, MIN(min) AS min, MAX(max) AS max, SUM(avg*samples)/SUM(samples) AS avg, SUM(samples) AS samples, 1484940146167 AS timestamp FROM metrics_double_type_device WHERE sensorVariableId=2,827 AND timestamp > 1484940086167 AND timestamp <= 1484940146167 GROUP BY sensorVariableId [42000-176]

    at org.h2.message.DbException.getJdbcSQLException()
  2. H2 Database Engine
    JdbcConnection.prepareStatement
    1. org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
    2. org.h2.message.DbException.get(DbException.java:178)
    3. org.h2.message.DbException.get(DbException.java:154)
    4. org.h2.message.DbException.getSyntaxError(DbException.java:190)
    5. org.h2.command.Parser.getSyntaxError(Parser.java:517)
    6. org.h2.command.Parser.prepareCommand(Parser.java:246)
    7. org.h2.engine.Session.prepareLocal(Session.java:442)
    8. org.h2.engine.Session.prepareCommand(Session.java:384)
    9. org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1188)
    10. org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:73)
    11. org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:665)
    11 frames
  3. ORMLite JDBC
    JdbcDatabaseConnection.compileStatement
    1. com.j256.ormlite.jdbc.JdbcDatabaseConnection.compileStatement(JdbcDatabaseConnection.java:141)
    1 frame
  4. ORMLite Core
    BaseDaoImpl.queryRaw
    1. com.j256.ormlite.stmt.StatementExecutor.queryRaw(StatementExecutor.java:302)
    2. com.j256.ormlite.dao.BaseDaoImpl.queryRaw(BaseDaoImpl.java:627)
    2 frames
  5. org.mycontroller.standalone
    MetricsHandler.getMetricsNvd3Data
    1. org.mycontroller.standalone.api.MetricApi.getSensorVariableMetricsDouble(MetricApi.java:145)
    2. org.mycontroller.standalone.api.jaxrs.MetricsHandler.getMetricsDataJsonNVD3(MetricsHandler.java:824)
    3. org.mycontroller.standalone.api.jaxrs.MetricsHandler.getMetricsNvd3Data(MetricsHandler.java:134)
    3 frames
  6. Java RT
    Method.invoke
    1. sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source)
    2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    3. java.lang.reflect.Method.invoke(Method.java:497)
    3 frames
  7. RESTEasy JAX-RS Implementation
    HttpServletDispatcher.service
    1. org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:139)
    2. org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:295)
    3. org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:249)
    4. org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:236)
    5. org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:395)
    6. org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:202)
    7. org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221)
    8. org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
    9. org.jboss.resteasy.plugins.server.tjws.TJWSServletDispatcher.service(TJWSServletDispatcher.java:40)
    10. org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
    10 frames
  8. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    1 frame
  9. Embedded Servlet Container
    Utils$ThreadPool$PooledThread.run
    1. Acme.Serve.Serve$ServeConnection.runServlet(Serve.java:2328)
    2. Acme.Serve.Serve$ServeConnection.parseRequest(Serve.java:2282)
    3. Acme.Serve.Serve$ServeConnection.run(Serve.java:2054)
    4. Acme.Utils$ThreadPool$PooledThread.run(Utils.java:1402)
    4 frames
  10. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:745)
    1 frame