Overhaul The User Management Dashboard

add your user to the docker group. Vagrant shouldn’t need root to run.

@dmytro.trifonov,

Did you get it working? I’ll update the docs – we get so few people who even wanna touch ID dashboard – i’m not in a hurry. However, I wanna ensure you have ID dashboard running before I go to bed. See this file, You have to create the first user and then follow those instructuctions.

I am on ‘vagrant up’ stage, waiting

Okay you’re good to go – that’s gonna take a bit. AFTER that is done – you can go ahead and register your first user. and follow the instructions in this post:

One other thing @dmytro.trifonov: for some messed up reason (I’m switching the images for mongodb out) – you may have to remove the lock file which is located in /docker/mongo/mongod.lock – not sure why this happens but it’s been a sore point for me.

sudo rm /docker/mongo/mongod.lock

if you run into errors with mongodb not being able to connect and you will.

To look at stdout – you can: docker-compose logs

Let me know when you’re at a reasonable checkpoint that I can work off of. I wanna make sure you’re making steady progress which is why I stayed up. I’m gonna go to sleep now.

@dmytro.trifonov, did you get it running?

ALSO: mails sent by dashboard can be viewed http://localhost:1080

I have 2 machines - desktop and notebook. Today I tried to launch it on a desktop - it worked, but now I am trying to run it on my notebook - it fails with same error!

invercity@invercity-UX31A:~/projects/webstorm/openmrs-contrib-id$ docker-compose up -d Building web Step 1 : FROM mhart/alpine-node:5 ---> 89775bcb2ef1 Step 2 : RUN apk add --update bash openssl git perl python build-base && apk add gosu --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ && apk add dockerize --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/community && addgroup dashboard && adduser -s /bin/bash -D -G dashboard dashboard ---> Running in c7ea112f79a4 fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.4/main: temporary error (try again later) WARNING: Ignoring APKINDEX.167438ca.tar.gz: No such file or directory fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.4/community: temporary error (try again later) WARNING: Ignoring APKINDEX.a2e6dac0.tar.gz: No such file or directory ERROR: unsatisfiable constraints: bash (missing): required by: world[bash] build-base (missing): required by: world[build-base] git (missing): required by: world[git] openssl (missing): required by: world[openssl] perl (missing): required by: world[perl] python (missing): required by: world[python] ERROR: Service 'web' failed to build: The command '/bin/sh -c apk add --update bash openssl git perl python build-base && apk add gosu --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ && apk add dockerize --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/community && addgroup dashboard && adduser -s /bin/bash -D -G dashboard dashboard' returned a non-zero code: 6 invercity@invercity-UX31A:~/projects/webstorm/openmrs-contrib-id$

I use last changes to openmrs-contrib-id repo, that you did today

Maybe docker-compose have some cache mechanism?

do this: docker rmi -f $(docker images -q) and then docker-compose up -d

Docker does cache. Docker Compose is just a wrapper around docker to handle container orchastration.

Also, what OS are each? I fixed the issue – ran this on a fresh 16.04 install.

it depends on mongoose, async, and other modules, so, I believe, we need to run “npm install” before creating user?

yeah – run npm install locally – but it will connect to the mongo docker container

