Problem with uploading cases

Hi guys,
Im trying to upload an xml file with cases but it keeps giving me some
error.
I'm attaching the file and curl error for reference. Could you let me know
where I'm going wrong ?

ERROR
The sever got itself into big trouble! Details:
{"error":"render_error","reason":"function raised error: (new
SyntaxError("syntax error", "", 13)) \nstacktrace: (null,[object
Object])@:13\nrunUpdate(function (doc, req) {var e4xmlJsonClass =
require("util/jsone4xml").e4xmlJsonClass;var base64Class =
require("util/base64").Base64;var dateFormat =
require("util/dateFormat").dateFormat;if (doc) {log("doc wasn't null!
this is unexpected! you will LOSE your information in favor of the
xml");}var content = req.body.replace(/<\?xml[^>]*\?>/, "");var
xml_content = new XML(content);doc = {};doc.form =
e4xmlJsonClass.xml2obj(xml_content);var getUuid = function (form) {if
(req.query && req.query.uid) {return req.query.uid;}meta = null;if
(form.Meta) {meta = form.Meta;} else if (form.meta) {meta = form.meta;}if
(meta && meta.uid) {return meta.uid;}if (meta && meta.instanceID) {return
meta.instanceID;}var guid = function () {var S4 = function () {return ((1 +
Math.random()) * 65536 | 0).toString(16).substring(1);};return S4() + S4()

  • S4() + S4() + S4() + S4() + S4() + S4();};return guid();};uuid =
    getUuid(doc.form);doc._id = uuid.toString();var attachments = {'form.xml':
    {content_type: "text/xml", data:
    base64Class.encode(req.body)}};doc._attachments = attachments;doc.doc_type
    = "XFormInstance";doc['#export_tag'] = "xmlns";doc.xmlns =
    doc.form['@xmlns'];doc.received_on = dateFormat(Date(),
    "isoUtcDateTime");var resp = {headers: {'Content-Type': "text/plain"},
    body: uuid.toString()};return [doc, resp];},[object Object],[object
    Array])@/opt/dbcore/share/couchjs/main.js:924\n(function (doc, req)
    {var e4xmlJsonClass = require("util/jsone4xml").e4xmlJsonClass;var
    base64Class = require("util/base64").Base64;var dateFormat =
    require("util/dateFormat").dateFormat;if (doc) {log("doc wasn't null!
    this is unexpected! you will LOSE your information in favor of the
    xml");}var content = req.body.replace(/<\?xml[^>]*\?>/, "");var
    xml_content = new XML(content);doc = {};doc.form =
    e4xmlJsonClass.xml2obj(xml_content);var getUuid = function (form) {if
    (req.query && req.query.uid) {return req.query.uid;}meta = null;if
    (form.Meta) {meta = form.Meta;} else if (form.meta) {meta = form.meta;}if
    (meta && meta.uid) {return meta.uid;}if (meta && meta.instanceID) {return
    meta.instanceID;}var guid = function () {var S4 = function () {return ((1 +
    Math.random()) * 65536 | 0).toString(16).substring(1);};return S4() + S4()
  • S4() + S4() + S4() + S4() + S4() + S4();};return guid();};uuid =
    getUuid(doc.form);doc._id = uuid.toString();var attachments = {'form.xml':
    {content_type: "text/xml", data:
    base64Class.encode(req.body)}};doc._attachments = attachments;doc.doc_type
    = "XFormInstance";doc['#export_tag'] = "xmlns";doc.xmlns =
    doc.form['@xmlns'];doc.received_on = dateFormat(Date(),
    "isoUtcDateTime");var resp = {headers: {'Content-Type': "text/plain"},
    body: uuid.toString()};return [doc, resp];},[object Object],[object
    Array])@/opt/dbcore/share/couchjs/main.js:993\n("_design/couchforms",[object
    Array],[object
    Array])@/opt/dbcore/share/couchjs/main.js:1468\n()@/opt/dbcore/share/couchjs/main.js:1512\n@/opt/dbcore/share/couchjs/main.js:1523\n"}

appilot.xml (991 Bytes)

Hi Yashseth,

I've seen the error in our logs and am looking into it.

Cory

··· On Apr 15, 2013 8:02 AM, "yashseth" wrote:

Hi guys,
Im trying to upload an xml file with cases but it keeps giving me some
error.
I'm attaching the file and curl error for reference. Could you let me know
where I'm going wrong ?

ERROR
The sever got itself into big trouble! Details:
{"error":"render_error","reason":"function raised error: (new
SyntaxError("syntax error", "", 13)) \nstacktrace: (null,[object
Object])@:13\nrunUpdate(function (doc, req) {var e4xmlJsonClass =
require("util/jsone4xml").e4xmlJsonClass;var base64Class =
require("util/base64").Base64;var dateFormat =
require("util/dateFormat").dateFormat;if (doc) {log("doc wasn't null!
this is unexpected! you will LOSE your information in favor of the
xml");}var content = req.body.replace(/<\?xml[^>]*\?>/, "");var
xml_content = new XML(content);doc = {};doc.form =
e4xmlJsonClass.xml2obj(xml_content);var getUuid = function (form) {if
(req.query && req.query.uid) {return req.query.uid;}meta = null;if
(form.Meta) {meta = form.Meta;} else if (form.meta) {meta = form.meta;}if
(meta && meta.uid) {return meta.uid;}if (meta && meta.instanceID) {return
meta.instanceID;}var guid = function () {var S4 = function () {return ((1 +
Math.random()) * 65536 | 0).toString(16).substring(1);};return S4() + S4()

  • S4() + S4() + S4() + S4() + S4() + S4();};return guid();};uuid =
    getUuid(doc.form);doc._id = uuid.toString();var attachments = {'form.xml':
    {content_type: "text/xml", data:
    base64Class.encode(req.body)}};doc._attachments = attachments;doc.doc_type
    = "XFormInstance";doc['#export_tag'] = "xmlns";doc.xmlns =
    doc.form['@xmlns'];doc.received_on = dateFormat(Date(),
    "isoUtcDateTime");var resp = {headers: {'Content-Type': "text/plain"},
    body: uuid.toString()};return [doc, resp];},[object Object],[object
    Array])@/opt/dbcore/share/couchjs/main.js:924\n(function (doc, req)
    {var e4xmlJsonClass = require("util/jsone4xml").e4xmlJsonClass;var
    base64Class = require("util/base64").Base64;var dateFormat =
    require("util/dateFormat").dateFormat;if (doc) {log("doc wasn't null!
    this is unexpected! you will LOSE your information in favor of the
    xml");}var content = req.body.replace(/<\?xml[^>]*\?>/, "");var
    xml_content = new XML(content);doc = {};doc.form =
    e4xmlJsonClass.xml2obj(xml_content);var getUuid = function (form) {if
    (req.query && req.query.uid) {return req.query.uid;}meta = null;if
    (form.Meta) {meta = form.Meta;} else if (form.meta) {meta = form.meta;}if
    (meta && meta.uid) {return meta.uid;}if (meta && meta.instanceID) {return
    meta.instanceID;}var guid = function () {var S4 = function () {return ((1 +
    Math.random()) * 65536 | 0).toString(16).substring(1);};return S4() + S4()
  • S4() + S4() + S4() + S4() + S4() + S4();};return guid();};uuid =
    getUuid(doc.form);doc._id = uuid.toString();var attachments = {'form.xml':
    {content_type: "text/xml", data:
    base64Class.encode(req.body)}};doc._attachments = attachments;doc.doc_type
    = "XFormInstance";doc['#export_tag'] = "xmlns";doc.xmlns =
    doc.form['@xmlns'];doc.received_on = dateFormat(Date(),
    "isoUtcDateTime");var resp = {headers: {'Content-Type': "text/plain"},
    body: uuid.toString()};return [doc, resp];},[object Object],[object
    Array])@/opt/dbcore/share/couchjs/main.js:993\n("_design/couchforms",[object
    Array],[object
    Array])@/opt/dbcore/share/couchjs/main.js:1468\n()@/opt/dbcore/share/couchjs/main.js:1512\n@
    /opt/dbcore/share/couchjs/main.js:1523\n"}

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Cory,
Sorry for bothering you again. But I have made a fresh xml file and removed
the BOM, also I have tried the BOM detector you linked me to (which says
there is no BOM detected) . But it is still giving me that error. I am
attaching the file. Thanks so much in advance.

try.xml (144 KB)

··· On Monday, April 15, 2013 5:32:07 PM UTC+5:30, yashseth wrote: > > Hi guys, > Im trying to upload an xml file with cases but it keeps giving me some > error. > I'm attaching the file and curl error for reference. Could you let me know > where I'm going wrong ? > > ERROR > The sever got itself into big trouble! Details: > {"error":"render_error","reason":"function raised error: (new > SyntaxError(\"syntax error\", \"\", 13)) \nstacktrace: (null,[object > Object])@:13\nrunUpdate(function (doc, req) {var e4xmlJsonClass = > require(\"util\/jsone4xml\").e4xmlJsonClass;var base64Class = > require(\"util\/base64\").Base64;var dateFormat = > require(\"util\/dateFormat\").dateFormat;if (doc) {log(\"doc wasn't null! > this is unexpected! you will LOSE your information in favor of the > xml\");}var content = req.body.replace(\/<\\?xml[^>]*\\?>\/, \"\");var > xml_content = new XML(content);doc = {};doc.form = > e4xmlJsonClass.xml2obj(xml_content);var getUuid = function (form) {if > (req.query && req.query.uid) {return req.query.uid;}meta = null;if > (form.Meta) {meta = form.Meta;} else if (form.meta) {meta = form.meta;}if > (meta && meta.uid) {return meta.uid;}if (meta && meta.instanceID) {return > meta.instanceID;}var guid = function () {var S4 = function () {return ((1 + > Math.random()) * 65536 | 0).toString(16).substring(1);};return S4() + S4() > + S4() + S4() + S4() + S4() + S4() + S4();};return guid();};uuid = > getUuid(doc.form);doc._id = uuid.toString();var attachments = {'form.xml': > {content_type: \"text\/xml\", data: > base64Class.encode(req.body)}};doc._attachments = attachments;doc.doc_type > = \"XFormInstance\";doc['#export_tag'] = \"xmlns\";doc.xmlns = > doc.form['@xmlns'];doc.received_on = dateFormat(Date(), > \"isoUtcDateTime\");var resp = {headers: {'Content-Type': \"text\/plain\"}, > body: uuid.toString()};return [doc, resp];},[object Object],[object > Array])@\/opt\/dbcore\/share\/couchjs\/main.js:924\n(function (doc, req) > {var e4xmlJsonClass = require(\"util\/jsone4xml\").e4xmlJsonClass;var > base64Class = require(\"util\/base64\").Base64;var dateFormat = > require(\"util\/dateFormat\").dateFormat;if (doc) {log(\"doc wasn't null! > this is unexpected! you will LOSE your information in favor of the > xml\");}var content = req.body.replace(\/<\\?xml[^>]*\\?>\/, \"\");var > xml_content = new XML(content);doc = {};doc.form = > e4xmlJsonClass.xml2obj(xml_content);var getUuid = function (form) {if > (req.query && req.query.uid) {return req.query.uid;}meta = null;if > (form.Meta) {meta = form.Meta;} else if (form.meta) {meta = form.meta;}if > (meta && meta.uid) {return meta.uid;}if (meta && meta.instanceID) {return > meta.instanceID;}var guid = function () {var S4 = function () {return ((1 + > Math.random()) * 65536 | 0).toString(16).substring(1);};return S4() + S4() > + S4() + S4() + S4() + S4() + S4() + S4();};return guid();};uuid = > getUuid(doc.form);doc._id = uuid.toString();var attachments = {'form.xml': > {content_type: \"text\/xml\", data: > base64Class.encode(req.body)}};doc._attachments = attachments;doc.doc_type > = \"XFormInstance\";doc['#export_tag'] = \"xmlns\";doc.xmlns = > doc.form['@xmlns'];doc.received_on = dateFormat(Date(), > \"isoUtcDateTime\");var resp = {headers: {'Content-Type': \"text\/plain\"}, > body: uuid.toString()};return [doc, resp];},[object Object],[object > Array])@\/opt\/dbcore\/share\/couchjs\/main.js:993\n(\"_design\/couchforms\",[object > Array],[object > Array])@\/opt\/dbcore\/share\/couchjs\/main.js:1468\n()@\/opt\/dbcore\/share\/couchjs\/main.js:1512\n@\/opt\/dbcore\/share\/couchjs\/main.js:1523\n"} >

Hi guys, Any luck on this ?

··· On Monday, April 15, 2013 5:32:07 PM UTC+5:30, yashseth wrote: > > Hi guys, > Im trying to upload an xml file with cases but it keeps giving me some > error. > I'm attaching the file and curl error for reference. Could you let me know > where I'm going wrong ? > > ERROR > The sever got itself into big trouble! Details: > {"error":"render_error","reason":"function raised error: (new > SyntaxError(\"syntax error\", \"\", 13)) \nstacktrace: (null,[object > Object])@:13\nrunUpdate(function (doc, req) {var e4xmlJsonClass = > require(\"util\/jsone4xml\").e4xmlJsonClass;var base64Class = > require(\"util\/base64\").Base64;var dateFormat = > require(\"util\/dateFormat\").dateFormat;if (doc) {log(\"doc wasn't null! > this is unexpected! you will LOSE your information in favor of the > xml\");}var content = req.body.replace(\/<\\?xml[^>]*\\?>\/, \"\");var > xml_content = new XML(content);doc = {};doc.form = > e4xmlJsonClass.xml2obj(xml_content);var getUuid = function (form) {if > (req.query && req.query.uid) {return req.query.uid;}meta = null;if > (form.Meta) {meta = form.Meta;} else if (form.meta) {meta = form.meta;}if > (meta && meta.uid) {return meta.uid;}if (meta && meta.instanceID) {return > meta.instanceID;}var guid = function () {var S4 = function () {return ((1 + > Math.random()) * 65536 | 0).toString(16).substring(1);};return S4() + S4() > + S4() + S4() + S4() + S4() + S4() + S4();};return guid();};uuid = > getUuid(doc.form);doc._id = uuid.toString();var attachments = {'form.xml': > {content_type: \"text\/xml\", data: > base64Class.encode(req.body)}};doc._attachments = attachments;doc.doc_type > = \"XFormInstance\";doc['#export_tag'] = \"xmlns\";doc.xmlns = > doc.form['@xmlns'];doc.received_on = dateFormat(Date(), > \"isoUtcDateTime\");var resp = {headers: {'Content-Type': \"text\/plain\"}, > body: uuid.toString()};return [doc, resp];},[object Object],[object > Array])@\/opt\/dbcore\/share\/couchjs\/main.js:924\n(function (doc, req) > {var e4xmlJsonClass = require(\"util\/jsone4xml\").e4xmlJsonClass;var > base64Class = require(\"util\/base64\").Base64;var dateFormat = > require(\"util\/dateFormat\").dateFormat;if (doc) {log(\"doc wasn't null! > this is unexpected! you will LOSE your information in favor of the > xml\");}var content = req.body.replace(\/<\\?xml[^>]*\\?>\/, \"\");var > xml_content = new XML(content);doc = {};doc.form = > e4xmlJsonClass.xml2obj(xml_content);var getUuid = function (form) {if > (req.query && req.query.uid) {return req.query.uid;}meta = null;if > (form.Meta) {meta = form.Meta;} else if (form.meta) {meta = form.meta;}if > (meta && meta.uid) {return meta.uid;}if (meta && meta.instanceID) {return > meta.instanceID;}var guid = function () {var S4 = function () {return ((1 + > Math.random()) * 65536 | 0).toString(16).substring(1);};return S4() + S4() > + S4() + S4() + S4() + S4() + S4() + S4();};return guid();};uuid = > getUuid(doc.form);doc._id = uuid.toString();var attachments = {'form.xml': > {content_type: \"text\/xml\", data: > base64Class.encode(req.body)}};doc._attachments = attachments;doc.doc_type > = \"XFormInstance\";doc['#export_tag'] = \"xmlns\";doc.xmlns = > doc.form['@xmlns'];doc.received_on = dateFormat(Date(), > \"isoUtcDateTime\");var resp = {headers: {'Content-Type': \"text\/plain\"}, > body: uuid.toString()};return [doc, resp];},[object Object],[object > Array])@\/opt\/dbcore\/share\/couchjs\/main.js:993\n(\"_design\/couchforms\",[object > Array],[object > Array])@\/opt\/dbcore\/share\/couchjs\/main.js:1468\n()@\/opt\/dbcore\/share\/couchjs\/main.js:1512\n@\/opt\/dbcore\/share\/couchjs\/main.js:1523\n"} >

Ok Thanks Cory!

··· On Mon, Apr 15, 2013 at 5:40 PM, Cory Zue wrote:

Hi Yashseth,

I've seen the error in our logs and am looking into it.

Cory
On Apr 15, 2013 8:02 AM, "yashseth" yash@digitalgreen.org wrote:

Hi guys,
Im trying to upload an xml file with cases but it keeps giving me some
error.
I'm attaching the file and curl error for reference. Could you let me
know where I'm going wrong ?

ERROR
The sever got itself into big trouble! Details:
{"error":"render_error","reason":"function raised error: (new
SyntaxError("syntax error", "", 13)) \nstacktrace: (null,[object
Object])@:13\nrunUpdate(function (doc, req) {var e4xmlJsonClass =
require("util/jsone4xml").e4xmlJsonClass;var base64Class =
require("util/base64").Base64;var dateFormat =
require("util/dateFormat").dateFormat;if (doc) {log("doc wasn't null!
this is unexpected! you will LOSE your information in favor of the
xml");}var content = req.body.replace(/<\?xml[^>]*\?>/, "");var
xml_content = new XML(content);doc = {};doc.form =
e4xmlJsonClass.xml2obj(xml_content);var getUuid = function (form) {if
(req.query && req.query.uid) {return req.query.uid;}meta = null;if
(form.Meta) {meta = form.Meta;} else if (form.meta) {meta = form.meta;}if
(meta && meta.uid) {return meta.uid;}if (meta && meta.instanceID) {return
meta.instanceID;}var guid = function () {var S4 = function () {return ((1 +
Math.random()) * 65536 | 0).toString(16).substring(1);};return S4() + S4()

  • S4() + S4() + S4() + S4() + S4() + S4();};return guid();};uuid =
    getUuid(doc.form);doc._id = uuid.toString();var attachments = {'form.xml':
    {content_type: "text/xml", data:
    base64Class.encode(req.body)}};doc._attachments = attachments;doc.doc_type
    = "XFormInstance";doc['#export_tag'] = "xmlns";doc.xmlns =
    doc.form['@xmlns'];doc.received_on = dateFormat(Date(),
    "isoUtcDateTime");var resp = {headers: {'Content-Type': "text/plain"},
    body: uuid.toString()};return [doc, resp];},[object Object],[object
    Array])@/opt/dbcore/share/couchjs/main.js:924\n(function (doc, req)
    {var e4xmlJsonClass = require("util/jsone4xml").e4xmlJsonClass;var
    base64Class = require("util/base64").Base64;var dateFormat =
    require("util/dateFormat").dateFormat;if (doc) {log("doc wasn't null!
    this is unexpected! you will LOSE your information in favor of the
    xml");}var content = req.body.replace(/<\?xml[^>]*\?>/, "");var
    xml_content = new XML(content);doc = {};doc.form =
    e4xmlJsonClass.xml2obj(xml_content);var getUuid = function (form) {if
    (req.query && req.query.uid) {return req.query.uid;}meta = null;if
    (form.Meta) {meta = form.Meta;} else if (form.meta) {meta = form.meta;}if
    (meta && meta.uid) {return meta.uid;}if (meta && meta.instanceID) {return
    meta.instanceID;}var guid = function () {var S4 = function () {return ((1 +
    Math.random()) * 65536 | 0).toString(16).substring(1);};return S4() + S4()
  • S4() + S4() + S4() + S4() + S4() + S4();};return guid();};uuid =
    getUuid(doc.form);doc._id = uuid.toString();var attachments = {'form.xml':
    {content_type: "text/xml", data:
    base64Class.encode(req.body)}};doc._attachments = attachments;doc.doc_type
    = "XFormInstance";doc['#export_tag'] = "xmlns";doc.xmlns =
    doc.form['@xmlns'];doc.received_on = dateFormat(Date(),
    "isoUtcDateTime");var resp = {headers: {'Content-Type': "text/plain"},
    body: uuid.toString()};return [doc, resp];},[object Object],[object
    Array])@/opt/dbcore/share/couchjs/main.js:993\n("_design/couchforms",[object
    Array],[object
    Array])@/opt/dbcore/share/couchjs/main.js:1468\n()@/opt/dbcore/share/couchjs/main.js:1512\n@
    /opt/dbcore/share/couchjs/main.js:1523\n"}

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to a topic in the
Google Groups "commcare-users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/commcare-users/nfjxZHUIxJE/unsubscribe?hl=en
.
To unsubscribe from this group and all its topics, send an email to
commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--

Yash Seth
Assistant Software Engineer
V +91.11.41881037
M +91.9999069251
E* *yash@digitalgreen.org rikin@digitalgreen.org
O D6 & E6, Clarion Collection( The Qutab), Shaheed Jeet Singh Marg, New
Delhi-110016, India

Like us on https://www.facebook.com/digitalgreenorghttps://www.facebook.com/digitalgreenorg

Follow us on https://twitter.com/digitalgreenorg
https://twitter.com/digitalgreenorg

Still looking. We'll follow up off thread when we know more.

cory

··· On Wed, Apr 17, 2013 at 2:01 PM, yashseth wrote:

Hi guys, Any luck on this ?

On Monday, April 15, 2013 5:32:07 PM UTC+5:30, yashseth wrote:

Hi guys,
Im trying to upload an xml file with cases but it keeps giving me some
error.
I'm attaching the file and curl error for reference. Could you let me
know where I'm going wrong ?

ERROR
The sever got itself into big trouble! Details: {"error":"render_error","
**reason":"function raised error: (new SyntaxError("syntax error",
"", 13)) \nstacktrace: (null,[object Object])@:13\nrunUpdate(*function
(doc, req) {var e4xmlJsonClass = require("util/jsone4xml").e4xmlJsonClass;var
base64Class = require("util/base64").Base64;var dateFormat =
require("util/dateFormat").dateFormat;if (doc) {log("doc wasn't
null! this is unexpected! you will LOSE your information in favor of the
xml");}var content = req.body.replace(/<\?xml[^>]
\?>/, "");var
xml_content = new XML(content);doc = {};doc.form =
e4xmlJsonClass.xml2obj(xml_content);var getUuid = function (form) {if
(req.query && req.query.uid) {return req.query.uid;}meta = null;if
(form.Meta) {meta = form.Meta;} else if (form.meta) {meta = form.meta;}if
(meta && meta.uid) {return meta.uid;}if (meta && meta.instanceID) {return
meta.instanceID;}var guid = function () {var S4 = function () {return ((1 +
Math.random()) * 65536 | 0).toString(16).substring(1);}
;return S4() +
S4() + S4() + S4() + S4() + S4() + S4() + S4();};return guid();};uuid =
getUuid(doc.form);doc._id = uuid.toString();var attachments = {'form.xml':
{content_type: "text/xml", data: base64Class.encode(req.body)}}
;doc.attachments
= attachments;doc.doc_type = "XFormInstance";doc['#**export_tag'] =
"xmlns";doc.xmlns = doc.form['@xmlns'];doc.received_on =
dateFormat(Date(), "isoUtcDateTime");var resp = {headers:
{'Content-Type': "text/plain"}, body: uuid.toString()};return [doc,
resp];},[object Object],[object Array])@/opt/dbcore/share/

couchjs/main.js:924\n(**function (doc, req) {var e4xmlJsonClass =
require("util/jsone4xml").**e4xmlJsonClass;var base64Class =
require("util/base64").*Base64;var dateFormat =
require("util/dateFormat").dateFormat;if (doc) {log("doc wasn't
null! this is unexpected! you will LOSE your information in favor of the
xml");}var content = req.body.replace(/<\?xml[^>]
\?>/, "");var
xml_content = new XML(content);doc = {};doc.form =
e4xmlJsonClass.xml2obj(xml
content);var getUuid = function (form) {if
(req.query && req.query.uid) {return req.query.uid;}meta = null;if
(form.Meta) {meta = form.Meta;} else if (form.meta) {meta = form.meta;}if
(meta && meta.uid) {return meta.uid;}if (meta && meta.instanceID) {return
meta.instanceID;}var guid = function () {var S4 = function () {return ((1 +
Math.random()) * 65536 | 0).toString(16).substring(1);}
;return S4() +
S4() + S4() + S4() + S4() + S4() + S4() + S4();};return guid();};uuid =
getUuid(doc.form);doc._id = uuid.toString();var attachments = {'form.xml':
{content_type: "text/xml", data: base64Class.encode(req.body)}}
;doc.attachments
= attachments;doc.doc_type = "XFormInstance";doc['#**export_tag'] =
"xmlns";doc.xmlns = doc.form['@xmlns'];doc.received_on =
dateFormat(Date(), "isoUtcDateTime");var resp = {headers:
{'Content-Type': "text/plain"}, body: uuid.toString()};return [doc,
resp];},[object Object],[object Array])@/opt/dbcore/share/

couchjs/main.js:993\n("
**design/couchforms",[object Array],[object
Array])@/opt/dbcore/share/couchjs/main.js:1468\n()@/
opt/dbcore/share/couchjs/main.js:1512\n@/opt/dbcore/
share/couchjs/main.js:1523**n"}

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Yash,

It looks like our xml parser is choking on a byte-order mark in your XML
file. Could you please remove this and try again?

thanks,
Cory

··· On Mon, Apr 15, 2013 at 8:11 AM, Yash Seth wrote:

Ok Thanks Cory!

On Mon, Apr 15, 2013 at 5:40 PM, Cory Zue czue@dimagi.com wrote:

Hi Yashseth,

I've seen the error in our logs and am looking into it.

Cory
On Apr 15, 2013 8:02 AM, "yashseth" yash@digitalgreen.org wrote:

Hi guys,
Im trying to upload an xml file with cases but it keeps giving me some
error.
I'm attaching the file and curl error for reference. Could you let me
know where I'm going wrong ?

ERROR
The sever got itself into big trouble! Details:
{"error":"render_error","reason":"function raised error: (new
SyntaxError("syntax error", "", 13)) \nstacktrace: (null,[object
Object])@:13\nrunUpdate(function (doc, req) {var e4xmlJsonClass =
require("util/jsone4xml").e4xmlJsonClass;var base64Class =
require("util/base64").Base64;var dateFormat =
require("util/dateFormat").dateFormat;if (doc) {log("doc wasn't null!
this is unexpected! you will LOSE your information in favor of the
xml");}var content = req.body.replace(/<\?xml[^>]*\?>/, "");var
xml_content = new XML(content);doc = {};doc.form =
e4xmlJsonClass.xml2obj(xml_content);var getUuid = function (form) {if
(req.query && req.query.uid) {return req.query.uid;}meta = null;if
(form.Meta) {meta = form.Meta;} else if (form.meta) {meta = form.meta;}if
(meta && meta.uid) {return meta.uid;}if (meta && meta.instanceID) {return
meta.instanceID;}var guid = function () {var S4 = function () {return ((1 +
Math.random()) * 65536 | 0).toString(16).substring(1);};return S4() + S4()

  • S4() + S4() + S4() + S4() + S4() + S4();};return guid();};uuid =
    getUuid(doc.form);doc._id = uuid.toString();var attachments = {'form.xml':
    {content_type: "text/xml", data:
    base64Class.encode(req.body)}};doc._attachments = attachments;doc.doc_type
    = "XFormInstance";doc['#export_tag'] = "xmlns";doc.xmlns =
    doc.form['@xmlns'];doc.received_on = dateFormat(Date(),
    "isoUtcDateTime");var resp = {headers: {'Content-Type': "text/plain"},
    body: uuid.toString()};return [doc, resp];},[object Object],[object
    Array])@/opt/dbcore/share/couchjs/main.js:924\n(function (doc, req)
    {var e4xmlJsonClass = require("util/jsone4xml").e4xmlJsonClass;var
    base64Class = require("util/base64").Base64;var dateFormat =
    require("util/dateFormat").dateFormat;if (doc) {log("doc wasn't null!
    this is unexpected! you will LOSE your information in favor of the
    xml");}var content = req.body.replace(/<\?xml[^>]*\?>/, "");var
    xml_content = new XML(content);doc = {};doc.form =
    e4xmlJsonClass.xml2obj(xml_content);var getUuid = function (form) {if
    (req.query && req.query.uid) {return req.query.uid;}meta = null;if
    (form.Meta) {meta = form.Meta;} else if (form.meta) {meta = form.meta;}if
    (meta && meta.uid) {return meta.uid;}if (meta && meta.instanceID) {return
    meta.instanceID;}var guid = function () {var S4 = function () {return ((1 +
    Math.random()) * 65536 | 0).toString(16).substring(1);};return S4() + S4()
  • S4() + S4() + S4() + S4() + S4() + S4();};return guid();};uuid =
    getUuid(doc.form);doc._id = uuid.toString();var attachments = {'form.xml':
    {content_type: "text/xml", data:
    base64Class.encode(req.body)}};doc._attachments = attachments;doc.doc_type
    = "XFormInstance";doc['#export_tag'] = "xmlns";doc.xmlns =
    doc.form['@xmlns'];doc.received_on = dateFormat(Date(),
    "isoUtcDateTime");var resp = {headers: {'Content-Type': "text/plain"},
    body: uuid.toString()};return [doc, resp];},[object Object],[object
    Array])@/opt/dbcore/share/couchjs/main.js:993\n("_design/couchforms",[object
    Array],[object
    Array])@/opt/dbcore/share/couchjs/main.js:1468\n()@/opt/dbcore/share/couchjs/main.js:1512\n@
    /opt/dbcore/share/couchjs/main.js:1523\n"}

--
You received this message because you are subscribed to the Google
Groups "commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to commcare-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to a topic in the
Google Groups "commcare-users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/commcare-users/nfjxZHUIxJE/unsubscribe?hl=en
.
To unsubscribe from this group and all its topics, send an email to
commcare-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--

Yash Seth
Assistant Software Engineer
V +91.11.41881037
M +91.9999069251
E* *yash@digitalgreen.org rikin@digitalgreen.org
O D6 & E6, Clarion Collection( The Qutab), Shaheed Jeet Singh Marg, New
Delhi-110016, India

www.digitalgreen.org

Like us on https://www.facebook.com/digitalgreenorghttps://www.facebook.com/digitalgreenorg

Follow us on https://twitter.com/digitalgreenorg
https://twitter.com/digitalgreenorg

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.