reTHINK-project / dev-msg-node-vertx

Apache License 2.0
0 stars 2 forks source link

Error registring the hyperty #23

Closed vitormsilva closed 7 years ago

vitormsilva commented 8 years ago

We have this error after a while (from end of one day to the begin of other) of inactivity.

We don't know what is causing this. We did a little change on RegisterConnector.java, and we only change the way where the event.result() are called, and move it to inside the event.succeeded() condition. So the result will trigger an error ctx.fail(name, "Error contacting domain registry");

If you need help to understand better the reason why it occur, we can discuss this on slack;

msg-node-vertx                   | ADD-LISTENER(runtime://hybroker.rethink.ptinovacao.pt/9130/f00716cd-68e9-4e60-b757-ab32edc4353c): runtime://hybroker.rethink.ptinovacao.pt/9130/sm
msg-node-vertx                   | ALLOCATE(runtime://hybroker.rethink.ptinovacao.pt/9130/f00716cd-68e9-4e60-b757-ab32edc4353c): hyperty://hybroker.rethink.ptinovacao.pt/15760072-ff57-4b5d-a365-ccc1d5c00dad
msg-node-vertx                   | [RegistryConnector.handle]{"id":1,"from":"runtime://hybroker.rethink.ptinovacao.pt/9130/registry/","to":"domain://registry.hybroker.rethink.ptinovacao.pt/","type":"create","body":{"idToken":null,"accessToken":null,"resource":null,"schema":null,"assertedIdentity":null,"value":{"user":"user://gmail.com/openidtest20","descriptor":"hyperty-catalogue://hybroker.rethink.ptinovacao.pt/.well-known/hyperty/GroupChat","url":"hyperty://hybroker.rethink.ptinovacao.pt/15760072-ff57-4b5d-a365-ccc1d5c00dad","expires":3600,"resources":["chat"],"dataSchemes":["comm"]},"policy":"policy","auth":false}}
msg-node-vertx                   | [Registry-Connector][Received]: {"id":1,"from":"runtime://hybroker.rethink.ptinovacao.pt/9130/registry/","to":"domain://registry.hybroker.rethink.ptinovacao.pt/","type":"create","body":{"idToken":null,"accessToken":null,"resource":null,"schema":null,"assertedIdentity":null,"value":{"user":"user://gmail.com/openidtest20","descriptor":"hyperty-catalogue://hybroker.rethink.ptinovacao.pt/.well-known/hyperty/GroupChat","url":"hyperty://hybroker.rethink.ptinovacao.pt/15760072-ff57-4b5d-a365-ccc1d5c00dad","expires":3600,"resources":["chat"],"dataSchemes":["comm"]},"policy":"policy","auth":false}}
msg-node-vertx                   | Aug 26, 2016 9:45:39 AM io.vertx.core.eventbus.impl.EventBusImpl
msg-node-vertx                   | WARNING: Message reply handler timed out as no reply was received - it will be removed
msg-node-vertx                   | Aug 26, 2016 9:45:39 AM io.vertx.core.impl.ContextImpl
msg-node-vertx                   | SEVERE: Unhandled exception
msg-node-vertx                   | java.lang.NullPointerException
msg-node-vertx                   |     at eu.rethink.mn.component.RegistryConnector.lambda$handle$0(RegistryConnector.java:55)
msg-node-vertx                   |     at io.vertx.core.eventbus.impl.EventBusImpl.lambda$sendOrPub$170(EventBusImpl.java:502)
msg-node-vertx                   |     at io.vertx.core.impl.VertxImpl$InternalTimerHandler.handle(VertxImpl.java:749)
msg-node-vertx                   |     at io.vertx.core.impl.VertxImpl$InternalTimerHandler.handle(VertxImpl.java:720)
msg-node-vertx                   |     at io.vertx.core.impl.ContextImpl.lambda$wrapTask$16(ContextImpl.java:335)
msg-node-vertx                   |     at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:358)
msg-node-vertx                   |     at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
msg-node-vertx                   |     at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
msg-node-vertx                   |     at java.lang.Thread.run(Thread.java:745)
msg-node-vertx                   | 
msg-node-vertx                   | RESOURCE-CLOSE
vitormsilva commented 8 years ago

I don't know if helps, but i have the complete log from yesterday until today when it failed

msgnode-domain-registry.txt

rjflp commented 8 years ago

An error was detected in the validation of communication failures while talking to the Domain Registry. A fix is being worked on.

nunofmn commented 8 years ago

The fix for this bug is in branch the branch 23-connector-reply-bug. Now if an error is detected when contacting the domain-registry, there is a retry.

If the retry also fails the following message is returned by the Registry Connector:

{
  'code': 504,
  'description': 'Error contacting the domain registry.'
}

But when this message is sent by the msg-node to the runtime, the message code is overwritten by the msg-node.

Specifically in the class eu.rethink.mn.component.RegistryConnector in the following line:

replyMsg.setReplyCode(ReplyCode.OK);

So even 404 codes (when hyperties/dataObjects are not found), are being overwritten.

I can change it and test it, but I just wanted to check if this change can have implications on the Runtime.

rjflp commented 8 years ago

@sdruesedow Can you please go ahead an try this branch in your test-bed?

@pchainho The current fix, as @nunofmn said, handles the error but it is being masked by the message node. This has to be changed, but only after we are sure the runtime can handle these error messages.

Immediately, the visible benefit of this new "feature" is the ability to perform a second attempt when a connection fails due to DNS or connectivity error.

sdruesedow commented 8 years ago

I'd like to postpone this test to after the review, since our dev-testbed also plays a role there.

pchainho commented 8 years ago

agree

luistduarte commented 8 years ago

This branch 23-connector-reply-bug was forked from master branch and got the same problem like Issue #25 This should be fixed asap.

sdruesedow commented 8 years ago

I'm running the "connector-reply-fix" branch of the connector as a module now on our dev-testbed (https://rethink-dev.tlabscloud.com). No problems seen so far. The output of the MN is logged - let's wait and monitor!

sdruesedow commented 8 years ago

update: no problems so far, no need to restart anything

pchainho commented 7 years ago

this seems to be fixed