invercity@invercity-UX31A:~/projects/webstorm/openmrs-contrib-id$ docker rmi -f $(docker images -q) Untagged: mhart/alpine-node:5 Deleted: sha256:89775bcb2ef11798bfe193d9cd838159d1b528bac7754840067cd53c018cdb9a Untagged: jeanberu/mailcatcher:latest Deleted: sha256:4e5d773a1b9efaef79e7c9ee1835f6414cfdd1e36c4c128c74d88dffb8b57d25 Deleted: sha256:a48e569bd4928d506867d61823fff0517b981ae6e2dce6d8dfea65472933f561 Deleted: sha256:77f08abee8bf9334407f52d104e1891283018450b3c196118ddfe31505126b87 Untagged: frodenas/mongodb:2.6 Deleted: sha256:3e8788a58939ff10f58a1148b4a2a1ffc3ceb7219820e3baed5f148c5746436c Deleted: sha256:fa5a067f01a6598ca5a22490dfaba119a3842d259c71890f8d498fc27afd5e72 Deleted: sha256:acf56273ea45ad5b3ebe3b95ab294b0593131b082451e099571f15c60cc815ca Deleted: sha256:11ba9edd34c923602e9cc17df85bd27a909d510e9bbd4407b0eab21766efb7bb Deleted: sha256:2a66f8c30e45d9b1c09cee1aa57b799518c0450bf57f4fc158e47211a4edf921 Deleted: sha256:3ee3bf4a22bacba2bfab342a4cd013bcfcddfc76c7da9439defd647898883bd1 Deleted: sha256:1ba8552e7ebe0e1a1cdf46c1090d0ba089a520e31787d176955e00abe0b0de6e Deleted: sha256:b4feaa250acb6729f9a17cc10591267554ac2a54ae8b5a6a9c135d32372fa307 Deleted: sha256:e52b769d09e9ff671453b77ff0859916777e0d17310d1836a00874336633123c Deleted: sha256:1ac1676e7a603144694c08ca170bcf7cce717c3fb1b5c759cbc61a5f672880c9 Deleted: sha256:1aa445bd53016fbcfbaf2b2cada9d9f0b3c640285bc32e9f08375d357180b99d Deleted: sha256:5e0ab543f77d0af6d724cb31868a4f7b36409944c9080b824f04823e0667be13 Deleted: sha256:b5698072b9fdbed0f971e75c96c5cd75342434ff87304c8d0d58163b572a0c1e Deleted: sha256:b19f675e0fc93e53c62c1a18e9d9287653ef8ce44b128d087674ad2bc9af16b7 Deleted: sha256:3717e7025ff7e9f6ddd88e37de3fce40ce1e860ed002754c46c995ca53053d23 Deleted: sha256:134c6c1dedde243aebb02b34dc826b582b87535a4b41503fcd208108ad550d5a Deleted: sha256:947a3e7125fffa10ed14c49c9dccdcfd64aef816c4affa8d5d2b57ae7a2e8b6d Deleted: sha256:5fdb9f26c74d68049527b951ad0cd2a50893d41f5fbf2f2042ec6c592445c2f1 Deleted: sha256:37b9c1ff87ee1d64a110df0a092c262219382c009d86ae4cc84433f6cb29e7cb Deleted: sha256:8698b31c92d5cf4ee37154fc560516040f372bd45707c3161be479443970d8a2

and then

invercity@invercity-UX31A:~/projects/webstorm/openmrs-contrib-id$ docker-compose up -d Pulling mailcatcher (jeanberu/mailcatcher:latest)... latest: Pulling from jeanberu/mailcatcher fae91920dcd4: Pull complete c46e41bab926: Pull complete Digest: sha256:664c08ba6255371b533ba50a887bec845aeb619101197fd2ddd98b66090235bc Status: Downloaded newer image for jeanberu/mailcatcher:latest Pulling mongodb (frodenas/mongodb:2.6)... 2.6: Pulling from frodenas/mongodb 8387d9ff0016: Pull complete 3b52deaaf0ed: Pull complete 4bd501fad6de: Pull complete a3ed95caeb02: Pull complete 9d20913307b0: Pull complete ef9347082ddc: Pull complete e67fdaccfe54: Pull complete dbdfdfc88898: Pull complete 29c309207c21: Pull complete Digest: sha256:f39964ef34997083c5b7bd80d8552d4210f967de0492629f6da35d3d2542fe41 Status: Downloaded newer image for frodenas/mongodb:2.6 Building web Step 1 : FROM mhart/alpine-node:5 5: Pulling from mhart/alpine-node e110a4a17941: Already exists ed5811933fda: Already exists Digest: sha256:f8f781dcccef9740ada3ef1c76810a7a69555ddd81cb5af6890c4e1f2fcdbc2e Status: Downloaded newer image for mhart/alpine-node:5 ---> 89775bcb2ef1 Step 2 : RUN apk add --update bash openssl git perl python build-base && apk add gosu --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ && apk add dockerize --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/community && addgroup dashboard && adduser -s /bin/bash -D -G dashboard dashboard ---> Running in bb5830bcfa52 fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.4/main: temporary error (try again later) WARNING: Ignoring APKINDEX.167438ca.tar.gz: No such file or directory fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.4/community: temporary error (try again later) WARNING: Ignoring APKINDEX.a2e6dac0.tar.gz: No such file or directory ERROR: unsatisfiable constraints: bash (missing): required by: world[bash] build-base (missing): required by: world[build-base] git (missing): required by: world[git] openssl (missing): required by: world[openssl] perl (missing): required by: world[perl] python (missing): required by: world[python] ERROR: Service 'web' failed to build: The command '/bin/sh -c apk add --update bash openssl git perl python build-base && apk add gosu --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ && apk add dockerize --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/community && addgroup dashboard && adduser -s /bin/bash -D -G dashboard dashboard' returned a non-zero code: 6

