deanhiller / databus

time series data in cassandra with visualization(NREL's opensource databus project)
Other
53 stars 21 forks source link

modbus client ssh connection drops #12

Closed hopcroft closed 11 years ago

hopcroft commented 11 years ago

modbus client runs but is unable to post data. No new tables are created. Error appears to be related to ssh connection to databus server? Logfile:

INFO: Starting ModBusClient...
2013-07-01 18:10:54,510 [-] [main] g.n.m.ModBusClient main
INFO: Starting ModBusClient2222...
2013-07-01 18:10:54,511 [-] [main] g.n.m.ModBusClient main
INFO: username=robot-modbus1
key=3C8OTHB880.CAPACITANCE2.18VPS2E7B2KLO
port=9000
2013-07-01 18:10:54,672 [-] [main] g.n.c.DatabusSender <init>
INFO: username=robot-modbus1 key=3C8OTHB880.CAPACITANCE2.18VPS2E7B2KLO deviceTable=null str=null port=9000
2013-07-01 18:10:54,889 [-] [main] g.n.c.DatabusSender <init>
INFO: hostUrl=https://localhost:9000
2013-07-01 18:10:54,897 [-] [main] g.n.m.ModBusClient loadMeters
INFO: Processing line = pa_b2_elec_2DL1_1209_freq_pv,PM820,Panel 1209 (1209 [208V]) Frequency,2L,Electricity,,16.94.16.42/502,Slave 4
2013-07-01 18:10:54,898 [-] [main] g.n.m.ModBusClient registerWithDatabus
INFO: Registering Device serial#=pa_b2_elec_2DL1_1209_freq_pv if MeterMeta has true
2013-07-01 18:10:54,899 [-] [main] g.n.m.ModBusClient registerWithDatabus
INFO: Registering Device serial#=pa_b2_elec_2DL1_1209_freq_pv
2013-07-01 18:10:54,899 [-] [main] g.n.m.ModBusClient registerWithDatabus
INFO: Registering pa_b2_elec_2DL1_1209_freq_pv3phaseRealPower
2013-07-01 18:10:54,900 [-] [main] g.n.c.DatabusSender postNewStream
INFO: 3phaseRealPowerposting new stream=pa_b2_elec_2DL1_1209_freq_pv3phaseRealPower
2013-07-01 18:10:54,963 [-] [main] g.n.c.DatabusSender registerNewStream
INFO: registering a new table=pa_b2_elec_2DL1_1209_freq_pv3phaseRealPower in database=Database1
2013-07-01 18:10:55,098 [-] [main] g.n.c.DatabusSender post
INFO: failed to post, continuing on to next request
2013-07-01 18:10:55,104 [-] [main] g.n.m.ModBusClient loadMeters
WARN: Exception while reading csv file: java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    at gov.nrel.consumer.DatabusSender.post(DatabusSender.java:248) ~[modbus.jar:na]
    at gov.nrel.consumer.DatabusSender.registerNewStream(DatabusSender.java:181) ~[modbus.jar:na]
    at gov.nrel.consumer.DatabusSender.postNewStream(DatabusSender.java:158) ~[modbus.jar:na]
    at gov.nrel.modbusclient.ModBusClient.registerWithDatabus(ModBusClient.java:489) [modbus.jar:na]
    at gov.nrel.modbusclient.ModBusClient.loadMeters(ModBusClient.java:279) [modbus.jar:na]
    at gov.nrel.modbusclient.ModBusClient.main(ModBusClient.java:167) [modbus.jar:na]
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:902) ~[na:1.6.0_27]
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1208) ~[na:1.6.0_27]
    at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:674) ~[na:1.6.0_27]
    at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:119) ~[na:1.6.0_27]
    at org.apache.http.impl.io.AbstractSessionOutputBuffer.flushBuffer(AbstractSessionOutputBuffer.java:147) ~[httpcore-4.2.1.jar:4.2.1]
    at org.apache.http.impl.io.AbstractSessionOutputBuffer.flush(AbstractSessionOutputBuffer.java:154) ~[httpcore-4.2.1.jar:4.2.1]
    at org.apache.http.impl.io.ContentLengthOutputStream.flush(ContentLengthOutputStream.java:106) ~[httpcore-4.2.1.jar:4.2.1]
    at org.apache.http.entity.StringEntity.writeTo(StringEntity.java:177) ~[httpcore-4.2.1.jar:4.2.1]
    at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:98) ~[httpcore-4.2.1.jar:4.2.1]
    at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:108) ~[httpclient-4.2.1.jar:4.2.1]
    at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:122) ~[httpcore-4.2.1.jar:4.2.1]
    at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:271) ~[httpcore-4.2.1.jar:4.2.1]
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.sendRequestEntity(ManagedClientConnectionImpl.java:197) ~[httpclient-4.2.1.jar:4.2.1]
    at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:257) ~[httpcore-4.2.1.jar:4.2.1]
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125) ~[httpcore-4.2.1.jar:4.2.1]
    at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:712) ~[httpclient-4.2.1.jar:4.2.1]
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:517) ~[httpclient-4.2.1.jar:4.2.1]
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906) ~[httpclient-4.2.1.jar:4.2.1]
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805) ~[httpclient-4.2.1.jar:4.2.1]
    at gov.nrel.consumer.DatabusSender.post(DatabusSender.java:230) ~[modbus.jar:na]
    ... 5 common frames omitted
Caused by: java.io.EOFException: SSL peer shut down incorrectly
    at sun.security.ssl.InputRecord.read(InputRecord.java:482) ~[na:1.6.0_27]
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:883) ~[na:1.6.0_27]
    ... 24 common frames omitted
2013-07-01 18:10:55,106 [-] [main] g.n.m.ModBusClient main
INFO: done
hopcroft commented 11 years ago

The ModBusClient.properties file has two entries that seem similar:

databus-url=
DATABUS_HOST_URL=

Are they redundant/conflicting?

deanhiller commented 11 years ago

I don't see a DATABUS_HOST_URL in the properties file anymore....I had deleted that. Are you sure you have the latest github code?

Also, what is the url in your browser for databus? I thought you were running on http? (and perhaps I have a bug in that modbus is connecting to what it thinks is https maybe?)

thanks, Dean

deanhiller commented 11 years ago

okay, I think I can reproduce your issue (and we should try to put a better error for this) but if you configure your url to be https://... and you are connecting to http:// then you get the error

WARN: Exception while reading csv file: java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake

since http is not SSL, the https handshake fails. I will try to add a better error around this error for users but in the meantime, you can fix your modbus properties file to be http:// instead of https

deanhiller commented 11 years ago

okay, we added better error message now that says "you probably have https configured in your properties file while your server is only http" please change your properties to http or change your server to https.

hopcroft commented 11 years ago

Yes, that was it (http/https). Obvious in hindsight :) Thanks.

deanhiller commented 11 years ago

no problem, anytime. Let me know the next issue. I am standing by ;) (actually going to get my mountain dew, but be right back to hit your next issue ;) ). (in the background, working on the performance fix while Phil is working charting/dashboard stuff).