Uploaded image for project: 'Form Entry Module'
  1. Form Entry Module
  2. FORM-14

FormEntry XSN download and rebuild on Linux Error: Cannot run cabextract, error=12, Cannot allocate memory

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Non-Essential
    • Resolution: Incomplete
    • Affects Version/s: None
    • Fix Version/s: None
    • Complexity:
      Undetermined

      Description

      After increasing memory on the server and adjusting tomcat memory usage, it is not possible to download or rebuild an XSN. Cabextract fails with the following error in the event log...

      ERROR - FormEntryUtil.execCmd(447) |2009-12-24 09:43:41,685| Error while executing command: '/usr/local/bin/cabextract -d /var/tmp/XSN1261665821671 /var/tmp/
      XSN-db-file1261665821670/tempContent.xsn'
      java.io.IOException: Cannot run program "/usr/local/bin/cabextract" (in directory "/var/tmp/XSN1261665821671"): java.io.IOException: error=12, Cannot allocat
      e memory
              at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
              at java.lang.Runtime.exec(Runtime.java:593)
              at java.lang.Runtime.exec(Runtime.java:431)
              at org.openmrs.module.formentry.FormEntryUtil.execCmd(FormEntryUtil.java:415)
              at org.openmrs.module.formentry.FormEntryUtil.expandXsn(FormEntryUtil.java:147)
              at org.openmrs.module.formentry.FormEntryUtil.expandXsnContents(FormEntryUtil.java:101)
              at org.openmrs.module.formentry.FormEntryUtil.getCurrentXSN(FormEntryUtil.java:255)
              at org.openmrs.module.formentry.web.FormDownloadServlet.doGet(FormDownloadServlet.java:306)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
              at org.openmrs.module.web.ModuleServlet.service(ModuleServlet.java:69)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:76)
              at org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:58)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:112)
              at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
              at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:82)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:82)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:82)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
              at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
              at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
              at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:574)
              at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1527)
              at java.lang.Thread.run(Thread.java:619)
      Caused by: java.io.IOException: java.io.IOException: error=12, Cannot allocate memory
              at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
              at java.lang.ProcessImpl.start(ProcessImpl.java:65)
              at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
              ... 48 more
      Dec 24, 2009 9:43:41 AM org.apache.catalina.core.StandardWrapperValve invoke
      SEVERE: Servlet.service() for servlet module_servlet threw exception
      java.io.IOException: Schema: 'FormEntry.xsd' cannot be null. Compiling xsn for form 4
              at org.openmrs.module.formentry.FormEntryUtil.compileXSN(FormEntryUtil.java:308)
              at org.openmrs.module.formentry.FormEntryUtil.getCurrentXSN(FormEntryUtil.java:265)
              at org.openmrs.module.formentry.web.FormDownloadServlet.doGet(FormDownloadServlet.java:306)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
              at org.openmrs.module.web.ModuleServlet.service(ModuleServlet.java:69)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:76)
              at org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:58)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:112)
              at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
              at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:82)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:82)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:82)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
              at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
              at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
              at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:574)
              at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1527)
              at java.lang.Thread.run(Thread.java:619)
      

      I tried increasing the Tomcat memory usage to about 3GB once before upgrading the server memory, and I assumed there wasn't enough free memory to use cabextract, because I got the same error.

      My Tomcat memory is currently adjusted as follows which gives the error...

      CATALINA_OPTS="-Djava.library.path=/usr/local/apr/lib -Xmx6144m -Xms6144m -XX:PermSize=3072m -XX:MaxPermSize=3072m -XX:NewSize=2048m"
      

      There is 12GB of physical memory in the system, and 3GB free...

      openmrs:/home/openmrs/.OpenMRS # free -m
                   total       used       free     shared    buffers     cached
      Mem:         11892       8826       3066          0        153       3167
      -/+ buffers/cache:       5505       6387
      Swap:         2055          0       2055
      

      I tried removing the cabextract RPM, and compiling cabextract from source (version 1.2), and get the same error. I was hoping the RPM was a 32-bit version and building it from source it could support the 64-bit memory. This was not the solution.

      When I try to extract an XSN cabinet manually, it completes fine...

      openmrs:/home/openmrs/.OpenMRS # /usr/bin/cabextract -d /var/tmp/XSN1261663845149 /srv/www/htdocs/can_delete.xsn
      Extracting cabinet: /srv/www/htdocs/can_delete.xsn
        extracting /var/tmp/XSN1261663845149/Page1.xsl
        extracting /var/tmp/XSN1261663845149/FormEntry.xsd
        extracting /var/tmp/XSN1261663845149/openmrs-infopath.js
        extracting /var/tmp/XSN1261663845149/manifest.xsf
        extracting /var/tmp/XSN1261663845149/defaults.xml
        extracting /var/tmp/XSN1261663845149/script.js
        extracting /var/tmp/XSN1261663845149/template.xml
        extracting /var/tmp/XSN1261663845149/sampledata.xml
      
      All done, no errors.
      

        Gliffy Diagrams

          Attachments

            Attachments-Category-Modification

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  arbaughj James Arbaugh
                  Watchers:
                  Burke Mamlin, Darius Jazayeri
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: