fastcgi-mono-server4 problem - AOT module.

Hi,

I have recently upgraded my opensuse 12.2 machine to leap 42.1.

I would like to get web server going in the form of:- nginx <> fastcgi-mono-server4 <> asp.net

I have installed and configured nginx - it appears to be woking okay (tested it at a html level).

I have installed mono and xsp, and reconfigured nginx for fastcgi, but it doesn’t work - my web browser reports a list of unhelpful asp.net type errors.

When I start fastcgi-mono-server4 with debug logging, this is what I get:-

Mono: Config attempting to parse: ‘/etc/mono/config’.
Mono: Config attempting to parse: ‘/root/.mono/config’.
Mono: Assembly Loader probing location: ‘/usr/lib/mono/4.5/mscorlib.dll’.
Mono: Image addref mscorlib[0x17a3f00] -> /usr/lib/mono/4.5/mscorlib.dll[0x17a2fa0]: 2
** Mono: AOT: module /usr/lib/mono/4.5/mscorlib.dll.so is unusable: compiled with unsupported SIMD extensions.
*

Mono: Assembly Loader loaded assembly from location: ‘/usr/lib/mono/4.5/mscorlib.dll’.
Mono: Config attempting to parse: ‘/usr/lib/mono/4.5/mscorlib.dll.config’.
Mono: Config attempting to parse: ‘/etc/mono/assemblies/mscorlib/mscorlib.config’.
Mono: Assembly mscorlib[0x17a3f00] added to domain fastcgi-mono-server4.exe, ref_count=1
Mono: Assembly Loader probing location: ‘/usr/lib/mono/4.5/fastcgi-mono-server4.exe’.
Mono: Unloading image /usr/lib/mono/gac/fastcgi-mono-server4/3.0.0.0__0738eb9f132ed756/fastcgi-mono-server4.exe [0x180e890].
Mono: Image addref fastcgi-mono-server4[0x180efe0] -> /usr/lib/mono/gac/fastcgi-mono-server4/3.0.0.0__0738eb9f132ed756/fastcgi-mono-server4.exe[0x17a1bf0]: 3
Mono: Assembly fastcgi-mono-server4[0x180efe0] added to domain fastcgi-mono-server4.exe, ref_count=1
**Mono: AOT module ‘/usr/lib/mono/gac/fastcgi-mono-server4/3.0.0.0__0738eb9f132ed756/fastcgi-mono-server4.exe.so’ not found: /usr/lib/mono/gac/fastcgi-mono-server4/3.0.0.0__0738eb9f132ed756/fastcgi-mono-server4.exe.so: cannot open shared object file: No such file or directory
**
**Mono: AOT module ‘/usr/lib/mono/aot-cache/amd64/fastcgi-mono-server4.exe.so’ not found: /usr/lib/mono/aot-cache/amd64/fastcgi-mono-server4.exe.so: cannot open shared object file: No such file or directory
**
Mono: Assembly Loader loaded assembly from location: ‘/usr/lib/mono/4.5/fastcgi-mono-server4.exe’.
Mono: Config attempting to parse: ‘/usr/lib/mono/gac/fastcgi-mono-server4/3.0.0.0__0738eb9f132ed756/fastcgi-mono-server4.exe.config’.
Mono: Config attempting to parse: ‘/etc/mono/assemblies/fastcgi-mono-server4/fastcgi-mono-server4.config’.
Mono: Assembly Loader probing location: ‘/usr/lib/mono/4.5/fastcgi-mono-server4.exe’.
Mono: Unloading image /usr/lib/mono/gac/fastcgi-mono-server4/3.0.0.0__0738eb9f132ed756/fastcgi-mono-server4.exe [0x180f070].
Mono: AOT module ‘/usr/lib/mono/gac/fastcgi-mono-server4/3.0.0.0__0738eb9f132ed756/fastcgi-mono-server4.exe.so’ not found: /usr/lib/mono/gac/fastcgi-mono-server4/3.0.0.0__0738eb9f132ed756/fastcgi-mono-server4.exe.so: cannot open shared object file: No such file or directory

