Error after setting up a new CommCare HQ application

Hi,

After installing CommCare HQ and setting up a new project, then
application, somewhere during editing the module in the application and
creating a new form causes my install to break:

{"error":"reduce_overflow_error","reason":"Reduce output must shrink more
rapidly: Current output: '[{"xmlns":
"http://openrosa.org/formdesigner/6B57A9F7-7DB4-4D76-BF53-3E7587F154D4\",\"app\":
{"name": "'... (first 100 of 279 bytes)"}
Full paste: commcarehq - Pastebin.com

If I open another page in a new tab (e.g. Settings page) I get that error,
but the application editor in the first tab continues working. If I delete
the module I'm working on the error goes away in the second tab after
refreshing.

Any ideas?

I haven't added any CommCare builds to HQ at this point - is this maybe
related?

Relatedly, how do I add a CommCare build to HQ? :stuck_out_tongue: I see there's a
add_commcare_build command in manage.py that expects a zip file - is this a
zip with the jar and jad inside?

Michael

Hi Michael,

If you have a version of couchdb that is earlier than 1.0, that's almost
certainly the the cause. If you're on couchdb 1+, let me know and I can
help debug.

To add a commcare build, follow the instructions here:
https://github.com/dimagi/core-hq/blob/master/corehq/apps/builds/README.md

Cheers,
Danny

··· 2012/4/3 Michael Champanis

Hi,

After installing CommCare HQ and setting up a new project, then
application, somewhere during editing the module in the application and
creating a new form causes my install to break:

{"error":"reduce_overflow_error","reason":"Reduce output must shrink more
rapidly: Current output: '[{"xmlns": "
http://openrosa.org/formdesigner/6B57A9F7-7DB4-4D76-BF53-3E7587F154D4\",\"app\":
{"name": "'... (first 100 of 279 bytes)"}
Full paste: commcarehq - Pastebin.com

If I open another page in a new tab (e.g. Settings page) I get that error,
but the application editor in the first tab continues working. If I delete
the module I'm working on the error goes away in the second tab after
refreshing.

Any ideas?

I haven't added any CommCare builds to HQ at this point - is this maybe
related?

Relatedly, how do I add a CommCare build to HQ? :stuck_out_tongue: I see there's a
add_commcare_build command in manage.py that expects a zip file - is this a
zip with the jar and jad inside?

Michael

Hi Michael,

··· On Tue, Apr 3, 2012 at 11:48 AM, Daniel Roberts wrote:

2012/4/3 Michael Champanis michael.champanis@gmail.com

Hi,

After installing CommCare HQ and setting up a new project, then
application, somewhere during editing the module in the application and
creating a new form causes my install to break:

{"error":"reduce_overflow_error","reason":"Reduce output must shrink more
rapidly: Current output: '[{"xmlns": "
http://openrosa.org/formdesigner/6B57A9F7-7DB4-4D76-BF53-3E7587F154D4\",\"app\":
{"name": "'... (first 100 of 279 bytes)"}
Full paste: commcarehq - Pastebin.com

If I open another page in a new tab (e.g. Settings page) I get that
error, but the application editor in the first tab continues working. If I
delete the module I'm working on the error goes away in the second tab
after refreshing.

Are you running stock CommCare HQ or have you been adding new couchdb
views? The reduce overflow issue typically comes from a poorly designed
map/reduce function that doesn't comply within the guidelines. From the
definitive guide:

"As a rule of thumb, the reduce function should reduce to a single scalar
value. That is, an integer; a string; or a small, fixed-size list or object
that includes an aggregated value (or values) from the values argument. It
should never just return values or similar. CouchDB will give you a warning
if you try to use reduce “the wrong way”"

If you've been experimenting with writing your own views that is the first
place I'd look. You can find some more discussion on this at the links
pasted below, or by googling the above error.

Also note that while setting "reduce_limit" = false in your settings will
workaround this, it is almost never the case that you actually want to do
that, as it will crush a production database.

Cory

http://guide.couchdb.org/draft/cookbook.html
http://couchdb-development.1959287.n2.nabble.com/reduce-limit-error-td2789734.html
http://grokbase.com/t/couchdb/user/118hps6h08/bug-or-my-lack-of-understanding-reduce-output-must-shrink-more-rapidly

--
Cory L. Zue
Dimagi, Inc

Any ideas?

I haven't added any CommCare builds to HQ at this point - is this maybe
related?

Relatedly, how do I add a CommCare build to HQ? :stuck_out_tongue: I see there's a
add_commcare_build command in manage.py that expects a zip file - is this a
zip with the jar and jad inside?

Michael

Hi Danny,

I had couchdb from Ubuntu 10.04 package manager installed - I've chucked it
and built 1.2.0 from source and it seems to be behaving now. I've set up
and deployed an app successfully. Thanks!

Cory: thanks for the input also - I am running stock HQ at the moment, I
haven't added any new views.

Michael

··· On 3 April 2012 17:48, Daniel Roberts wrote:

Hi Michael,

If you have a version of couchdb that is earlier than 1.0, that's almost
certainly the the cause. If you're on couchdb 1+, let me know and I can
help debug.

To add a commcare build, follow the instructions here:
https://github.com/dimagi/core-hq/blob/master/corehq/apps/builds/README.md

Cheers,
Danny

2012/4/3 Michael Champanis michael.champanis@gmail.com

Hi,

After installing CommCare HQ and setting up a new project, then
application, somewhere during editing the module in the application and
creating a new form causes my install to break:

{"error":"reduce_overflow_error","reason":"Reduce output must shrink more
rapidly: Current output: '[{"xmlns": "
http://openrosa.org/formdesigner/6B57A9F7-7DB4-4D76-BF53-3E7587F154D4\",\"app\":
{"name": "'... (first 100 of 279 bytes)"}
Full paste: commcarehq - Pastebin.com

If I open another page in a new tab (e.g. Settings page) I get that
error, but the application editor in the first tab continues working. If I
delete the module I'm working on the error goes away in the second tab
after refreshing.

Any ideas?

I haven't added any CommCare builds to HQ at this point - is this maybe
related?

Relatedly, how do I add a CommCare build to HQ? :stuck_out_tongue: I see there's a
add_commcare_build command in manage.py that expects a zip file - is this a
zip with the jar and jad inside?

Michael