pgracio / dhis2-docker

dhis2-docker
38 stars 32 forks source link

The Dashboards don't have any data #12

Closed rrowlands closed 7 years ago

rrowlands commented 7 years ago

Sorry to create another issue but I'm not really sure how to fix it. The dashboards on the main screen when you launch the DHIS2 app don't have any data in them. I guess I was expecting the app to have data in it like when you view https://play.dhis2.org/demo/dhis-web-commons/security/login.action

jason-p-pickering commented 7 years ago

Run analytics. https://ci.dhis2.org/docs/master/en/user/html/ch30.html

On Thu, Dec 1, 2016 at 7:35 PM, rrowlands notifications@github.com wrote:

Sorry to create another issue but I'm not really sure how to fix it. The dashboards on the main screen when you launch the DHIS2 app don't have any data in them. I guess I was expecting the app to have data in it like when you view https://play.dhis2.org/demo/dhis-web-commons/security/ login.action

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pgracio/dhis2-docker/issues/12, or mute the thread https://github.com/notifications/unsubscribe-auth/AC1J_ao9UKOgphUlU36qqsswSLTQpuqOks5rDxOEgaJpZM4LBvQP .

-- Jason P. Pickering email: jason.p.pickering@gmail.com tel:+46764147049

rrowlands commented 7 years ago

The option is missing, even though I'm logged in as super user.

dhis2-reports

jason-p-pickering commented 7 years ago

This is a bit confusing but expected. The "admin" user does not have this right on this database.

You can use this SQL

INSERT INTO userrolemembers 
SELECT b.userroleid,a.userid from 
(SELECT userid from users where username = 'admin' ) a
CROSS JOIN (SELECT userroleid from userrole where name = 'System administrator (ALL)') b;

to upgrade the privileges of the admin user on that database so that they have ALL permissions.

Not really a bug, but my explanation did not really take this into account.

Hope that may help a bit .

rrowlands commented 7 years ago

Yeah, this one I suppose depends on what the end use-case of this project is. For myself, I'm using it as a development environment and my goal is to have it mirror a production system as closely as possible. For this reason, I'm going to experiment with adding this SQL to the database docker image. Are you guys open to pull requesting this change or does it conflict with your goals/vision for this project? Is there perhaps a different database sql dump I can import (and would also have demo data) which would serve these needs better?

jason-p-pickering commented 7 years ago

Well, this "production" environment is a copy of our demo database. We make it available for testing purposes, but its quite difficult to support all use cases. I suggest if you need a super user, then you can fork this project, and use your own docker compose script to inject the SQL and configure the system as you need it. This repo is meant to really provide a local copy of https://play.dhis.org/demo, which it does really, and it is configured this way on prod. We do not allow the "admin" user to have access to analytics, as since this is an open instance, people may continually trigger analytics and stress out the server. Thus, we have it disabled to allow better access for everyone. Locally however, you might want it configured different.

Having said all of that, I think it would make sense to give people a "real" super user, rather than a somewhat hobbled one, so a PR would be welcome I think!

On Fri, Dec 2, 2016 at 5:09 PM, rrowlands notifications@github.com wrote:

Yeah, this one I suppose depends on what the end use-case of this project is. For myself, I'm using it as a development environment and my goal is to have it mirror a production system as closely as possible. For this reason, I'm going to experiment with adding this SQL to the database docker image. Are you guys open to pull requesting this change or does it conflict with your goals/vision for this project?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pgracio/dhis2-docker/issues/12#issuecomment-264491190, or mute the thread https://github.com/notifications/unsubscribe-auth/AC1J_Vztk63DvQKgxNqeJ_n_8YtX7-_Jks5rEEKtgaJpZM4LBvQP .

-- Jason P. Pickering email: jason.p.pickering@gmail.com tel:+46764147049

pgracio commented 7 years ago

@rrowlands as @jason-p-pickering said a PR is more than welcome. We can still keep two different dhis2-db images using different tags, giving the option to the user to choose which database configuration to use.

https://hub.docker.com/r/pgracio/dhis2-db/tags/

jason-p-pickering commented 7 years ago

I think this particular issue could be easily solved with a separate docker compose file to execute that script prior to booting.

On Fri, Dec 2, 2016, 19:48 Paulo Grácio notifications@github.com wrote:

@rrowlands https://github.com/rrowlands as @jason-p-pickering https://github.com/jason-p-pickering said a PR is more than welcome. We can still keep two different dhis2-db images using different tags, giving the option to the user to choose which database configuration to use.

https://hub.docker.com/r/pgracio/dhis2-db/tags/

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/pgracio/dhis2-docker/issues/12#issuecomment-264531066, or mute the thread https://github.com/notifications/unsubscribe-auth/AC1J_fgFL1j9r1RMhjzqyy6cOVNBJVZhks5rEGfwgaJpZM4LBvQP .

rrowlands commented 7 years ago

Dang, you guys tell me after I implement it ;).

You can see my implementation here: https://github.com/terraframe/dhis2-docker/commit/b0bd064ce8f03c3d0a2aee668ad74a3858be6551

I was under the assumption that you guys are not using this docker image internally and that it is for usage by the general public? If that is the case then there's no reason to not have analytics enabled.

jason-p-pickering commented 7 years ago

I agree. I think it makes sense to enable this for the public,if it works. I did not test it.😃

On Fri, Dec 2, 2016, 20:18 rrowlands notifications@github.com wrote:

Dang, you guys tell me after I implement it ;).

You can see my implementation here: terraframe@b0bd064 https://github.com/terraframe/dhis2-docker/commit/b0bd064ce8f03c3d0a2aee668ad74a3858be6551

I was under the assumption that you guys are not using this docker image internally and that it is for usage by the general public? If that is the case then there's no reason to not have analytics enabled.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/pgracio/dhis2-docker/issues/12#issuecomment-264538245, or mute the thread https://github.com/notifications/unsubscribe-auth/AC1J_VVhmt5FoB_u2v3ru0d_EmJWTgZiks5rEG7rgaJpZM4LBvQP .

rrowlands commented 7 years ago

Also @jason-p-pickering if the sql patch were done during the docker-compose task wouldn't you run into the issue where the sql is executed everytime the app is booted, rather than once during the initial import?

pgracio commented 7 years ago

@rrowlands I have merged your PR and it seems to be working. Was able to run analytics and dashboards are now displaying data.