Error when Saving Jasper Report

Getting thus error where saving Jasper Report

ERROR SNAPSHOT
75E091139F
Seen
Friendly Title
IOError(u'Error reading file \'./site1.local/jasper/Check Monitoring Test/CustomerReportTableNew.jrxml\': failed to load external entity "./site1.local/jasper/Check Monitoring Test/CustomerReportTableNew.jrxml"',)
Timestamp
04-13-2016 16:23:02
Relapses
8
Exception Type
<type 'exceptions.ioerror'="">
Traceback
Traceback (most recent call last):
  File "/home/sysadmin/frappe-bench/apps/frappe/frappe/app.py", line 57, in application
    response = frappe.handler.handle()
  File "/home/sysadmin/frappe-bench/apps/frappe/frappe/handler.py", line 19, in handle
    execute_cmd(cmd)
  File "/home/sysadmin/frappe-bench/apps/frappe/frappe/handler.py", line 36, in execute_cmd
    ret = frappe.call(method, **frappe.form_dict)
  File "/home/sysadmin/frappe-bench/apps/frappe/frappe/__init__.py", line 805, in call
    return fn(*args, **newargs)
  File "/home/sysadmin/frappe-bench/apps/frappe/frappe/desk/form/save.py", line 18, in savedocs
    doc.save()
  File "/home/sysadmin/frappe-bench/apps/frappe/frappe/model/document.py", line 244, in save
    self.run_before_save_methods()
  File "/home/sysadmin/frappe-bench/apps/frappe/frappe/model/document.py", line 618, in run_before_save_methods
    self.run_method("before_save")
  File "/home/sysadmin/frappe-bench/apps/frappe/frappe/model/document.py", line 579, in run_method
    return Document.hook(fn)(self, *args, **kwargs)
  File "/home/sysadmin/frappe-bench/apps/frappe/frappe/model/document.py", line 735, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/sysadmin/frappe-bench/apps/frappe/frappe/model/document.py", line 718, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/sysadmin/frappe-bench/apps/frappe/frappe/model/document.py", line 573, in 
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/sysadmin/frappe-bench/apps/jasper_erpnext_report/jasper_erpnext_report/jasper_erpnext_report/doctype/jasper_reports/jasper_reports.py", line 76, in before_save
    xmldoc = JasperXmlReport(jrxml_path)
  File "/home/sysadmin/frappe-bench/apps/jasper_erpnext_report/jasper_erpnext_report/utils/jrxml.py", line 12, in __init__
    self.xmldoc = etree.parse(xmlfile, parser)
  File "src/lxml/lxml.etree.pyx", line 3427, in lxml.etree.parse (src/lxml/lxml.etree.c:79801)
  File "src/lxml/parser.pxi", line 1782, in lxml.etree._parseDocument (src/lxml/lxml.etree.c:115995)
  File "src/lxml/parser.pxi", line 1808, in lxml.etree._parseDocumentFromURL (src/lxml/lxml.etree.c:116345)
  File "src/lxml/parser.pxi", line 1712, in lxml.etree._parseDocFromFile (src/lxml/lxml.etree.c:115233)
  File "src/lxml/parser.pxi", line 1115, in lxml.etree._BaseParser._parseDocFromFile (src/lxml/lxml.etree.c:109930)
  File "src/lxml/parser.pxi", line 573, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:103404)
  File "src/lxml/parser.pxi", line 683, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:105058)
  File "src/lxml/parser.pxi", line 611, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:103924)
