• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Import javascript library

    Scripting general Discussion
    scipting javascript
    3
    98
    74.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • phildunlapP
      phildunlap
      last edited by

      Upload your entire ma.log file. I also provided steps for trying again on a clean setup.

      A 1 Reply Last reply Reply Quote 0
      • A
        arvand.owji @phildunlap
        last edited by arvand.owji

        @phildunlap [0_1500562677214_ma.log](Uploading 100%)
        Thanks. Are you able to see this file that i just uploaded? Thanks.

        1 Reply Last reply Reply Quote 0
        • phildunlapP
          phildunlap
          last edited by

          Hi Arvand,

          No but I just changed something that might fix it. Can you try again?

          A 3 Replies Last reply Reply Quote 0
          • A
            arvand.owji @phildunlap
            last edited by

            @phildunlap [0_1500564092507_ma.log](Uploading 100%)

            1 Reply Last reply Reply Quote 0
            • A
              arvand.owji @phildunlap
              last edited by

              @phildunlap said in Import javascript library:

              Hi Arvand,

              No but I just changed something that might fix it. Can you try again?

              i odnt think its working. i can share it on google drive an send it to you privately.

              1 Reply Last reply Reply Quote 0
              • A
                arvand.owji @phildunlap
                last edited by

                @phildunlap said in Import javascript library:

                Hi Arvand,

                No but I just changed something that might fix it. Can you try again?

                Should i attempt to upgrade before trying clean?

                1 Reply Last reply Reply Quote 0
                • phildunlapP
                  phildunlap
                  last edited by

                  I do not see Timer Already Cancelled errors in your log after you restarted Mango.

                  A 1 Reply Last reply Reply Quote 0
                  • A
                    arvand.owji @phildunlap
                    last edited by

                    @phildunlap said in Import javascript library:

                    I do not see Timer Already Cancelled errors in your log after you restarted Mango.

                    my bad. that was an old log. i sent you a newer one.

                    1 Reply Last reply Reply Quote 0
                    • phildunlapP
                      phildunlap
                      last edited by

                      You ran out of memory using a large excel report. Are you using rollups? You should probably be watching the console output while you're developing your solution.

                      A 1 Reply Last reply Reply Quote 0
                      • A
                        arvand.owji @phildunlap
                        last edited by

                        @phildunlap said in Import javascript library:

                        You ran out of memory using a large excel report. Are you using rollups? You should probably be watching the console output while you're developing your solution.

                        i dont understand. what i was developing is that simple httpget, unless that javascript load issue is causing issues up again.

                        1 Reply Last reply Reply Quote 0
                        • phildunlapP
                          phildunlap
                          last edited by

                          ERROR 2017-07-19 13:31:23,974 (com.serotonin.m2m2.rt.maint.BackgroundProcessing$1.run:76) - Error in work item 
                          java.lang.OutOfMemoryError: Java heap space
                          	at org.apache.xmlbeans.impl.store.Xobj$AttrXobj.newNode(Xobj.java:2780)
                          	at org.apache.xmlbeans.impl.store.Xobj.copyNode(Xobj.java:1112)
                          	at org.apache.xmlbeans.impl.store.Xobj.copy_contents_from(Xobj.java:2337)
                          	at org.apache.xmlbeans.impl.store.Xobj.copy(Xobj.java:2411)
                          	at org.apache.xmlbeans.impl.values.XmlObjectBase._copy(XmlObjectBase.java:169)
                          	at org.apache.xmlbeans.impl.values.XmlObjectBase._copy(XmlObjectBase.java:152)
                          	at org.apache.xmlbeans.impl.values.XmlObjectBase.copy(XmlObjectBase.java:122)
                          	at org.apache.poi.xssf.usermodel.XSSFRow.onDocumentWrite(XSSFRow.java:501)
                          	at org.apache.poi.xssf.usermodel.XSSFSheet.write(XSSFSheet.java:3357)
                          	at org.apache.poi.xssf.usermodel.XSSFSheet.commit(XSSFSheet.java:3321)
                          	at org.apache.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:464)
                          	at org.apache.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:469)
                          	at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:211)
                          	at com.infiniteautomation.mango.excelreports.rt.ExcelReportWorkItem.execute(ExcelReportWorkItem.java:527)
                          	at com.serotonin.m2m2.rt.maint.BackgroundProcessing$1.run(BackgroundProcessing.java:73)
                          	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                          	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                          	at java.lang.Thread.run(Thread.java:745)
                          

                          if you are not using Excel Reports then delete whatever report this is and restart Mango.

                          A 1 Reply Last reply Reply Quote 0
                          • A
                            arvand.owji @phildunlap
                            last edited by

                            @phildunlap said in Import javascript library:

                            ERROR 2017-07-19 13:31:23,974 (com.serotonin.m2m2.rt.maint.BackgroundProcessing$1.run:76) - Error in work item 
                            java.lang.OutOfMemoryError: Java heap space
                            	at org.apache.xmlbeans.impl.store.Xobj$AttrXobj.newNode(Xobj.java:2780)
                            	at org.apache.xmlbeans.impl.store.Xobj.copyNode(Xobj.java:1112)
                            	at org.apache.xmlbeans.impl.store.Xobj.copy_contents_from(Xobj.java:2337)
                            	at org.apache.xmlbeans.impl.store.Xobj.copy(Xobj.java:2411)
                            	at org.apache.xmlbeans.impl.values.XmlObjectBase._copy(XmlObjectBase.java:169)
                            	at org.apache.xmlbeans.impl.values.XmlObjectBase._copy(XmlObjectBase.java:152)
                            	at org.apache.xmlbeans.impl.values.XmlObjectBase.copy(XmlObjectBase.java:122)
                            	at org.apache.poi.xssf.usermodel.XSSFRow.onDocumentWrite(XSSFRow.java:501)
                            	at org.apache.poi.xssf.usermodel.XSSFSheet.write(XSSFSheet.java:3357)
                            	at org.apache.poi.xssf.usermodel.XSSFSheet.commit(XSSFSheet.java:3321)
                            	at org.apache.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:464)
                            	at org.apache.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:469)
                            	at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:211)
                            	at com.infiniteautomation.mango.excelreports.rt.ExcelReportWorkItem.execute(ExcelReportWorkItem.java:527)
                            	at com.serotonin.m2m2.rt.maint.BackgroundProcessing$1.run(BackgroundProcessing.java:73)
                            	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                            	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                            	at java.lang.Thread.run(Thread.java:745)
                            

                            if you are not using Excel Reports then delete whatever report this is and restart Mango.

                            thanks. i deleted it and it worked. Now i see the httpget running. but the issue is that it runs only the first time (when i enable the datasource). My update period is set to 2 min but i dont see the time stamp for the virtual DP to be ever updated after that initial enable toggle button clicked, Thanks.

                            A 1 Reply Last reply Reply Quote 0
                            • A
                              arvand.owji @arvand.owji
                              last edited by

                              @arvand.owji said in Import javascript library:

                              @phildunlap said in Import javascript library:

                              ERROR 2017-07-19 13:31:23,974 (com.serotonin.m2m2.rt.maint.BackgroundProcessing$1.run:76) - Error in work item 
                              java.lang.OutOfMemoryError: Java heap space
                              	at org.apache.xmlbeans.impl.store.Xobj$AttrXobj.newNode(Xobj.java:2780)
                              	at org.apache.xmlbeans.impl.store.Xobj.copyNode(Xobj.java:1112)
                              	at org.apache.xmlbeans.impl.store.Xobj.copy_contents_from(Xobj.java:2337)
                              	at org.apache.xmlbeans.impl.store.Xobj.copy(Xobj.java:2411)
                              	at org.apache.xmlbeans.impl.values.XmlObjectBase._copy(XmlObjectBase.java:169)
                              	at org.apache.xmlbeans.impl.values.XmlObjectBase._copy(XmlObjectBase.java:152)
                              	at org.apache.xmlbeans.impl.values.XmlObjectBase.copy(XmlObjectBase.java:122)
                              	at org.apache.poi.xssf.usermodel.XSSFRow.onDocumentWrite(XSSFRow.java:501)
                              	at org.apache.poi.xssf.usermodel.XSSFSheet.write(XSSFSheet.java:3357)
                              	at org.apache.poi.xssf.usermodel.XSSFSheet.commit(XSSFSheet.java:3321)
                              	at org.apache.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:464)
                              	at org.apache.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:469)
                              	at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:211)
                              	at com.infiniteautomation.mango.excelreports.rt.ExcelReportWorkItem.execute(ExcelReportWorkItem.java:527)
                              	at com.serotonin.m2m2.rt.maint.BackgroundProcessing$1.run(BackgroundProcessing.java:73)
                              	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                              	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                              	at java.lang.Thread.run(Thread.java:745)
                              

                              if you are not using Excel Reports then delete whatever report this is and restart Mango.

                              thanks. i deleted it and it worked. Now i see the httpget running. but the issue is that it runs only the first time (when i enable the datasource). My update period is set to 2 min but i dont see the time stamp for the virtual DP to be ever updated after that initial enable toggle button clicked, Thanks.

                              ok, just to be exact, it does seem that it actualy updates the DP but it doesnt do it every 2 minutes. I left it since the last post and I see the value time stamp is 13:50.

                              A 1 Reply Last reply Reply Quote 0
                              • A
                                arvand.owji @arvand.owji
                                last edited by

                                @arvand.owji said in Import javascript library:

                                @arvand.owji said in Import javascript library:

                                @phildunlap said in Import javascript library:

                                ERROR 2017-07-19 13:31:23,974 (com.serotonin.m2m2.rt.maint.BackgroundProcessing$1.run:76) - Error in work item 
                                java.lang.OutOfMemoryError: Java heap space
                                	at org.apache.xmlbeans.impl.store.Xobj$AttrXobj.newNode(Xobj.java:2780)
                                	at org.apache.xmlbeans.impl.store.Xobj.copyNode(Xobj.java:1112)
                                	at org.apache.xmlbeans.impl.store.Xobj.copy_contents_from(Xobj.java:2337)
                                	at org.apache.xmlbeans.impl.store.Xobj.copy(Xobj.java:2411)
                                	at org.apache.xmlbeans.impl.values.XmlObjectBase._copy(XmlObjectBase.java:169)
                                	at org.apache.xmlbeans.impl.values.XmlObjectBase._copy(XmlObjectBase.java:152)
                                	at org.apache.xmlbeans.impl.values.XmlObjectBase.copy(XmlObjectBase.java:122)
                                	at org.apache.poi.xssf.usermodel.XSSFRow.onDocumentWrite(XSSFRow.java:501)
                                	at org.apache.poi.xssf.usermodel.XSSFSheet.write(XSSFSheet.java:3357)
                                	at org.apache.poi.xssf.usermodel.XSSFSheet.commit(XSSFSheet.java:3321)
                                	at org.apache.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:464)
                                	at org.apache.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:469)
                                	at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:211)
                                	at com.infiniteautomation.mango.excelreports.rt.ExcelReportWorkItem.execute(ExcelReportWorkItem.java:527)
                                	at com.serotonin.m2m2.rt.maint.BackgroundProcessing$1.run(BackgroundProcessing.java:73)
                                	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                                	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                                	at java.lang.Thread.run(Thread.java:745)
                                

                                if you are not using Excel Reports then delete whatever report this is and restart Mango.

                                thanks. i deleted it and it worked. Now i see the httpget running. but the issue is that it runs only the first time (when i enable the datasource). My update period is set to 2 min but i dont see the time stamp for the virtual DP to be ever updated after that initial enable toggle button clicked, Thanks.

                                ok, just to be exact, it does seem that it actualy updates the DP but it doesnt do it every 2 minutes. I left it since the last post and I see the value time stamp is 13:50.

                                ok, so the problem was that the virtual data point was set to update every 10 min and the httpget was 2 minutes. I changed virtual dp to 2 min and now its working as expected. Thanks for the help :)

                                1 Reply Last reply Reply Quote 0
                                • phildunlapP
                                  phildunlap
                                  last edited by

                                  Nice, glad you got it figured out!

                                  1 Reply Last reply Reply Quote 0
                                  • A
                                    arvand.owji
                                    last edited by

                                    Hi,
                                    Its been a while but i'm encountering a new issue that is very related to what we discussed here before. I developed the code and everything was working fine in the test box and i left it for few months. Didn't pay much attention until now.
                                    I have an HTTP Retriever that calls a local url (my file is in /opt/mango/web). This url, reads bunch of XIDs and then does some calculations and then sets bunch of other XIDs.
                                    My HTTP Retriever runs fine with no error (set on update every 2 minutes and I see it under Polls) but my values dont get updated. Its as if the code is not running. I dont see any errors in ma.log and so far i coudln't see any indication of an issue. Even when i enable/disable the data source, i still dont see the data being updated (in ma.log, i see the data source being disabled/enabled with no issue).
                                    To test the url for the http retriever, i manually ran it in a browser and it actually updated the values but if i do "curl" from the mango command prompt, i dont see the values being updated.
                                    Where can i see the actual result from HTTP Retriever, is there a log for it? Thanks.

                                    1 Reply Last reply Reply Quote 0
                                    • phildunlapP
                                      phildunlap
                                      last edited by

                                      Hi arvand,

                                      It doesn't look like there's more logging to be enabled. Be sure to keep an eye on your events, as I would expect an event to be raised in Mango if there was an error. It's possible an error is escaping to stderr, but I wouldn't think so. You can launch Mango manually with /opt/mango/bin/ma.sh start and then trigger a poll to see if there's an exception escaping.

                                      More likely than not, if the checkmark on the data source fetches the data (unless your browser has some authenticating cookie), it's going to be a problem with a point of some kind. If you've made recent edits, I would try disabling those points, or all but one, and trying again.

                                      I do not know what you mean, "but if I do curl from the mango command prompt." I don't refer to anything as the Mango command prompt. Do you mean you SSH'ed into the device?

                                      A 1 Reply Last reply Reply Quote 0
                                      • A
                                        arvand.owji @phildunlap
                                        last edited by

                                        @phildunlap said in Import javascript library:

                                        I do not know what you mean, "but if I do curl from the mango command prompt." I don't refer to anything as the Mango command prompt. Do you mean you SSH'ed into the device?

                                        What imeant was that if i ssh to the box and run curl with the url, i still dont see the values being updated. The only case that it works is to run the url through a web browser.

                                        1 Reply Last reply Reply Quote 0
                                        • phildunlapP
                                          phildunlap
                                          last edited by phildunlap

                                          Running curl on the command line doesn't do anything to Mango.

                                          So, the checkmark opens the page successfully, the checkmark on the edit point for the value regex gets the right value, curl gets the data but it doesn't update in Mango (and was never supposed to), but when polling on its own the data source gets no values? Any chance you have an authentication cookie in your browser?

                                          You can email in your json for the Http retriever and a sample document to support@infiniteautomation.com or you can post it here and I'll look at it.

                                          A 1 Reply Last reply Reply Quote 0
                                          • A
                                            arvand.owji @phildunlap
                                            last edited by

                                            @phildunlap ok thanks. im trying it on a newer box now (version 3). If it doesnt work on this one either, i will let you know. It was working fine on the old box until it stopped.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post