reTHINK-project / dev-registry-domain

Domain Registry
Apache License 2.0
1 stars 1 forks source link

NullPointerException for request of format: "GET /hyperty/user/:user_id" #57

Closed sdruesedow closed 7 years ago

sdruesedow commented 7 years ago

Search attempts for all hyperties of a given user without resources or dataSchemes as parameter produce a NullPointerException in the domain-registry (using the latest version from dockerhub). Requests of this form are used by the global registry to find ALL hyperties for a special user in a certain domain. Due to this, the global discovery is currently not operational. Request with given resources and/or dataSchemes work as expected but are not suitable for the purpose of the global discovery.

2017-02-14 14:57:40 INFO  RamClient:50 - Received request for user://gmail.com/druesedow hyperties
dev-registry-domain    | 2017-02-14 14:57:40 INFO  RamClient:50 - Received request for user://gmail.com/druesedow hyperties
dev-registry-domain    | 2017-02-14 14:57:40 INFO  RamClient:50 - Received request for user://gmail.com/druesedow hyperties
dev-registry-domain    | [qtp1197714465-26] ERROR spark.webserver.MatcherFilter - 
dev-registry-domain    | java.lang.NullPointerException
dev-registry-domain    |        at domainregistry.HypertyService.allHypertiesAreUnavailable(HypertyService.java:248)
dev-registry-domain    |        at domainregistry.HypertyService.getAllHyperties(HypertyService.java:43)
dev-registry-domain    |        at domainregistry.HypertyController.lambda$new$4(HypertyController.java:104)
dev-registry-domain    |        at spark.SparkBase$1.handle(SparkBase.java:311)
dev-registry-domain    |        at spark.webserver.MatcherFilter.doFilter(MatcherFilter.java:159)
dev-registry-domain    |        at spark.webserver.JettyHandler.doHandle(JettyHandler.java:60)
dev-registry-domain    |        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:179)
dev-registry-domain    |        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)
dev-registry-domain    |        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
dev-registry-domain    |        at org.eclipse.jetty.server.Server.handle(Server.java:451)
dev-registry-domain    |        at org.eclipse.jetty.server.HttpChannel.run(HttpChannel.java:252)
dev-registry-domain    |        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:266)
dev-registry-domain    |        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:240)
dev-registry-domain    |        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:596)
dev-registry-domain    |        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:527)
dev-registry-domain    |        at java.lang.Thread.run(Thread.java:745)
ruimangas commented 7 years ago

I guess this is happening because when you registered the Hyperties you forgot to add the "status" field (as specified here).

PUT Request example:

{
    "resources" : ["chat", "voice"],
    "dataSchemes" : ["chat", "voice"],
    "descriptor": "hyperty-catalogue://localhost/HelloHyperty",
    "expires" : 3600,
    "status": "live",
    "runtime": "runtime",
    "p2pRequester": "p2pRequester",
    "p2pHandler": "p2pHandler",
    "guid": "guid"
}
sdruesedow commented 7 years ago

So I assume it should be enough to update the Runtime in the catalogue!? Do you know which runtime.js version supports the status flag? I'm running the latest released version 0.7.1 from mid of November in our testbeds.

BernardoMG commented 7 years ago

Yes, it should be enough, but we don't know which runtime.js version supports it. @pchainho can you help here?

pchainho commented 7 years ago

@sdruesedow the status update was not released yet in the runtime but "dev-p2p-interworking-merge" branch should support that

sdruesedow commented 7 years ago

I just took the Runtime.js from dev-runtime-core#dev-p2p-interworking-merge and updated it on rethink-dev.tlabscloud.com. Now I get an error message from the RuntimeUA during page loading: screenshot_20170215_135810

Any ideas? I did not change anything else.

sdruesedow commented 7 years ago

@BernardoMG: Is there alternatively a version of the domain registry that still works with the 0.7.1 version of the Runtime?

ruimangas commented 7 years ago

Release 0.4.0 from Oct 12 should work.

sdruesedow commented 7 years ago

I switched back to registry R0.4.0. and can confirm that the request works there with Runtime v0.7.1.

BernardoMG commented 7 years ago

So, can we close this issue @sdruesedow ?

sdruesedow commented 7 years ago

Yes I think so. It's a configuration and versioning issue and not an issue of the domain registry itself.