Re: [Dhis2-devs] Importing large data files - server settings

2015-12-03 Thread Alan Ivey
Also, it's worth noting that the default for "client_max_body_size" is only
1 MB:
http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size .
It will need to be increased on most deployments of DHIS2.

On Thu, Dec 3, 2015 at 9:09 AM, Lars Helge Øverland 
wrote:

> If you are indeed using nginx, the "client_max_body_size" directive is
> part of the installation docs example, can be increased as appropriate:
>
> https://www.dhis2.org/doc/snapshot/en/implementer/html/ch08s04.html#d5e575
>
>
>
> Lars
>
>
>
>
> On Thu, Dec 3, 2015 at 3:02 PM, Lars Helge Øverland 
> wrote:
>
>> Hi Calle,
>>
>> I think this depends on the web server configuration. One can configure
>> max file size for uploads in both the proxy (nginx, apache) and servlet
>> container (tomcat
>> 
>> ).
>>
>> On nginx
>> 
>> the directive is:
>>
>> client_max_body_size 200M;
>>
>>
>> regards,
>>
>> Lars
>>
>> On Thu, Dec 3, 2015 at 2:44 PM, Calle Hedberg 
>> wrote:
>>
>>> Hi,
>>>
>>> I have found that there is a limitation in file size when importing data
>>> into our SERVER-based instances, while I have found no equivalent
>>> limitation when importing large data files (e.g. XML format) into an
>>> equivalent localhost instance. A few key aspects:
>>>
>>> 1. Both the server and localhost are running the latest version of 2.20
>>> 2. Both are running java 8 64 bits and tomcat 8.026 or 8.029
>>> 3. Localhost tomcat has 4GB (min) and 8GB (max) allocated
>>> 4. The server instance (running under Ubuntu Linux) has ~5.3GB RAM, but
>>> increasing/decreasing RAM has no effect on the issue.
>>>
>>> The problem is related to the upload process.
>>>
>>> Example:
>>> When importing a 75MB data file with around 8 mill data records (XML,
>>> zipped) on localhost, the initial upload step is almost instantaneous (2-3
>>> seconds) and then the actual import starts (takes about 10 minutes overall).
>>>
>>> When importing the same file to the equivalent instance on the server,
>>> it takes around 30 seconds to reach 2% upload and then the upload re-starts
>>> at 0% - this goes on ad infinitum.
>>>
>>> Smaller files - e.g. 10-20MB - will maybe import 15-20%, then reset to
>>> 0% and start over.
>>>
>>> It seems to me that the problem is related to the DHIS2 web server
>>> configuration, it do not allow sufficient time for the upload to happen.
>>>
>>> Any indications of how to fix this would be appreciated. While dumping
>>> the server instance into localhost, import the data, and then
>>> upload/restore the instance does work, it is a pain in the b
>>>
>>> Regards from a sunny Cape Town
>>> Calle
>>>
>>> ***
>>>
>>> Calle Hedberg
>>>
>>> 46D Alma Road, 7700 Rosebank, SOUTH AFRICA
>>>
>>> Tel/fax (home): +27-21-685-6472
>>>
>>> Cell: +27-82-853-5352
>>>
>>> Iridium SatPhone: +8816-315-19119
>>>
>>> Email: calle.hedb...@gmail.com
>>>
>>> Skype: calle_hedberg
>>>
>>> ***
>>>
>>>
>>> ___
>>> Mailing list: https://launchpad.net/~dhis2-devs
>>> Post to : dhis2-devs@lists.launchpad.net
>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>>
>>
>>
>> --
>> Lars Helge Øverland
>> Lead developer, DHIS 2
>> University of Oslo
>> Skype: larshelgeoverland
>> http://www.dhis2.org 
>>
>>
>
>
> --
> Lars Helge Øverland
> Lead developer, DHIS 2
> University of Oslo
> Skype: larshelgeoverland
> http://www.dhis2.org 
>
>
> ___
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] 2.22 Encryption

2016-01-19 Thread Alan Ivey
Hi all,

I upgraded a 2.20 instance with a 22-character encryption password to 2.22
(with 2.21 in the middle) and had the following warning in the log upon
2.22 startup:

* WARN  2016-01-19 16:54:23,276 Encryption not configured:
encryption.password in dhis.conf is too short. Minimum 24 characters is
required. (ConfigurationPopulator.java [localhost-startStop-1])