Mono: AOT module ‘/usr/lib/mono/aot-cache/amd64/fastcgi-mono-server4.exe.so’ not found: /usr/lib/mono/aot-cache/amd64/fastcgi-mono-server4.exe.so: cannot open shared object file: No such file or directory

Mono: Assembly Ref addref fastcgi-mono-server4[0x180efe0] -> mscorlib[0x17a3f00]: 2
Mono: Config attempting to parse: ‘/usr/lib/mono/gac/fastcgi-mono-server4/3.0.0.0__0738eb9f132ed756/fastcgi-mono-server4.exe.config’.
Mono: Assembly Loader probing location: ‘/usr/lib/mono/4.5/Mono.WebServer2.dll’.
Mono: Image addref Mono.WebServer2[0x1816b10] -> /usr/lib/mono/gac/Mono.WebServer2/0.4.0.0__0738eb9f132ed756/Mono.WebServer2.dll[0x1813c00]: 2
Mono: Assembly Mono.WebServer2[0x1816b10] added to domain fastcgi-mono-server4.exe, ref_count=1
**Mono: AOT module ‘/usr/lib/mono/gac/Mono.WebServer2/0.4.0.0__0738eb9f132ed756/Mono.WebServer2.dll.so’ not found: /usr/lib/mono/gac/Mono.WebServer2/0.4.0.0__0738eb9f132ed756/Mono.WebServer2.dll.so: cannot open shared object file: No such file or directory
**
**Mono: AOT module ‘/usr/lib/mono/aot-cache/amd64/Mono.WebServer2.dll.so’ not found: /usr/lib/mono/aot-cache/amd64/Mono.WebServer2.dll.so: cannot open shared object file: No such file or directory
**
Mono: Assembly Loader loaded assembly from location: ‘/usr/lib/mono/4.5/Mono.WebServer2.dll’.
Mono: Config attempting to parse: ‘/usr/lib/mono/gac/Mono.WebServer2/0.4.0.0__0738eb9f132ed756/Mono.WebServer2.dll.config’.
Mono: Config attempting to parse: ‘/etc/mono/assemblies/Mono.WebServer2/Mono.WebServer2.config’.
Mono: Assembly Ref addref fastcgi-mono-server4[0x180efe0] -> Mono.WebServer2[0x1816b10]: 2
Mono: Assembly Ref addref Mono.WebServer2[0x1816b10] -> mscorlib[0x17a3f00]: 3
Mono: Assembly Loader probing location: ‘/usr/lib/mono/4.5/System.Xml.dll’.
Mono: Image addref System.Xml[0x18190d0] -> /usr/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll[0x1818390]: 2
Mono: Assembly System.Xml[0x18190d0] added to domain fastcgi-mono-server4.exe, ref_count=1
**Mono: AOT module ‘/usr/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll.so’ not found: /usr/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll.so: cannot open shared object file: No such file or directory

