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

openhim unable to discover host for scaffolding mediator #1206

Open
satyadeep-ih opened this issue Sep 4, 2023 · 0 comments
Open

openhim unable to discover host for scaffolding mediator #1206

satyadeep-ih opened this issue Sep 4, 2023 · 0 comments

Comments

@satyadeep-ih
Copy link

satyadeep-ih commented Sep 4, 2023

Hi,

I am trying the code in Scaffolding Mediator , for which I am getting the following issue:

2023-09-05 04:55:07.121 - info: [worker1] The channel that matches the request /scaffold is: Bootstrap Scaffold Mediator
2023-09-05 04:55:07.122 - info: [worker1] Storing request metadata for inbound transaction
2023-09-05 04:55:07.122 - info: [worker1] The request, '/scaffold' is authorised to access Bootstrap Scaffold Mediator
2023-09-05 04:55:07.141 - error: [worker1] [64f66753c416130692d83d0b] Internal server error occured: Error: getaddrinfo EAI_AGAIN scaffold
2023-09-05 04:55:07.148 - info: [worker1] All routes completed for transaction: 64f66753c416130692d83d0b
2023-09-05 04:55:07.148 - error: [worker1] Error: getaddrinfo EAI_AGAIN scaffold
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:26)
2023-09-05 04:55:07.149 - info: [worker1] stored primary response for 64f66753c416130692d83d0b
2023-09-05 04:55:07.151 - info: [worker1] Final status for transaction 64f66753c416130692d83d0b : Failed

Curl command

curl -X GET http://revamp.intelehealth.org:5001/scaffold -H "Authorization: Basic $(echo -n test:test | base64)"
My Dockerfile has

FROM node:18-buster
WORKDIR /app
COPY . /app
RUN npm install
CMD npm start
EXPOSE 3000

index.js has

'use strict'
import utils from 'openhim-mediator-utils'
import mediatorConfig from './mediatorConfig.json' assert {type: 'json'};
import express from 'express'

const app = express()

app.all('*', (req, res) => {
  res.send('Hello World')
})

const openhimConfig = {
  username: '[email protected]',
  password: 'sky@1Fall',
  apiURL: 'https://revamp.intelehealth.org:8080',
  trustSelfSigned: true
}

utils.registerMediator(openhimConfig, mediatorConfig, err => {
  if (err) {
    throw new Error(`Failed to register mediator. Check your Config. ${err}`)
  }
})

app.listen(3000, () => {
  console.log('Server listening on port 3000...')
})

Docker command

sudo docker run --network ih_openhim --name scaffold --rm -p 3000:3000 scaffold

Docker Network list

sudo docker network ls
NETWORK ID     NAME         DRIVER    SCOPE
26044067beac   bridge       bridge    local
99c1e811ad1c   host         host      local
**878ec7d0436a   ih_openhim   bridge    local**
0b718516b4f0   none         null      local

I also tried
sudo docker run --network ih_openhim --name scaffold --rm -p 3000:5001 scaffold

But the error refused to go.

Any help?

Thanks

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

1 participant