What is the remediation for an encrypted database that did have an
acceptable encryption.password pre-2.22? Can the password be changed?

Also, it seems as though "Encryption not configured" only pertains to
attribute value encryption; is this correct? Previously, I have attempted
to start DHIS2 with a database with encrypted system settings while
forgetting to include "encryption.password" and DHIS2 simply refused to
start. The fact that DHIS2 was able to start with a too-short password
seems to indicate that existing encryption of system configuration
functionality will continue to work, but value encryption is disabled.

Thanks,
Alan
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] Changing admin password to default

2015-08-31 Thread Alan Ivey
Hi Gerald,

You can create a password hash with Python and the Bcrypt library. Run this
single command in your terminal to get a hash for *passwordGoesHere*:

$ python -c 'import bcrypt; hash = bcrypt.hashpw("*passwordGoesHere*",
bcrypt.gensalt(rounds=10, prefix=b"2a")); print(hash);'

You can insert the resulting hash directly into the database for the admin
user.

Note: If you do not have the Bcrypt library in your Python installation,
you should add it with pip. The following will install all prerequisites on
a CentOS 6 system:

$ yum install gcc libffi-devel python-devel python-pip
$ pip install --user bcrypt

Before attempting to change the admin user password in the database, visit
the front page of a new installation to have DHIS2 generate data in the
database for the admin user (you can do something as simple as $ curl -sL
http://localhost:8080/). Then, you can enter the following query into the
Postgres CLI with the DHIS2 database in use:

UPDATE USERS SET password = '001122hashgoeshere221100' WHERE username =
'admin';

Restart the application server (Tomcat) and then you should be able to log
in with your new password *passwordGoesHere* or what you changed it to.

Regards,
Alan

On Mon, Aug 31, 2015 at 11:02 AM, gerald thomas 
wrote:

> Dear all,
> I am setting up a training server for staff and i am using dhis2 live
> to achieve the task but i am using one of our database rather than the
> default database. I had already used the following query to change the
> admin password:
>
> UPDATE users set password = '48e8f1207baef1ef7fe478a57d19f2e5'
> where username = 'admin';
>
> What am i doing which is wrong and why i can't login with username:
> admin password: district
>
> --
> Regards,
>
> Gerald
>
> ___
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Bug 1507725] [NEW] Error in posting non-String data to API

2015-10-19 Thread Alan Ivey
Public bug reported:

Consider the following API call, as following the instructions on
https://www.dhis2.org/doc/snapshot/en/user/html/ch32s28.html :