Mono: AOT module ‘/usr/lib/mono/aot-cache/amd64/System.Xml.dll.so’ not found: /usr/lib/mono/aot-cache/amd64/System.Xml.dll.so: cannot open shared object file: No such file or directory
**
Mono: Assembly Loader loaded assembly from location: ‘/usr/lib/mono/4.5/System.Xml.dll’.
Mono: Config attempting to parse: ‘/usr/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll.config’.
Mono: Config attempting to parse: ‘/etc/mono/assemblies/System.Xml/System.Xml.config’.
Mono: Assembly Ref addref fastcgi-mono-server4[0x180efe0] -> System.Xml[0x18190d0]: 2
Mono: Assembly Ref addref System.Xml[0x18190d0] -> mscorlib[0x17a3f00]: 4
Mono: Assembly Loader probing location: ‘/usr/lib/mono/4.5/System.dll’.
Mono: Image addref System[0x1821ab0] -> /usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll[0x1820c70]: 2
Mono: Assembly System[0x1821ab0] added to domain fastcgi-mono-server4.exe, ref_count=1
**Mono: AOT module ‘/usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll.so’ not found: /usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll.so: cannot open shared object file: No such file or directory
**
**Mono: AOT module ‘/usr/lib/mono/aot-cache/amd64/System.dll.so’ not found: /usr/lib/mono/aot-cache/amd64/System.dll.so: cannot open shared object file: No such file or directory
**
Mono: Assembly Loader loaded assembly from location: ‘/usr/lib/mono/4.5/System.dll’.
Mono: Config attempting to parse: ‘/usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll.config’.
Mono: Config attempting to parse: ‘/etc/mono/assemblies/System/System.config’.
Mono: Assembly Ref addref fastcgi-mono-server4[0x180efe0] -> System[0x1821ab0]: 2
Mono: Assembly Ref addref System[0x1821ab0] -> mscorlib[0x17a3f00]: 5
Mono: Assembly Ref addref Mono.WebServer2[0x1816b10] -> System[0x1821ab0]: 3
Mono: Assembly Ref addref System.Xml[0x18190d0] -> System[0x1821ab0]: 4
Mono: Assembly Loader probing location: ‘/usr/lib/mono/4.5/Mono.Security.dll’.
Mono: Image addref Mono.Security[0x1ba7920] -> /usr/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll[0x1ba4c60]: 2
Mono: Assembly Mono.Security[0x1ba7920] added to domain fastcgi-mono-server4.exe, ref_count=1
**Mono: AOT module ‘/usr/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll.so’ not found: /usr/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll.so: cannot open shared object file: No such file or directory

Mono: AOT module ‘/usr/lib/mono/aot-cache/amd64/Mono.Security.dll.so’ not found: /usr/lib/mono/aot-cache/amd64/Mono.Security.dll.so: cannot open shared object file: No such file or directory
**
Mono: Assembly Loader loaded assembly from location: ‘/usr/lib/mono/4.5/Mono.Security.dll’.
Mono: Config attempting to parse: ‘/usr/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll.config’.
Mono: Config attempting to parse: ‘/etc/mono/assemblies/Mono.Security/Mono.Security.config’.
Mono: Assembly Ref addref Mono.Security[0x1ba7920] -> mscorlib[0x17a3f00]: 6
Mono: Assembly Loader probing location: ‘/usr/lib/mono/4.5/System.Configuration.dll’.
Mono: Image addref System.Configuration[0x198bca0] -> /usr/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll[0x19b1f90]: 2
Mono: Assembly System.Configuration[0x198bca0] added to domain fastcgi-mono-server4.exe, ref_count=1
**Mono: AOT module ‘/usr/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll.so’ not found: /usr/li[2016-06-02 12:33:42Z] Debug fastcgi-mono-server4


It seems that mono is not happy with installation. Or at least the AOT module. Can anyone help?

Thanks in advance.
Peter

You should post your nginx server configuration (most likely the command you use to invoke nginx including all flags).
Include any Guides or links to documentation you may be following to set up your Server.

And, use normal fonts, enclosing your log results (and any other code) in the CODE tags (the hash button)

TSU

Thank you for your advice TSU. I am new to this site.

My nginx conf are as follows (this server serves two pages as domainipaddress/subpage1<asp.net> or domainipaddress/subpage2<html>):-

server {
    listen 80;

    server_name domainipaddress;

    location / {
        root /srv/www/;
    }

    location /subpage1 {
        root /srv/www/example1.com/subpage1/;
        index Default.aspx;
        fastcgi_index Default.aspx;
        fastcgi_pass 127.0.0.1:9000;
        
        fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
        fastcgi_param  QUERY_STRING       $query_string;
        fastcgi_param  REQUEST_METHOD     $request_method;
        fastcgi_param  CONTENT_TYPE       $content_type;
        fastcgi_param  CONTENT_LENGTH     $content_length;

        fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
        fastcgi_param  REQUEST_URI        $request_uri;
        fastcgi_param  DOCUMENT_URI       $document_uri;
        fastcgi_param  DOCUMENT_ROOT      $document_root;
        fastcgi_param  SERVER_PROTOCOL    $server_protocol;
        fastcgi_param  HTTPS              $https if_not_empty;

        fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
        fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

        fastcgi_param  REMOTE_ADDR        $remote_addr;
        fastcgi_param  REMOTE_PORT        $remote_port;
        fastcgi_param  SERVER_ADDR        $server_addr;
        fastcgi_param  SERVER_PORT        $server_port;
        fastcgi_param  SERVER_NAME        $server_name;
        
    }

    location /subpage2 {
        root /srv/www/example2.com/;
    }
    
    
    error_page  404      /errordocs/404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /errordocs/;
    }

}

