Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to register XDS-mediator #478

Open
madhu-gandi opened this issue May 30, 2018 · 6 comments
Open

Unable to register XDS-mediator #478

madhu-gandi opened this issue May 30, 2018 · 6 comments

Comments

@madhu-gandi
Copy link

Hello ,

I have follwed below link and installed OpenMRS , OpenSHR ,Client registry ,Openempi and OpenHIM on a ubuntu 14 linux server.
https://wiki.openmrs.org/display/docs/Case+Based+Reporting+Module

After performing below step
java -jar mediator-xds-1.0.3-jar-with-dependencies.jar --conf xds-mediator.properties
Following are the errors

[INFO] [05/30/2018 07:16:31.532] [main] [main] Initializing mediator server...
[INFO] [05/30/2018 07:16:31.533] [main] [main] Loading mediator configuration from 'xds-mediator.properties'...
[INFO] [05/30/2018 07:16:31.681] [main] [main] Starting HTTP server...
Exception in thread "main" java.net.BindException: Cannot assign requested address
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.bindToChannelAndAddress(TCPNIOBindingHandler.java:131)
at org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.bind(TCPNIOBindingHandler.java:88)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:248)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:228)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:219)
at org.glassfish.grizzly.http.server.NetworkListener.start(NetworkListener.java:709)
at org.glassfish.grizzly.http.server.HttpServer.start(HttpServer.java:278)
at org.openhim.mediator.engine.MediatorServer.start(MediatorServer.java:67)
at org.openhim.mediator.engine.MediatorServer.start(MediatorServer.java:63)
at org.openhim.mediator.XDSMediatorMain.main(XDSMediatorMain.java:136)

API port for openhim is 8300

When I do curl -vv https://ubuntu141.westeurope.cloudapp.azure.com:8300/
I get below unauthorized error
curl -vv https://ubuntu141.westeurope.cloudapp.azure.com:8300/

  • Hostname was NOT found in DNS cache
  • Trying 23.97.135.133...
  • Connected to ubuntu141.westeurope.cloudapp.azure.com (23.97.135.133) port 8300 (#0)
  • successfully set certificate verify locations:
  • CAfile: none
    CApath: /etc/ssl/certs
  • SSLv3, TLS handshake, Client hello (1):
  • SSLv3, TLS handshake, Server hello (2):
  • SSLv3, TLS handshake, CERT (11):
  • SSLv3, TLS handshake, Server key exchange (12):
  • SSLv3, TLS handshake, Server finished (14):
  • SSLv3, TLS handshake, Client key exchange (16):
  • SSLv3, TLS change cipher, Client hello (1):
  • SSLv3, TLS handshake, Finished (20):
  • SSLv3, TLS change cipher, Client hello (1):
  • SSLv3, TLS handshake, Finished (20):
  • SSL connection using ECDHE-RSA-AES128-GCM-SHA256
  • Server certificate:
  •    subject: CN=ubuntu141.westeurope.cloudapp.azure.com
    
  •    start date: 2018-05-29 05:46:06 GMT
    
  •    expire date: 2018-08-27 05:46:06 GMT
    
  •    subjectAltName: ubuntu141.westeurope.cloudapp.azure.com matched
    
  •    issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
    
  •    SSL certificate verify ok.
    

GET / HTTP/1.1
User-Agent: curl/7.35.0
Host: ubuntu141.westeurope.cloudapp.azure.com:8300
Accept: /

< HTTP/1.1 401 Unauthorized
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: GET,HEAD,PUT,POST,DELETE
< Content-Type: text/plain; charset=utf-8
< Content-Length: 12
< Date: Wed, 30 May 2018 07:30:26 GMT
< Connection: keep-alive
<

  • Connection #0 to host ubuntu141.westeurope.cloudapp.azure.com left intact

With http port 8600 in nginx/openhim-console , we are able to access but no mediator registered.

Below is the xds-mediator file

Mediator Properties

mediator.name=xds-mediator
mediator.host=ubuntu141.westeurope.cloudapp.azure.com
mediator.port=8500
mediator.timeout=60000

core.host=ubuntu141.westeurope.cloudapp.azure.com
core.api.port=8300
core.api.user=[email protected]
core.api.password=Password@123

Assigning authorities to resolve to during transaction enrichment

client.requestedAssigningAuthority=ECID
client.requestedAssigningAuthorityId=ECID
provider.requestedAssigningAuthority=EPID
provider.requestedAssigningAuthorityId=EPID
facility.requestedAssigningAuthority=ELID
facility.requestedAssigningAuthorityId=ELID

== Workflow ==

pnr.patients.autoRegister=true
pnr.providers.enrich=false
pnr.facilities.enrich=false

== PIX Manager ==

pix.manager.host=ubuntu141.westeurope.cloudapp.azure.com
pix.manager.port=3600
pix.manager.securePort=12301
pix.sendingApplication=openhim
pix.sendingFacility=openhim-mediator-ohie-xds
pix.receivingApplication=pix
pix.receivingFacility=pix
pix.secure=true

== CSD Infoman (interlinked registry) ==

ilr.host=ubuntu141.westeurope.cloudapp.azure.com
ilr.port=12302
ilr.csr.path=CSD/csr/jembi-ecgroup-testing/careServicesRequest

== Terminology Service ==

ts.host=ubuntu141.westeurope.cloudapp.azure.com
ts.port=8080

"xds-mediator.properties" 73L, 2165C 1,1 Top

== IHE XDS Registry ==

xds.registry.host=ubuntu141.westeurope.cloudapp.azure.com
xds.registry.port=12303
xds.registry.securePort=12303
xds.registry.path=axis2/services/xdsregistryb
xds.registry.secure=false

== IHE XDS Repository ==

xds.repository.host=ubuntu141.westeurope.cloudapp.azure.com
xds.repository.port=8080
xds.repository.securePort=12304
xds.repository.path=/openmrs/ms/xdsrepository
xds.repository.UniqueId=1.3.6.1.4.1.21367.2010.1.2.1125
xds.repository.secure=false

== ATNA ==

IHE syslog collector

atna.host=ubuntu141.westeurope.cloudapp.azure.com
atna.useTcp=true
atna.tcpPort=5052
atna.udpPort=5050
atna.secure=false

== IHE infrastructure security ==

use absolute path

ihe.keystore=/usr/share/openhim-core/resources/certs/ihe/keystore.jks
ihe.keypassword=Password@123
ihe.storepassword=Password@123

The OID that uniquely identifies this system

ihe.systemSourceID=1.3.6.1.4.1.21367.2010.1.2

Please assist in registering the xds-mediator

@rcrichton
Copy link
Member

Hi, it looks like the mediator is throwing a bind error when starting up. Are you sure One of the port that the mediator uses isn't already bound to something else?

@madhu-gandi
Copy link
Author

Hi,
Thanks for the reply. The port 8500 is not used by any other process.

Below is the output if I run without --conf option

java -jar mediator-xds-1.0.3-jar-with-dependencies.jar
[INFO] [05/31/2018 08:11:30.088] [main] [main] Initializing mediator server...
[INFO] [05/31/2018 08:11:30.089] [main] [main] No configuration specified. Using default properties...
[INFO] [05/31/2018 08:11:30.229] [main] [main] Starting HTTP server...
May 31, 2018 8:11:30 AM org.glassfish.grizzly.http.server.NetworkListener start
INFO: Started listener bound to [0.0.0.0:8500]
May 31, 2018 8:11:30 AM org.glassfish.grizzly.http.server.HttpServer start
INFO: [HttpServer] Started.
[INFO] [05/31/2018 08:11:30.306] [mediator-akka.actor.default-dispatcher-3] [akka://mediator/user/xds-mediator] Registering mediator with core...
[INFO] [05/31/2018 08:11:30.307] [main] [main] xds-mediator listening on 0.0.0.0:8500
[INFO] [05/31/2018 08:11:30.313] [mediator-akka.actor.default-dispatcher-2] [akka://mediator/user/xds-mediator/core-api-connector] Registering mediator with core...
[ERROR] [05/31/2018 08:11:30.858] [mediator-akka.actor.default-dispatcher-2] [akka://mediator/user/xds-mediator/core-api-connector] Mediator Registration Error
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at sun.security.ssl.InputRecord.handleUnknownRecord(InputRecord.java:710)
at sun.security.ssl.InputRecord.read(InputRecord.java:527)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:290)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:259)
at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:125)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:319)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)

Still is it a port issue?

Thanks in advance.

@rcrichton
Copy link
Member

Hi, sorry for not getting back to you. I missed this message. I see you have the OpenHIM API port set as 8300, if this definitely correct? The mediator is failing to connect tothe OpenHIM-core API. If you are still having this issue, perhaps you can show me your OpenHIM core config.

@madhu-gandi
Copy link
Author

madhu-gandi commented Jun 27, 2018 via email

@madhu-gandi
Copy link
Author

madhu-gandi commented Jul 2, 2018 via email

@rcrichton
Copy link
Member

Hi, apologies. I wason leave for the last 2 weeks. It looks like you are getting an unauthenticated message back from OpenMRS. In the OpenHIM channel there is a checkbox for forwarding authentication headers on the routes tab. Perhaps this will help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants