USEPA / EPA_MOVES_Model

Estimating emissions for mobile sources
Other
84 stars 23 forks source link

Consistent unit conversion error in nonroad runs #77

Closed sblumenstein closed 4 months ago

sblumenstein commented 4 months ago

I've gotten the error "Failed to convert emission quantity units" on three separate MOVES runs. I'm using distance units mi, mass units g, and energy units KJ. My results seem plausible (564,573 metric tons of CO2E total in all nonroad sectors combined in 2023 in Illinois), but I also don't have much to compare them to since I'm getting the error every time. Is this a bug, or am I likely doing something wrong in the runspec? Thank you!

danielbizercox commented 4 months ago

Is there an associated Java exception message in the moveslog.txt or displayed in the console window?

sblumenstein commented 4 months ago

Thanks for your help! Here is the surrounding code from my moveslog.txt:

7/25/24, 4:48 AM INFO: Final aggregation is being done because the runspec preaggregates by Hour but the output is by 24-Hour Day 7/25/24, 4:48 AM INFO: Final Aggregation starting... 7/25/24, 4:49 AM INFO: Final Aggregation complete. 7/25/24, 4:49 AM INFO: Unit conversions starting... 7/25/24, 4:49 AM DEBUG: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 134,097,558 milliseconds ago. The last packet sent successfully to the server was 134,097,558 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem. at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source) at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3352) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1971) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2625) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2119) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2281) at gov.epa.otaq.moves.common.SQLRunner.executeQuery(SQLRunner.java:248) at gov.epa.otaq.moves.master.framework.OutputProcessor.convertOutputUnits(OutputProcessor.java:789) at gov.epa.otaq.moves.master.framework.OutputProcessor.doFinalPostProcessingOnOutputDatabase(OutputProcessor.java:719) at gov.epa.otaq.moves.master.framework.EmissionCalculatorInboundUnbundler.threadIterationGo(EmissionCalculatorInboundUnbundler.java:150) at gov.epa.otaq.moves.common.MOVESThread.run(MOVESThread.java:193) Caused by: java.net.SocketException: An established connection was aborted by the software in your host machine at java.base/sun.nio.ch.NioSocketImpl.implWrite(Unknown Source) at java.base/sun.nio.ch.NioSocketImpl.write(Unknown Source) at java.base/sun.nio.ch.NioSocketImpl$2.write(Unknown Source) at java.base/java.net.Socket$SocketOutputStream.write(Unknown Source) at java.base/java.io.BufferedOutputStream.flushBuffer(Unknown Source) at java.base/java.io.BufferedOutputStream.flush(Unknown Source) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3333) ... 10 more

The last packet successfully received from the server was 134,097,558 milliseconds ago. The last packet sent successfully to the server was 134,097,558 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem. 7/25/24, 4:49 AM RUN_ERROR: Failed to convert emission quantity units. 7/25/24, 4:49 AM INFO: Unit conversions done. 7/25/24, 4:49 AM INFO: No final post processing required. 7/25/24, 4:49 AM INFO: Unbundler has detected completion conditions. Exiting. 7/25/24, 4:49 AM INFO: Generated bundles = 2448 Retrieved bundles = 2448 7/25/24, 4:49 AM INFO: Thread shutdown starting for class gov.epa.otaq.moves.master.framework.EmissionCalculatorInboundUnbundler. 7/25/24, 4:49 AM INFO: Thread shutdown complete for class gov.epa.otaq.moves.master.framework.EmissionCalculatorInboundUnbundler. 7/25/24, 4:49 AM INFO: Thread shutdown starting for class gov.epa.otaq.moves.master.framework.HeartbeatDetectionThread. 7/25/24, 4:49 AM INFO: Closing workerWindow in HeartbeatDetectionThread.shutdownInThread 7/25/24, 4:49 AM INFO: WorkerWindow.closeWindow 7/25/24, 4:49 AM INFO: Signalling worker threads to quit 7/25/24, 4:49 AM INFO: Signalling worker thread to quit class gov.epa.otaq.moves.worker.framework.WorkerHeartbeatThread 7/25/24, 4:49 AM INFO: Signalling worker thread to quit class gov.epa.otaq.moves.worker.framework.RemoteEmissionsCalculator 7/25/24, 4:49 AM INFO: Waiting for worker threads to quit 7/25/24, 4:49 AM INFO: Waiting for thread to quit class gov.epa.otaq.moves.worker.framework.WorkerHeartbeatThread 7/25/24, 4:49 AM INFO: Thread shutdown starting for class gov.epa.otaq.moves.worker.framework.WorkerHeartbeatThread. 7/25/24, 4:49 AM INFO: Thread shutdown starting for class gov.epa.otaq.moves.worker.framework.RemoteEmissionsCalculator. 7/25/24, 4:49 AM INFO: Thread shutdown complete for class gov.epa.otaq.moves.worker.framework.RemoteEmissionsCalculator. 7/25/24, 4:49 AM INFO: Thread shutdown complete for class gov.epa.otaq.moves.worker.framework.WorkerHeartbeatThread. 7/25/24, 4:49 AM INFO: Waiting for thread to quit class gov.epa.otaq.moves.worker.framework.RemoteEmissionsCalculator 7/25/24, 4:49 AM INFO: Completing worker close 7/25/24, 4:49 AM INFO: Closed workerWindow in HeartbeatDetectionThread.shutdownInThread 7/25/24, 4:49 AM INFO: Thread shutdown complete for class gov.epa.otaq.moves.master.framework.HeartbeatDetectionThread. 7/25/24, 4:49 AM INFO: MOVESEngineCompletionChecker is shutting down 7/25/24, 4:49 AM INFO: Finished MOVES run

danielbizercox commented 4 months ago

Since MOVES performs most of its calculations in grams, it is likely that your final results are still correct, even with this error, because it probably doesn't actually need to convert anything.

However, to avoid this error in the future, I recommend splitting your run into multiple smaller runs. For example, you could have a different RunSpec for each county. This will likely have a similar total performance, but each run will complete faster and you will avoid the MySQL timeout error. Hope this helps!

sblumenstein commented 4 months ago

Got it, okay thanks so much for explaining! Yes--the runs are taking a while so I may try splitting into groups of counties (each county for the state alone would probably be too many). Thank you!