$ curl -k -u 'system:redacted' -H "Content-Type: text/plain" -X POST -d 'true' 
https://apps.dhis2.org/demo/api/systemSettings/keyEmailTls
{"httpStatus":"OK","httpStatusCode":200,"status":"OK","message":"System setting 
keyEmailTls set as value 'true'."}

While technically the same, this yields the same result:

$ curl -k -u 'system:redacted' -H "Content-Type: text/plain" -X POST 
https://apps.dhis2.org/demo/api/systemSettings/keyEmailTls?value=true
{"httpStatus":"OK","httpStatusCode":200,"status":"OK","message":"System setting 
keyEmailTls set as value 'true'."

Verify the correct value:

$ curl -k -u 'system:redacted' -H "Accept: text/plain" -X GET 
https://apps.dhis2.org/demo/api/systemSettings/keyEmailTls
true

Then, go to https://apps.dhis2.org/demo/dhis-web-maintenance-
settings/systemEmailSettings.action and you will get an error message.
The application logs will say something similar to:

* ERROR 2015-10-19 17:34:28,391 Error while executing action 
(ExceptionInterceptor.java [http-apr-8080-exec-2])
java.lang.ClassCastException: java.lang.String cannot be cast to 
java.lang.Boolean

The solution is to post the data as JSON:

$ curl -k -u 'system:redacted' -H "Content-Type: application/json" -X POST -d 
'{"keyEmailTls":true}' https://apps.dhis2.org/demo/api/systemSettings
{"httpStatus":"OK","httpStatusCode":200,"status":"OK","message":"System 
settings imported"}

I understand the differences between the two requests, and how omitting
quotation marks in the JSON payload means I am intending to send a
boolean and not a string of "true", but I suspect some input
manipulation and/or validation might be necessary for the text/plain API
request.

This has occurred on a current 2.20 installation as well as the latest
stable demo version on apps.dhis2.org/demo/, so I presume it affects all
stable branches. It does not appear to affect trunk, however, as
observed https://apps.dhis2.org/dev/, but I did not have access to the
logs or attempt to send a test email to see if the actual functionality
is impacted.

** Affects: dhis2
 Importance: Undecided
 Status: New

-- 
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1507725

Title:
  Error in posting non-String data to API

Status in DHIS:
  New

Bug description:
  Consider the following API call, as following the instructions on
  https://www.dhis2.org/doc/snapshot/en/user/html/ch32s28.html :

  $ curl -k -u 'system:redacted' -H "Content-Type: text/plain" -X POST -d 
'true' https://apps.dhis2.org/demo/api/systemSettings/keyEmailTls
  {"httpStatus":"OK","httpStatusCode":200,"status":"OK","message":"System 
setting keyEmailTls set as value 'true'."}

  While technically the same, this yields the same result:

  $ curl -k -u 'system:redacted' -H "Content-Type: text/plain" -X POST 
https://apps.dhis2.org/demo/api/systemSettings/keyEmailTls?value=true
  {"httpStatus":"OK","httpStatusCode":200,"status":"OK","message":"System 
setting keyEmailTls set as value 'true'."

  Verify the correct value:

  $ curl -k -u 'system:redacted' -H "Accept: text/plain" -X GET 
https://apps.dhis2.org/demo/api/systemSettings/keyEmailTls
  true

  Then, go to https://apps.dhis2.org/demo/dhis-web-maintenance-
  settings/systemEmailSettings.action and you will get an error message.
  The application logs will say something similar to:

  * ERROR 2015-10-19 17:34:28,391 Error while executing action 
(ExceptionInterceptor.java [http-apr-8080-exec-2])
  java.lang.ClassCastException: java.lang.String cannot be cast to 
java.lang.Boolean

  The solution is to post the data as JSON:

  $ curl -k -u 'system:redacted' -H "Content-Type: application/json" -X POST -d 
'{"keyEmailTls":true}' https://apps.dhis2.org/demo/api/systemSettings
  {"httpStatus":"OK","httpStatusCode":200,"status":"OK","message":"System 
settings imported"}

  I understand the differences between the two requests, and how
  omitting quotation marks in the JSON payload means I am intending to
  send a boolean and not a string of "true", but I suspect some input
  manipulation and/or validation might be necessary for the text/plain
  API request.

  This has occurred on a current 2.20 installation as well as the latest
  stable demo version on apps.dhis2.org/demo/, so I presume it affects
  all stable branches. It does not appear to affect trunk, however, as
  observed https://apps.dhis2.org/dev/, but I did not have access to the
  logs or attempt to send a test email to see if the actual
  functionality is impacted.

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1507725/+subscriptions

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscri

Re: [Dhis2-devs] DHIS2 2.15 or 2.18 download link

2015-10-21 Thread Alan Ivey
Regarding older download links from your original email, you can download
2.18 from https://www.dhis2.org/downloads. However, for 2.15 or another
version you can't find a public war download link, you can build them
locally from the source code:

   - Ensure that you have Java, Maven, and Bzr (Bazaar) on your local
   environment
   - Grab the code for 2.18 (or 2.15): bzr checkout --lightweight
   lp:~dhis2-devs-core/dhis2/2.18
   - cd 2.18/dhis-2
   - ./build.sh

The "dhis.war" file will be
in ./dhis2-code/2.18/dhis-2/dhis-web/dhis-web-portal/target/dhis.war

Alan

On Wed, Oct 21, 2015 at 3:27 AM, Mihayo Mathayo 
wrote:

> Hello Team,
>
> Is it possible to display data element report by using form display name
> instead of real name of data element.
>
> For instance my data element name is TB_Number of received patients
> and form display name Number of received patients.
>
> When running the data element report it appears with the initial TB_
>
> But i want it to display without the initial TB_
>
> Thanks.
>
> On Sat, Aug 22, 2015 at 3:03 PM, Mihayo Mathayo 
> wrote:
>
>> Hello Team,
>> Can any one provide me a link to dhis2 version 2.15 or 2.18 downloads, am
>> trying to upgrade to version 2.20 with no success.I need  to try older
>> version to see whether the problem is on my side or the current version of
>> dhis2(2.20) am trying to upgrade.
>>
>> Best Regards.
>>
>
>
> ___
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp