GSOC 2019 : OpenMRS Atlas 3.1

Tags: #<Tag:0x00007fbadb1e0558>

(Sai Sandeep Mutyala) #1

Hello, @burke, @dkayiwa and @pascal! I’m a second year undergraduate student at Keshav Memorial Institute of Technology, Hyderabad, India. I recently got myself involved with OpenMRS by submitting 7 PRs (3 merged, 1 unmerged PR related to Atlas module), and would like to contribute more to OpenMRS by solving more issues and through GSOC 2019 by taking up the OpenMRS Atlas 3.1 project. Of the technologies I think would help the project, I’m familiar with Php, MySql, MongoDB, Node, React, Angular, Java, Android, and Docker. Some other skills of mine include C++, C#, Unity, and Data Science using Python.

I’m very interested in the project and would like to take it up, but I’m a little unsure of where I should be proceeding from here, and would like some information about next steps. Thank you!

(Sai Sandeep Mutyala) #2

I was looking for what the missing functionality was, that was present in ‘openmrs-contrib-atlas’ and not in ‘openmrs-contrib-atlas-node’. I could find that the ‘ping’(update, I suppose) functionality, and the ‘download’ routes were missing. Is there anything else I am missing?

I couldn’t get myself a better summary of the missing functionality as I couldn’t set up the openmrs-contrib-atlas, because I do not really know how to setup such apps. However, I could get the openmrs-contrib-atlas-node repo working.

So, how do I setup openmrs-contrib-atlas? Thank you :slight_smile:

Cc: @burke @dkayiwa @cintiadr

(Cintia Del Rio) #3

Please ignore the openmrs-contrib-atlas-node repo, and use branch listed in wiki

I don’t have a staging environment anymore. I set it up last year, but the project wasn’t selected, but I can recreate it later if it gets selected this time.

(Cintia Del Rio) #4

I updated the wiki page with all the current details.

The easiest way to start current atlas locally I’d think it’s docker compose:

I can retrieve what’s inside .env if that’s necessary, but I think you might need to create your own google api creds.

The project just require you to make it work with the latest supported atlas module. If you get it with another version, it’s ok.

I can set up multiple instances of atlas depending on what you need.

(Cintia Del Rio) #5

About the routes, I assume a few things are missing indeed, but I’m not sure anyone actually knows anymore.

(Sai Sandeep Mutyala) #6

Thanks a lot for the info! For now, I think I’ll try to setup atlas using openmrs-contrib-ansible-docker-compose, and see where to go from there.

I found this issue, so I made a PR for it. Unfortunately, I couldn’t test the code I wrote because the ‘/login’ route leads to ‘http://localhost:8080/authenticate/atlas’, which I don’t know how to set up. How do I set up that link?

(Cintia Del Rio) #7

Well, that’s part of the problem.

Login is NOT working in atlas. A good part of the atlas project is to actually reimplement login.

I can tell you that in production it redirects to our ID SSO (it’s configured by environment variables), but it broke a long long time ago. We need to reimplement it.

(Sai Sandeep Mutyala) #8

I see. Thanks a lot for the info! I think I now have a much better view of the project. :slight_smile:

(Sai Sandeep Mutyala) #9

@cintiadr I’m getting the following error when executing nodemon.

