Announcement

Collapse
No announcement yet.

Script to list events that have script actions - Discussion Thread

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #46
    I just tried to install, and well of course I could move the files, but when starting the http request, it fails:

    Application Exception

    System.Web.Compilation.CompilationException

    error VBNC30248: CHANGEME

    Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error.
    Details: error VBNC30248: CHANGEME
    Error origin: Compiler
    Error source file: ~/Global.asax
    Exception stack trace:
    at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath, System.CodeDom.Compiler.CompilerParameters options) [0x00312] in <073af6121b254feeb95194201dde8360>:0 at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath) [0x00008] in <073af6121b254feeb95194201dde8360>:0 at System.Web.Compilation.BuildManager.GenerateAssembly (System.Web.Compilation.AssemblyBuilder abuilder, System.Web.Compilation.BuildProviderGroup group, System.Web.VirtualPath vp, System.Boolean debug) [0x00202] in <073af6121b254feeb95194201dde8360>:0 at System.Web.Compilation.BuildManager.BuildInner (System.Web.VirtualPath vp, System.Boolean debug) [0x00106] in <073af6121b254feeb95194201dde8360>:0
    For the record, here is some info about Mono from the error output above:
    Version Information: 5.18.0.225 (tarball Fri Dec 21 19:32:32 UTC 2018); ASP.NET Version: 4.0.30319.42000

    Does not tell me much, but then again, I and VB is not the best of friends....

    Comment


      #47
      And this seems a bit old, since this thread is about the same error:
      https://forums.homeseer.com/forum/ho...ge-compilation

      Comment


        #48
        Applied that fix in post 3 on that thread - no difference. The last post says Mono 6 - but since Mono 6 seems well not advisable to upgrade to...?

        Comment


          #49
          Originally posted by larhedse View Post
          Applied that fix in post 3 on that thread - no difference. The last post says Mono 6 - but since Mono 6 seems well not advisable to upgrade to...?
          Thanks for trying. Not sure I can do anything to help troubleshoot it as my linux skills are minimal. Appears to be an overall HS/mono issue, and not something specific to my script/aspx file.
          HS 4.2.8.0: 2134 Devices 1252 Events
          Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

          Comment


            #50
            Na this has nothing to do with your script - this is clearly a Mono problem. I'll see if MattL0 has something cool to say about it :-)

            Comment


              #51
              This script is very handy and runs great on Windows. A few months back I attempted to get it running on Linux (HS3-std on Raspberry Pi). I got past the ASPX issues, got the paths straightened out to the point to where it was able to find and try to load the SQLite library. HS3 then stopped completely (crashed). I threw in the towel at that point. Once of several "little" things that convinced me the Linux product isn't ready for prime-time. Pity.

              Comment


                #52
                Originally posted by zwolfpack View Post
                This script is very handy and runs great on Windows. A few months back I attempted to get it running on Linux (HS3-std on Raspberry Pi). I got past the ASPX issues, got the paths straightened out to the point to where it was able to find and try to load the SQLite library. HS3 then stopped completely (crashed). I threw in the towel at that point. Once of several "little" things that convinced me the Linux product isn't ready for prime-time. Pity.
                Thanks for confirming. I'm wondering if the SQLite access to the database killed it? One thing to try is creating a backup copy of the database and then have the script access it instead. An alternate path can be provided in the config for it.
                HS 4.2.8.0: 2134 Devices 1252 Events
                Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                Comment


                  #53
                  Originally posted by larhedse View Post
                  Na this has nothing to do with your script - this is clearly a Mono problem. I'll see if MattL0 has something cool to say about it :-)
                  Lol same has you . My scripts skills are very basics, if not null.

                  Comment


                    #54
                    Sparkman - is there anyway I could use the vb-script part only and well get a list printed in the Log for example?

                    Comment


                      #55
                      Originally posted by larhedse View Post
                      Sparkman - is there anyway I could use the vb-script part only and well get a list printed in the Log for example?
                      Given the issues that zwolfpack reported, it does not look like that would work either. I'll see if I can spin up my linux laptop and try it there. However, I likely won't be able to do so till late August.
                      HS 4.2.8.0: 2134 Devices 1252 Events
                      Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                      Comment


                        #56
                        Gave this a try again tonight with same results. First off, attached are minor changes to scriptevents.aspx

                        1) changed all instances of "VbCrLf" with "Environment.NewLine". This was awhile back; presumably the former didn't work on Linux.

                        2) At line 78, changed so SQLite.dll can be found.

                        /usr/bin/vbnc is patched as follows:
                        Code:
                        #!/bin/bash
                        # mono vbnc invocation script patched for HS3 aspx compatability
                        for x
                        do
                            if [[ $x =~ ^/tmp/ && -e $x ]]
                            then
                                sed -i '1{/#External/d}' $x
                            fi
                        done
                        exec /usr/bin/mono --debug $MONO_OPTIONS /usr/lib/mono/4.5/vbnc.exe "$@"
                        mono version is 6.0.0.313

                        =======
                        Once the ASPX page loads, selected first dropdown entry... HS3 crashes

                        For possible insight to the problem, started HS3 in the foreground (using ./go).

                        Crash dump starts with

                        Code:
                        * Assertion at method-to-ir.c:3041, condition `m_class_get_rank (klass) == 0' not met
                        
                        
                        =================================================================
                                Native Crash Reporting
                        =================================================================
                        Got a SIGABRT while executing native code. This usually indicates
                        a fatal error in the mono runtime or one of the native libraries
                        used by your application.
                        =================================================================
                        Full transcript attached.
                        Attached Files

                        Comment


                          #57
                          Originally posted by zwolfpack View Post
                          Gave this a try again tonight with same results.
                          Thanks for the detailed testing. Can you also turn on debug in the script as that may give a hint how far it gets and that may pinpoint which call is causing the issue?
                          HS 4.2.8.0: 2134 Devices 1252 Events
                          Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                          Comment


                            #58
                            Sorry to be off topic.

                            zwolfpack

                            I noticed a diference between the original vbnc patch :

                            Code:
                            if [[ $x = '/tmp'* ]]
                            And the one you just posted
                            Code:
                            if [[ $x =~ ^/tmp/ && -e $x ]]
                            So I wonder what is the difference. Are there any functional/performance difference?
                            thank you

                            Comment


                              #59
                              Found a couple of things.

                              First, the database filename was built with backslash separators, which Linux doesn't accept. Easy fix.

                              Next, the crash can eliminated by commenting out the line
                              Code:
                              Blob = comm.ExecuteScalar()
                              in either of the functions 'EventsWithScripts' or 'EventsWithImmediateScriptCommands' that is to be called.

                              This is a bit crazy, because that line wasn't ever executed until the path issue was fixed! Seems the crash occurs at interpret/compile time (not run time) of either of those functions. (they are compiled right before being called, so the debugging outputs occur up til that point, then crash).

                              I tried some variations, but no success so far. Issue seems conversion to the byte array data type. It does run all the way through (reports the correct number of items found), but the results are incomplete of course.

                              It seems that mono is a bit of a mess. The initial message announcing the crash is

                              * Assertion at method-to-ir.c:3041, condition `m_class_get_rank (klass) == 0' not met

                              I get the same crash running this script

                              Code:
                              Sub Main(parm as object)
                                  Dim Blob As Byte()
                              
                                  hs.WriteLog("test", "I exist!")
                                  Blob = System.Text.Encoding.Unicode.GetBytes(parm)
                                  hs.WriteLog("test", "I survived the apocalypse!")
                              End Sub
                              which runs without complaint under Windows. (It doesn't do what I wanted, but thats a different issue...)

                              Comment


                                #60
                                I'm looking for a script that finds scripts that call other scripts...Actually what I am looking for is a script that identifies scripts that are not used at all. As far as I can tell, your tool finds only scripts that are called in an event.

                                Comment

                                Working...
                                X