-
Notifications
You must be signed in to change notification settings - Fork 3
Improve mediator debugging capabilities #158
Copy link
Copy link
Open
Labels
Type: ImprovementMake something betterMake something better
Description
What feature do you want to improve?
Improve mediator debugging capabilities.
Describe the improvement you'd like
@binokaryg and @PrjShrestha have already worked on a solution for a local program that be extended to this repo.
| File | Changes | Instructions |
|---|---|---|
mediator/package.json |
"watch": "nodemon --watch '**/*.ts' --exec 'node --inspect=0.0.0.0:9229 -r ts-node/register ./index.ts'" |
add to scripts |
docker/docker-compose.mediator.yml |
- "9229:9229" |
add to ports |
mediator/Dockerfile |
EXPOSE 9229 CMD ["npm", "run", "watch"] |
replace "CMD npm start" |
mediator/tsconfig.json |
"sourceMap": true |
uncomment/add |
.vscode/launch.json |
{ "version": "0.2.0", "configurations": [ { "type": "node", "request": "attach", "name": "Attach to Docker", "address": "localhost", "port": 9229, "localRoot": "${workspaceFolder}/mediator", "remoteRoot": "/app", "protocol": "inspector", "restart": true, "skipFiles": ["<node_internals>/**"] } ] } |
|
| add, create file if needed |
After making the change:
./startup.sh up-dev- Attach (F5 or click on Attach to Docker)
Troubleshooting
Error: nano(...).use is not a function
- Most probably database referenced from nano is not formed properly or url or creds for CHT couchDB are wrong. Check in .env file in mediator and docker-compose.yml files for env variables related to it. Docker first reads the .env file in the same directory as docker-compose.yml then checks in docker-compose.yml inline variables when setting environment variable.
- Ensure nano is installed and functioning, check package.json
Error: threw new Error('Mediator Registration Failed: ${err}'); - ECONNREFUSED
- Most probably before configurator could finish mediator started. Hence restart configurator then mediator.
- Check if interop-user is created and password is correctly set
- Go via root and create user and/or reset the password
Error: Mediator Registration Failed: Reason error: User interop@openhim.org not found when authentication with core API
- Check if defaults.json is pointing to correct host
"protocol": "https", "host": "openhim.melosic.com", - If it is check if the user is registered properly.
- Try to setup the user yourself by login in openhim by root
- If you cannot login by root as well. There might be a case where while login in you are asked to click on a link to heartbeat during login. Do so. Reapt process 2 to 3.
- If none of the above works - talk to @binokaryg
Error: 502 Bad Gateway / Nginx error
- Restart SWAG
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type: ImprovementMake something betterMake something better