Testing and logging has proven that this issue is mostlikely with mono/ fastcgi-mono-server4.

Since posting this I can add that if I examine the version numbers of mono, xsp, and fastcgi-mono-server4 thse are the results I get:-

 #mono -V
    Mono JIT compiler version 4.0.4 (Stable 4.0.4.1/5ab4c0d Sun Oct 25 12:51:49 UTC 2015)
    Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug 
        LLVM:          supported, not enabled.
        GC:            sgen

    #xsp -V
Exception caught during reading the configuration file:
System.InvalidProgramException: Invalid IL code in System.Configuration.ConfigurationManager:get_AppSettings (): IL_0000: ret       


  at Mono.WebServer.XSP.Server.get_AppSettings () [0x00000] in <filename unknown>:0 
  at Mono.WebServer.XSP.Server+ApplicationSettings..ctor () [0x00000] in <filename unknown>:0 
XSP server is a sample server that hosts the ASP.NET runtime in a
minimalistic HTTP server

    #fastcgi-mono-server --version
    Unhandled Exception:
    System.InvalidProgramException: Invalid IL code in System.Xml.XmlDocument:GetElementsByTagName (string): IL_0000: ret       


      at Mono.WebServer.ConfigurationManager.ImportSettings (System.Xml.XmlDocument doc, System.Collections.Specialized.NameValueCollection collection, Boolean allowDuplicates, Boolean insertEmptyValue) [0x00000] in <filename unknown>:0 
      at Mono.WebServer.ConfigurationManager..ctor (System.Reflection.Assembly asm, System.String resource) [0x00000] in <filename unknown>:0 
      at Mono.WebServer.FastCgi.Server.Main (System.String] args) [0x00000] in <filename unknown>:0 
    [ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidProgramException: Invalid IL code in System.Xml.XmlDocument:GetElementsByTagName (string): IL_0000: ret       


      at Mono.WebServer.ConfigurationManager.ImportSettings (System.Xml.XmlDocument doc, System.Collections.Specialized.NameValueCollection collection, Boolean allowDuplicates, Boolean insertEmptyValue) [0x00000] in <filename unknown>:0 
      at Mono.WebServer.ConfigurationManager..ctor (System.Reflection.Assembly asm, System.String resource) [0x00000] in <filename unknown>:0 
      at Mono.WebServer.FastCgi.Server.Main (System.String] args) [0x00000] in <filename unknown>:0 

I should also add that this machine is a x86_64.

OK,
Also provide the Guide for what you are doing, in particular the reference example or template you used to build your configuration file.

It looks very different than what is described in the nginx documentation for mono and fastcgi
https://www.nginx.com/resources/wiki/start/topics/examples/mono/

Your configuration file might be valid, but is important where it came from.

TSU

Thank you for your question TSU.

The nginx conf has been developed through templates, experimentation, debugging, and logging. This works in this situation. Logging is showing that the info passed by nginx to fastcgi-mono-server4 is in good order and contition. I’m happy to answer any specific questions about the nginx conf from this development, as best I can. However, in this case all the evidence is saying that xsp/fastcgi-mono-server4 are not well, as can be seen above, just by asking for their version number detail. I installed these via yast, perhaps I need to build them on this machine… Do you know how to do this, or where I should look?