[nodemon] 1.18.10
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node ./bin/www`
Atlas is listening at : http://localhost:3000
{ Error: getaddrinfo EAI_AGAIN db:3306
    at Object._errnoException (util.js:992:11)
    at errnoException (dns.js:55:15)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
    at Protocol._enqueue (/home/krypt/myStuff/openmrs/openmrs-contrib-atlas/node_modules/mysql/lib/protocol/Protocol.js:145:48)
    at Protocol.handshake (/home/krypt/myStuff/openmrs/openmrs-contrib-atlas/node_modules/mysql/lib/protocol/Protocol.js:52:23)
    at Connection.connect (/home/krypt/myStuff/openmrs/openmrs-contrib-atlas/node_modules/mysql/lib/Connection.js:130:18)
    at Object.<anonymous> (/home/krypt/myStuff/openmrs/openmrs-contrib-atlas/db.js:14:12)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
  code: 'EAI_AGAIN',
  errno: 'EAI_AGAIN',
  syscall: 'getaddrinfo',
  hostname: 'db',
  host: 'db',
  port: 3306,
  fatal: true }

The GET routes are working fine, but I think the error may be causing my POST requests sent through postman to not respond. I’ve encountered it previously but I didn’t bother much as the GET routes were working fine. The only useful info I could find about it is: .

What does this error mean and how do I fix it?

(Cintia Del Rio) #10

That means that the database wasn’t up ( db:3306, that would be mysql).

How are you trying to start it? Can you run to me a docker ps and let me know what happened?

And all the logs for the database, if you have them.

(Cintia Del Rio) #11

By your command line, you are probably running nodemon without starting the database before??

Or you haven’t configured correctly the host.

db:3306 would be what you’d see if using docker-compose:

(Sai Sandeep Mutyala) #12

That was it, mysql server was up but I had forgotten to create the password environment variable. Thanks!

(Sai Sandeep Mutyala) #13

@cintiadr, is there some way for me to replicate the openmrs LDAP server locally on my machine?

(Cintia Del Rio) #14

You need docker.

Then you can clone , and do a docker-compose up -d.

That won’t have any data, but you can see the admin passwords in the compose yaml file.

Our LDAP tree is explained here:

(Cintia Del Rio) #15

Anyway, in a couple of weeks I can provide a stg ldap (with all the data) and plus a couple of ldap files for atlas users and admin groups.

(Sai Sandeep Mutyala) #16

I’m trying to create a simple LDAP app thingy so that I could get a better idea of how LDAP works. I’m using this code to try and connect to the server, after using docker-compose up -d.

var ldap = require('ldapjs');

var client = ldap.createClient({
  url: 'ldap://'

client.bind('cn=admin', 'admin', function(err) {

But I get the following error:

{ ConnectionError: 1__ldap:// closed
    at /home/krypt/myStuff/openmrs/ldap_stuff/ldap_projects/learning_ldap/ldap_client/node_modules/ldapjs/lib/client/client.js:1277:17
    at Array.forEach (<anonymous>)
    at Client._onClose (/home/krypt/myStuff/openmrs/ldap_stuff/ldap_projects/learning_ldap/ldap_client/node_modules/ldapjs/lib/client/client.js:1272:19)
    at Object.onceWrapper (events.js:315:30)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at TCP._handle.close [as _onclose] (net.js:557:12) lde_message: '1__ldap:// closed', lde_dn: null }

I’m assuming its because I’m entering the username(cn)/password wrong. From the .yml file:

      LDAP_DOMAIN: ${}

I could understand that the admin password was ‘admin’, I tried using the usernames ‘admin’, ‘root’, and ‘OpenMRS’, but I still get the error.

(Cintia Del Rio) #17

It gets tricky:

You’ll want to bind to “cn=admin,dc=openmrs,dc=org”:

docker exec -it ldap_ldap_1 bash
ldapsearch -LLL -Wx -D "cn=admin,dc=openmrs,dc=org" -b "dc=openmrs,dc=org"
Enter LDAP Password: admin

Note that it won’t have groups or users (it’s an empty ldap).

(Sai Sandeep Mutyala) #18

This may be a delayed question but who are the mentors for this project? The GSoC list says its @burke and @dkayiwa, but the project page points to @pascal instead of @dkayiwa.

(Daniel Kayiwa) #19

@suthagar23 @irenyak1 any response to the above?

(Suthagar Kailayapathy) #20

It was mistakenly changed. I have updated the project page. Then the primary mentor is @burke and backup mentor is @dkayiwa.