IOError: Error reading file './site1.local/jasper/Check Monitoring Test/CustomerReportTableNew.jrxml': failed to load external entity "./site1.local/jasper/Check Monitoring Test/CustomerReportTableNew.jrxml"
Pyver
Python 2.7.6: /home/sysadmin/frappe-bench/env/bin/python (prefix: /home/sysadmin/frappe-bench/env)
Exception
{
 "args": "(u'Error reading file \\'./site1.local/jasper/Chec...ck Monitoring Test/CustomerReportTableNew.jrxml\"',)", 
 "errno": "None", 
 "filename": "None", 
 "message": "Error reading file './site1.local/jasper/Chec...ck Monitoring Test/CustomerReportTableNew.jrxml\"", 
 "strerror": "None"
}
Locals
{
 "AncestorsIterator": "", 
 "AttributeBasedElementClassLookup": "", 
 "C14NError": "", 
 "CDATA": "", 
 "Comment": "", 
 "CommentBase": "", 
 "CustomElementClassLookup": "", 
 "DEBUG": "1", 
 "DTD": "", 
 "DTDError": "", 
 "DTDParseError": "", 
 "DTDValidateError": "", 
 "DocInfo": "", 
 "DocumentInvalid": "", 
 "ETCompatXMLParser": "", 
 "ETXPath": "", 
 "Element": "", 
 "ElementBase": "", 
 "ElementChildIterator": "", 
 "ElementClassLookup": "", 
 "ElementDefaultClassLookup": "", 
 "ElementDepthFirstIterator": "", 
 "ElementNamespaceClassLookup": "", 
 "ElementTextIterator": "", 
 "ElementTree": "", 
 "Entity": "", 
 "EntityBase": "", 
 "Error": "", 
 "ErrorDomains": "", 
 "ErrorLevels": "", 
 "ErrorTypes": "", 
 "Extension": "", 
 "FallbackElementClassLookup": "", 
 "FunctionNamespace": "", 
 "HTML": "", 
 "HTMLParser": "", 
 "HTMLPullParser": "", 
 "LIBXML_COMPILED_VERSION": "(2, 9, 1)", 
 "LIBXML_VERSION": "(2, 9, 1)", 
 "LIBXSLT_COMPILED_VERSION": "(1, 1, 28)", 
 "LIBXSLT_VERSION": "(1, 1, 28)", 
 "LXML_VERSION": "(3, 6, 0, 0)", 
 "LxmlError": "", 
 "LxmlRegistryError": "", 
 "LxmlSyntaxError": "", 
 "NamespaceRegistryError": "", 
 "PI": "", 
 "PIBase": "", 
 "ParseError": "", 
 "ParserBasedElementClassLookup": "", 
 "ParserError": "", 
 "ProcessingInstruction": "", 
 "PyErrorLog": "", 
 "PythonElementClassLookup": "", 
 "QName": "", 
 "RelaxNG": "", 
 "RelaxNGError": "", 
 "RelaxNGErrorTypes": "", 
 "RelaxNGParseError": "", 
 "RelaxNGValidateError": "", 
 "Resolver": "", 
 "Schematron": "", 
 "SchematronError": "", 
 "SchematronParseError": "", 
 "SchematronValidateError": "", 
 "SerialisationError": "", 
 "SiblingsIterator": "", 
 "SubElement": "", 
 "TreeBuilder": "", 
 "XInclude": "", 
 "XIncludeError": "", 
 "XML": "", 
 "XMLDTDID": "", 
 "XMLID": "", 
 "XMLParser": "", 
 "XMLPullParser": "", 
 "XMLSchema": "", 
 "XMLSchemaError": "", 
 "XMLSchemaParseError": "", 
 "XMLSchemaValidateError": "", 
 "XMLSyntaxError": "", 
 "XMLTreeBuilder": "", 
 "XPath": "", 
 "XPathDocumentEvaluator": "", 
 "XPathElementEvaluator": "", 
 "XPathError": "", 
 "XPathEvalError": "", 
 "XPathEvaluator": "", 
 "XPathFunctionError": "", 
 "XPathResultError": "", 
 "XPathSyntaxError": "", 
 "XSLT": "", 
 "XSLTAccessControl": "", 
 "XSLTApplyError": "", 
 "XSLTError": "", 
 "XSLTExtension": "", 
 "XSLTExtensionError": "", 
 "XSLTParseError": "", 
 "XSLTSaveError": "", 
 "_Attrib": "", 
 "_BaseErrorLog": "", 
 "_Comment": "", 
 "_Document": "", 
 "_DomainErrorLog": "", 
 "_Element": "", 
 "_ElementIterator": "", 
 "_ElementMatchIterator": "", 
 "_ElementStringResult": "", 
 "_ElementTagMatcher": "", 
 "_ElementTree": "", 
 "_ElementUnicodeResult": "", 
 "_Entity": "", 
 "_ErrorLog": "", 
 "_FeedParser": "", 
 "_IDDict": "", 
 "_ListErrorLog": "", 
 "_LogEntry": "", 
 "_ProcessingInstruction": "", 
 "_RotatingErrorLog": "", 
 "_SaxParserTarget": "", 
 "_TargetParserResult": "", 
 "_Validator": "", 
 "_XPathEvaluatorBase": "", 
 "_XSLTProcessingInstruction": "", 
 "_XSLTResultTree": "", 
 "__all__": "['AttributeBasedElementClassLookup', 'C14NError', 'CDATA', 'Comment', 'CommentBase', 'CustomElementClassLookup', 'DEBUG', 'DTD', 'DTDError', 'DTDParseError', 'DTDValidateError', 'DocumentInvalid', 'ETCompatXMLParser', 'ETXPath', 'Element', 'ElementBase', 'ElementClassLookup', 'ElementDefaultClassLookup', 'ElementNamespaceClassLookup', 'ElementTree', ...]", 
 "__builtins__": "", 
 "__doc__": "'\\nThe ``lxml.etree`` module implements the extended ElementTree API for XML.\\n'", 
 "__docformat__": "u'restructuredtext en'", 
 "__file__": "'/home/sysadmin/frappe-bench/env/local/lib/python2.7/site-packages/lxml/etree.so'", 
 "__name__": "'lxml.etree'", 
 "__package__": "None", 
 "__pyx_capi__": "{'appendChild': , 'appendChildToElement': , 'attributeValue': , 'attributeValueFromNsName': , 'callLookupFallback': , 'collectAttributes': , 'deepcopyNodeToDocument': , 'delAttribute': , 'delAttributeFromNsName': , 'documentOrRaise': , ...}", 
 "__test__": "{u'XML (line 3167)': u'XML(text, parser=None, base_url=None)\\n\\n    P...ternal entities\\n    (DTD, XInclude, ...).\\n    '}", 
 "__version__": "u'3.6.0'", 
 "cleanup_namespaces": "", 
 "clear_error_log": "", 
 "dump": "", 
 "fromstring": "", 
 "fromstringlist": "", 
 "get_default_parser": "", 
 "htmlfile": "", 
 "iselement": "", 
 "iterparse": "", 
 "iterwalk": "", 
 "memory_debugger": "", 
 "parse": "", 
 "parseid": "", 
 "register_namespace": "", 
 "set_default_parser": "", 
 "set_element_class_lookup": "", 
 "strip_attributes": "", 
 "strip_elements": "", 
 "strip_tags": "", 
 "tostring": "", 
 "tostringlist": "", 
 "tounicode": "", 
 "use_global_python_log": "", 
 "xmlfile": ""
}
Frames
[
 {
  "call": "(request=)", 
  "dump": {
   "frappe. handler": "", 
   "frappe.handler. handle": "", 
   "global frappe": "", 
   "response": "None"
  }, 
  "file": "/home/sysadmin/frappe-bench/apps/frappe/frappe/app.py", 
  "func": "application", 
  "lines": {
   "55": "", 
   "56": "\t\tif frappe.local.form_dict.cmd:", 
   "57": "\t\t\tresponse = frappe.handler.handle()", 
   "58": "", 
   "59": "\t\telif frappe.request.path.startswith(\"/api/\"):"
  }, 
  "lnum": 57
 }, 
 {
  "call": "()", 
  "dump": {
   "cmd": "u'frappe.desk.form.save.savedocs'", 
   "global execute_cmd": ""
  }, 
  "file": "/home/sysadmin/frappe-bench/apps/frappe/frappe/handler.py", 
  "func": "handle", 
  "lines": {
   "17": "", 
   "18": "\tif cmd!='login':", 
   "19": "\t\texecute_cmd(cmd)", 
   "20": "", 
   "21": "\treturn build_response(\"json\")"
  }, 
  "lnum": 19
 }, 
 {
  "call": "(cmd=u'frappe.desk.form.save.savedocs', from_async=False)", 
  "dump": {
   "frappe. call": "", 
   "frappe. form_dict": "{'action': u'Save', 'doc': u'{\"jasper_report_ori...d\":1}', 'cmd': u'frappe.desk.form.save.savedocs'}", 
   "global frappe": "", 
   "method": "", 
   "ret": "undefined"
  }, 
  "file": "/home/sysadmin/frappe-bench/apps/frappe/frappe/handler.py", 
  "func": "execute_cmd", 
  "lines": {
   "34": "\tis_whitelisted(method)", 
   "35": "", 
   "36": "\tret = frappe.call(method, **frappe.form_dict)", 
   "37": "", 
   "38": "\t# returns with a message"
  }, 
  "lnum": 36
 }, 
 {
  "call": "(fn=, *args=(), **kwargs={'action': u'Save', 'cmd': u'frappe.desk.form.save.savedocs', 'doc': u'{\"jasper_report_origin\":\"LocalServer\",\"jasper_...nc_on\":\"2016-04-13T08:21:29.523Z\",\"__unsaved\":1}'})", 
  "dump": {
   "args": "()", 
   "fn": "", 
   "newargs": "{}"
  }, 
  "file": "/home/sysadmin/frappe-bench/apps/frappe/frappe/__init__.py", 
  "func": "call", 
  "lines": {
   "803": "\t\tdel newargs[\"flags\"]", 
   "804": "", 
   "805": "\treturn fn(*args, **newargs)", 
   "806": "", 
   "807": "def make_property_setter(args, ignore_validate=False, validate_fields_for_doctype=True):"
  }, 
  "lnum": 805
 }, 
 {
  "call": "()", 
  "dump": {
   "doc": "", 
   "doc. save": ">"
  }, 
  "file": "/home/sysadmin/frappe-bench/apps/frappe/frappe/desk/form/save.py", 
  "func": "savedocs", 
  "lines": {
   "16": "\t\tdoc.docstatus = {\"Save\":0, \"Submit\": 1, \"Update\": 1, \"Cancel\": 2}[frappe.form_dict.action]", 
   "17": "\t\ttry:", 
   "18": "\t\t\tdoc.save()", 
   "19": "\t\texcept frappe.NameError, e:", 
   "20": "\t\t\tdoctype, name, original_exception = e if isinstance(e, tuple) else (doc.doctype or \"\", doc.name or \"\", None)"
  }, 
  "lnum": 18
 }, 
 {
  "call": "(self=, ignore_permissions=None)", 
  "dump": {
   "self": "", 
   "self. run_before_save_methods": ">"
  }, 
  "file": "/home/sysadmin/frappe-bench/apps/frappe/frappe/model/document.py", 
  "func": "save", 
  "lines": {
   "242": "\t\tself.set_parent_in_children()", 
   "243": "\t\tself.validate_higher_perm_levels()", 
   "244": "\t\tself.run_before_save_methods()", 
   "245": "", 
   "246": "\t\tif self._action != \"cancel\":"
  }, 
  "lnum": 244
 }, 
 {
  "call": "(self=)", 
  "dump": {
   "self": "", 
   "self. run_method": ">"
  }, 
  "file": "/home/sysadmin/frappe-bench/apps/frappe/frappe/model/document.py", 
  "func": "run_before_save_methods", 
  "lines": {
   "616": "\t\tif self._action==\"save\":", 
   "617": "\t\t\tself.run_method(\"validate\")", 
   "618": "\t\t\tself.run_method(\"before_save\")", 
   "619": "\t\telif self._action==\"submit\":", 
   "620": "\t\t\tself.run_method(\"validate\")"
  }, 
  "lnum": 618
 }, 
 {
  "call": "(self=, method=u'before_save', *args=(), **kwargs={})", 
  "dump": {
   "Document. hook": "", 
   "args": "()", 
   "fn": "", 
   "global Document": "", 
   "kwargs": "{}", 
   "self": ""
  }, 
  "file": "/home/sysadmin/frappe-bench/apps/frappe/frappe/model/document.py", 
  "func": "run_method", 
  "lines": {
   "577": "", 
   "578": "\t\tfn.__name__ = method.encode(\"utf-8\")", 
   "579": "\t\treturn Document.hook(fn)(self, *args, **kwargs)", 
   "580": "", 
   "581": "\t@staticmethod"
  }, 
  "lnum": 579
 }, 
 {
  "call": "(self=, *args=(), **kwargs={})", 
  "dump": {
   "args": "()", 
   "composed": "", 
   "kwargs": "{}", 
   "method": "'before_save'", 
   "self": ""
  }, 
  "file": "/home/sysadmin/frappe-bench/apps/frappe/frappe/model/document.py", 
  "func": "composer", 
  "lines": {
   "733": "", 
   "734": "\t\t\tcomposed = compose(f, *hooks)", 
   "735": "\t\t\treturn composed(self, method, *args, **kwargs)", 
   "736": "", 
   "737": "\t\treturn composer"
  }, 
  "lnum": 735
 }, 
 {
  "call": "(self=, method='before_save', *args=(), **kwargs={})", 
  "dump": {
   "add_to_return_value": "", 
   "args": "()", 
   "fn": "", 
   "kwargs": "{}", 
   "self": ""
  }, 
  "file": "/home/sysadmin/frappe-bench/apps/frappe/frappe/model/document.py", 
  "func": "runner", 
  "lines": {
   "716": "\t\tdef compose(fn, *hooks):", 
   "717": "\t\t\tdef runner(self, method, *args, **kwargs):", 
   "718": "\t\t\t\tadd_to_return_value(self, fn(self, *args, **kwargs))", 
   "719": "\t\t\t\tfor f in hooks:", 
   "720": "\t\t\t\t\tadd_to_return_value(self, f(self, method, *args, **kwargs))"
  }, 
  "lnum": 718
 }, 
 {
  "call": "(self=, *args=(), **kwargs={})", 
  "dump": {
   "args": "()", 
   "builtin getattr": "", 
   "fn": "undefined", 
   "kwargs": "{}", 
   "method": "u'before_save'", 
   "self": ""
  }, 
  "file": "/home/sysadmin/frappe-bench/apps/frappe/frappe/model/document.py", 
  "func": "", 
  "lines": {
   "571": "", 
   "572": "\t\tif hasattr(self, method) and hasattr(getattr(self, method), \"__call__\"):", 
   "573": "\t\t\tfn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)", 
   "574": "\t\telse:", 
   "575": "\t\t\t# hack! to run hooks even if method does not exist"
  }, 
  "lnum": 573
 }, 
 {
  "call": "(self=, method=None)", 
  "dump": {
   "global JasperXmlReport": "", 
   "jrxml_path": "u'./site1.local/jasper/Check Monitoring Test/CustomerReportTableNew.jrxml'", 
   "xmldoc": "undefined"
  }, 
  "file": "/home/sysadmin/frappe-bench/apps/jasper_erpnext_report/jasper_erpnext_report/jasper_erpnext_report/doctype/jasper_reports/jasper_reports.py", 
  "func": "before_save", 
  "lines": {
   "74": "\t\t\tself.query = ''", 
   "75": "\t\t\tjrxml_path = _get_jrxml_root_path(self)", 
   "76": "\t\t\txmldoc = JasperXmlReport(jrxml_path)", 
   "77": "\t\t\txmlname = check_if_xPath_exists(xmldoc)", 
   "78": "\t\t\tif xmlname and not check_for_report_xPath(xmldoc, xmlname, self):"
  }, 
  "lnum": 76
 }, 
 {
  "call": "(self=, xmlfile=u'./site1.local/jasper/Check Monitoring Test/CustomerReportTableNew.jrxml')", 
  "dump": {
   "etree. parse": "", 
   "global etree": "", 
   "parser": "", 
   "self": "", 
   "self.xmldoc": "undefined", 
   "xmlfile": "u'./site1.local/jasper/Check Monitoring Test/CustomerReportTableNew.jrxml'"
  }, 
  "file": "/home/sysadmin/frappe-bench/apps/jasper_erpnext_report/jasper_erpnext_report/utils/jrxml.py", 
  "func": "__init__", 
  "lines": {
   "10": "\tdef __init__(self, xmlfile=''):", 
   "11": "\t\tparser = etree.XMLParser(strip_cdata=False)", 
   "12": "\t\tself.xmldoc = etree.parse(xmlfile, parser)", 
   "13": "\t\tself.ns = 'http://jasperreports.sourceforge.net/jasperreports'", 
   "14": "\t\tself.nss = {'jr': self.ns}"
  }, 
  "lnum": 12
 }, 
 {
  "call": "()", 
  "dump": {}, 
  "file": "/home/sysadmin/frappe-bench/sites/src/lxml/lxml.etree.pyx", 
  "func": "lxml.etree.parse (src/lxml/lxml.etree.c:79801)", 
  "lines": {}, 
  "lnum": 3427
 }, 
 {
  "call": "()", 
  "dump": {}, 
  "file": "/home/sysadmin/frappe-bench/sites/src/lxml/parser.pxi", 
  "func": "lxml.etree._parseDocument (src/lxml/lxml.etree.c:115995)", 
  "lines": {}, 
  "lnum": 1782
 }, 
 {
  "call": "()", 
  "dump": {}, 
  "file": "/home/sysadmin/frappe-bench/sites/src/lxml/parser.pxi", 
  "func": "lxml.etree._parseDocumentFromURL (src/lxml/lxml.etree.c:116345)", 
  "lines": {}, 
  "lnum": 1808
 }, 
 {
  "call": "()", 
  "dump": {}, 
  "file": "/home/sysadmin/frappe-bench/sites/src/lxml/parser.pxi", 
  "func": "lxml.etree._parseDocFromFile (src/lxml/lxml.etree.c:115233)", 
  "lines": {}, 
  "lnum": 1712
 }, 
 {
  "call": "()", 
  "dump": {}, 
  "file": "/home/sysadmin/frappe-bench/sites/src/lxml/parser.pxi", 
  "func": "lxml.etree._BaseParser._parseDocFromFile (src/lxml/lxml.etree.c:109930)", 
  "lines": {}, 
  "lnum": 1115
 }, 
 {
  "call": "()", 
  "dump": {}, 
  "file": "/home/sysadmin/frappe-bench/sites/src/lxml/parser.pxi", 
  "func": "lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:103404)", 
  "lines": {}, 
  "lnum": 573
 }, 
 {
  "call": "()", 
  "dump": {}, 
  "file": "/home/sysadmin/frappe-bench/sites/src/lxml/parser.pxi", 
  "func": "lxml.etree._handleParseResult (src/lxml/lxml.etree.c:105058)", 
  "lines": {}, 
  "lnum": 683
 }, 
 {
  "call": "()", 
  "dump": {}, 
  "file": "/home/sysadmin/frappe-bench/sites/src/lxml/parser.pxi", 
  "func": "lxml.etree._raiseParseError (src/lxml/lxml.etree.c:103924)", 
  "lines": {}, 
  "lnum": 611
 }
]

Have solved this. Now I have a new error:

Please install pyjnius python module.
Error in report doctype File docname 8ac0713b81, error is: Please install pyjnius python module…

Have you tried installing the pyjnius module?

source ./frappe-bench/env/bin/activate
pip install boto

Have done this.

The error message is below when saving configuration of JasperServer.

You don’t have local server. Install python module pyjnius first.

1 Like

@jeffbangquil I have the same issue with Jasper!
Have you solved it?

Thanks