can you do git pull --rebase?

invercity@invercity-UX31A:~/projects/webstorm/openmrs-contrib-id$ git pull --rebase Current branch master is up to date.

What operating system on each?

the same, 16.04 Kubuntu

That’s really, really weird – I successfully built the image on both my 16.04 digitalocean droplet and a vagrant 16.04 box…something is weird – just not sure what… do the work on the system where the image builds successfully and let’s not waste time on this…

on desktop, all startng successfully, but when I am open localhost:3000, I see:

Connect 500 Error: Not connected at MongoStore.getCollection (/home/dashboard/id/node_modules/connect-mongo/lib/connect-mongo.js:224:16) at MongoStore.get (/home/dashboard/id/node_modules/connect-mongo/lib/connect-mongo.js:285:10) at session (/home/dashboard/id/node_modules/express-session/index.js:434:11) at sessionHandler (/home/dashboard/id/app/app.js:78:10) at Layer.handle [as handle_request] (/home/dashboard/id/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/home/dashboard/id/node_modules/express/lib/router/index.js:312:13) at /home/dashboard/id/node_modules/express/lib/router/index.js:280:7 at Function.process_params (/home/dashboard/id/node_modules/express/lib/router/index.js:330:12) at next (/home/dashboard/id/node_modules/express/lib/router/index.js:271:10) at cookieParser (/home/dashboard/id/node_modules/cookie-parser/index.js:70:5) at Layer.handle [as handle_request] (/home/dashboard/id/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/home/dashboard/id/node_modules/express/lib/router/index.js:312:13) at /home/dashboard/id/node_modules/express/lib/router/index.js:280:7 at Function.process_params (/home/dashboard/id/node_modules/express/lib/router/index.js:330:12) at next (/home/dashboard/id/node_modules/express/lib/router/index.js:271:10) at jsonParser (/home/dashboard/id/node_modules/body-parser/lib/types/json.js:103:7)

sudo rm -fr /docker/mongo

then restart the containers by doing docker-compose down ; docker-compose up -d

:point_up: @dmytro.trifonov – one minor inconvenience – I need to swap out this image – In fact the changes are staged right now.

works, thanks :slight_smile:

but when I am trying to create user: invercity@invercity-jbs:~/projects/webstorm/openmrs-contrib-id$ node scripts/add-admin { [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' } js-bson: Failed to load c++ bson extension, using pure JS version [2016-07-18 22:52:13.087] [ERROR] console - screwed [2016-07-18 22:52:13.089] [ERROR] console - No such group found, please check again

add-admin.json:

{ "userList": [ "admin" ], "groupName": "dashboard-administrators" }

run node build/store.js first to create the groups in mongodb – I can’t figure out a way to automate this in a way that’s not gonna cause issues (it’s the same script we use on travis) – this is documented – I need to fix this (but again – so few people work on this – I’m not rushing)