Thanks
Peter

  1. Verifying, this is a machine which had your mono web server running in 12.2, then was upgraded to LEAP 42.1
    If this is the case, pls verify that you upgraded your system incrementally, 12.2 > 12.3 > 13.1 > 42.1 or did you upgrade in one step?

  2. Please list your currently installed Mono packages by running the following command in a console. Since your installed nginx mono configuration is homegrown, this at least gives me some idea what you’ve constructed.

zypper se -i mono
  1. It might be useful to know if you are using packages only from the OSS or any special repos. Packages from special repos can provide better, more recent or more featured packages than using standard packages from the OSS
zypper lr -d
  1. Standard ways to find files which may be missing are
    a. Using zypper
zypper se --provides *missing_file *

b. Search for the file at
https://software.opensuse.org

c. Use “cnf” eg

cnf *file* 

TSU

Here’s something you might also try

As usual, decide how you want to test this. If the file system under your root partition and webserver isn’t BTRFS, you may want to use some reliable way to rollbaock. Personally, I’d recommend cloning your machine into a virtual machine using a P2V utility for testing.

Am personally speculating that basic mono fastcgi functionality is likely the same no matter the many possible applications for various servers, so I looked for a pre-built mono fastcgi webserver and found xsp. So, I’m speculating that if you install this package, it should ensure that all the libraries needed to run nginx fastcgi are installed as well.

zypper in xsp

If you want to explore xsp,
You can run the standard “help”

xsp --help

or read the small bit of documentation

cat /usr/share/doc/packages/xsp/README

TSU

Thank you for your reply TSU. I have resovled this issue.

But to answer your questions:-

This was a spare machine which required some re-partitioning and formatting for this new purpose so, it went directly from 12.2 to 42.1 (via an iso on a usb memory strick).

I installed it a couple of times until I worked out that there was an invalid entry put into the repositry during the installation (others speak of this issue on various forums). I’m wonding if this is the stem of my problems.

I can’t remember if I tried all of the things you have suggested, but I do recall doing most of them without getting any sign of a problem.

I installed xsp (and mono) via yast & zypper several times without improvment. Finally, I tried installing directly from

https://software.opensuse.org/package/xsp

This has made the crital difference for me - fastcgi-mono-server4 no longer complains about unhandled exceptions. However, xsp still does. But given that I don’t really want xsp, it doesn’t worry me.

My nginx <> fast-mono-server4 <> asp.net web server is WORKING!

Now to do something clever with it…

Thanks for your help
Peter

I’d still recommend you do a zypper dup (after taking a snapshot or cloning a copy) to try to resolve inconsistencies in your system.

The worry is that your system might be functional now, but only by a chance combination of factors. The next update could break everything, so it’s probably better to find problems and fix them now if possible.

Or,
Your problem running xsp might be easily answered…

Depending on how your main webserver is set to run (on boot for instance), once that is up and running bound to a network interface configured to use specific ports…

You can’t then start up a different webserver configured to use the same interface and ports (most default scripts will bind to the non-loopback externally facing network interface using port 80 for example). If you do this, that would generate an error.

TSU

Thank you for your advice TSU.

I’ve had a chance to duplicate this installation on a different machine, with much better results. I beleive that this problem (and other similar issues) are stemming from a bug in the installation procedure in “openSUSE-Leap-42.1-DVD-x86_64.iso” (on a USB memory stick) - where, it puts (and leaves) a reference in the repository pointing to the installation image (as a USB mount “/dev/st…”).

The VERY FIRST thing you need to do after the installation is to use either yast or zypper to remove this item. Then do a #zypper patch.

Networking, Samba, printing, fastcgi-mono-server4, etc - all worked first time!

xsp still complains (same as the first machine). There is no other web server running. The ‘/etc/xsp/’ folder is empty, and it may require minimal config for it not to complain… I’m not using xsp, so I’m not going to pursue this further (at this time).

Thanks again
Peter

Congrats.
With every new install, you should do an “update” immediately at least once to fully pull in all new features and fixes to get off on the right foot. After that, you can decide whether to just “patch” for maximum stability or continue to “update” to receive later improvements, not just fixes.

zypper update

TSU