Announcement

Collapse
No announcement yet.

Script Stopped Working (no change)

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

    Script Stopped Working (no change)

    I'm suddenly getting this: System.BadImageFormatException

    Description: HTTP 500.Error processing request.

    Details: Non-web exception.

    Exception stack trace:

    at (wrapper managed-to-native) System.Reflection.Assembly:LoadFrom (string,bool) at System.Reflection.Assembly.LoadFrom (System.String assemblyFile) [0x00000] in <a07d6bf484a54da2861691df910339b1>:0 at System.Web.UI.TemplateParser.AddAssemblyForNamespace (System.String namesp) [0x000ce] in <843cde98ab8b40878319d3e0f2707fbc>:0 at System.Web.UI.TemplateParser.AddImport (System.String namesp) [0x00040] in <843cde98ab8b40878319d3e0f2707fbc>:0 at System.Web.UI.TemplateParser.AddDirective (System.String directive, System.Collections.IDictionary atts) [0x00189] in <843cde98ab8b40878319d3e0f2707fbc>:0 at System.Web.UI.TemplateControlParser.AddDirective (System.String directive, System.Collections.IDictionary atts) [0x001f8] in <843cde98ab8b40878319d3e0f2707fbc>:0 at System.Web.UI.PageParser.AddDirective (System.String directive, System.Collections.IDictionary atts) [0x00135] in <843cde98ab8b40878319d3e0f2707fbc>:0 at System.Web.Compilation.AspGenerator.TagParsed (System.Web.Compilation.ILocation location, System.Web.Compilation.TagType tagtype, System.String tagid, System.Web.Compilation.TagAttributes attributes) [0x000d8] in <843cde98ab8b40878319d3e0f2707fbc>:0 at System.Web.Compilation.AspParser.OnTagParsed (System.Web.Compilation.TagType tagtype, System.String id, System.Web.Compilation.TagAttributes attributes) [0x00019] in <843cde98ab8b40878319d3e0f2707fbc>:0 at System.Web.Compilation.AspParser.Parse () [0x000ff] in <843cde98ab8b40878319d3e0f2707fbc>:0 at System.Web.Compilation.AspGenerator.Parse (System.IO.TextReader reader, System.String filename, System.Boolean doInitParser) [0x00031] in <843cde98ab8b40878319d3e0f2707fbc>:0 at System.Web.Compilation.GenericBuildProvider`1[TParser].Parse () [0x0003c] in <843cde98ab8b40878319d3e0f2707fbc>:0 at System.Web.Compilation.GenericBuildProvider`1[TParser].GenerateCode () [0x00000] in <843cde98ab8b40878319d3e0f2707fbc>:0 at System.Web.Compilation.GenericBuildProvider`1[TParser].GenerateCode (System.Web.Compilation.AssemblyBuilder assemblyBuilder) [0x00008] in <843cde98ab8b40878319d3e0f2707fbc>:0 at System.Web.Compilation.BuildManager.GenerateAssembly (System.Web.Compilation.AssemblyBuilder abuilder, System.Web.Compilation.BuildProviderGroup group, System.Web.VirtualPath vp, System.Boolean debug) [0x00077] in <843cde98ab8b40878319d3e0f2707fbc>:0

    The only changes to my system is adding the BLStat plugin.

    The previously working script is super basic (pun intended):
    Code:
    <%@ Page Language="VB" Debug="true" ValidateRequest="false" %>
    <%@ Import Namespace="System.Text" %>
    <%@ Import Namespace="System.Diagnostics" %>
    <%@ Import Namespace="System.IO" %>
    <%@ Import Namespace="System.IO.StreamReader" %>
    
      <script runat="server">
      Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
    Dim psi As New ProcessStartInfo()
    
    psi.FileName = "/bin/bash"
    psi.Arguments = "-c ""/usr/local/myscript.sh"""
    psi.RedirectStandardOutput = True
    psi.RedirectStandardError = True
    psi.CreateNoWindow = False
    psi.WindowStyle = ProcessWindowStyle.Hidden
    psi.UseShellExecute = False
    
    Dim process As Process = Process.Start(psi)
    Dim processoutput As String = process.StandardOutput.ReadToEnd()
    
    process.WaitForExit()
    response.write("<!DOCTYPE html>")
    response.write("<body>")
    
    response.write(processoutput)
    
    End Sub
    
    </script>
    </body>
    </html>
    The called bash script is unchanged and works fine via the cmd line.

    Help?

    #2
    I'm not a .NET guy (hence a call to a bash script with sed). Some googling has suggested this is possibly an architecture mismatch with 32-bit vs 64-bit DLLs. I haven't explicitly touched an DLLS -- just install / uninstall some plugins. Somehow something has gone off this rails with a very basic System.IO.StreamReader . Any pointers on how get more useful debug info? /usr/lib/mono/gac is I presume where I should look?

    Comment


      #3
      I have seen in another thread that http client in mono 6 is broken. In mono 5 it works. Could you have a mono update behind the scenes?

      Comment


        #4
        Thanks - I’ll check into that. I’m running a stock HomeTroller SEL Pro so hopefully that’s not on a regular update regime...

        Comment


          #5
          I'm running 5 which appears to be what shipped with the HomeTroller SEL Pro. I show no signs that any Ubuntu packages have been updated.

          Code:
          Mono JIT compiler version 5.0.1.1 (2017-02/5077205 Thu May 25 09:18:45 UTC 2017)
          Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
              TLS:           __thread
              SIGSEGV:       altstack
              Notifications: epoll
              Architecture:  x86
              Disabled:      none
              Misc:          softdebug
              LLVM:          supported, not enabled.
              GC:            sgen (concurrent by default)
          As I mentioned, BLStat installation is the only change to my system that correlates this script crashing. I have since eradicated BLStat...though if it overwrote some system DLL that could be the issue.

          Comment


            #6
            Didn't get much help on the "Import System.IO" mysterious failure....so I circumvented the whole VB/mono thing altogether and wrote 2 lines of PHP:
            Code:
            <html>
            <body>
            <title>Recent Items</title>
            <h1>Recent Items</h1>
            <?php
            $output = shell_exec('/usr/local/myscript.sh');
            echo "$output";
            ?>
            </body>
            </html>
            I wrote this PHP file in /var/www/php (which is being served up by lighttpd on port 911 for some sort of recovery). Ends up being like 20 times faster this way!

            It's nice to see PHP was installed and ready to go. This is much cleaner code than the aforementioned VB approach. Hopefully someone finds this useful....

            Comment

            Working...
            X