Bug 7967 - mod_mono_server broken with 3.0
Summary: mod_mono_server broken with 3.0
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-10-24 09:59 UTC by Artur Kraev
Modified: 2017-07-13 00:17 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Artur Kraev 2012-10-24 09:59:34 UTC
It looks like with mono 3.0 mod_mono_server are broken

versions: mono: 3.0
mod_mono: mod_mono-2.10
xsp: 2.10.2


Exception caught during reading the configuration file:
System.MissingMethodException: Method not found: 'System.Configuration.IConfigurationSectionHandler.Create'.
  at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String configKey) [0x00000] in <filename unknown>:0
  at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0
  at System.Configuration.ConfigurationManager.get_AppSettings () [0x00000] in <filename unknown>:0
  at Mono.WebServer.Apache.Server.get_AppSettings () [0x00001] in /usr/src/mono/xsp-2.10.2/src/Mono.WebServer.Apache/main.cs:208
  at Mono.WebServer.Apache.Server+ApplicationSettings..ctor () [0x0002a] in /usr/src/mono/xsp-2.10.2/src/Mono.WebServer.Apache/main.cs:63
Comment 1 Ben 2012-11-07 10:36:53 UTC
May I add to this.

Using mono 3.0.0, mod_mono 2.10, xsp 2.10, SUSE 12.1, Linux 3.1.10 x86_64. 

On a cold Apache start: no problem.  On a respawn the above error results.  For instance, a kill of the mod_mono process.

This will be followed by an endless repeat exception, as shown below.

This rendered mod_mono broken: it will not give a valid response to any call.  Only by restarting Apache can this be cleared.


[Mon Nov 05 11:46:34 2012] [error] (70014)End of file found: read_data failed
[Mon Nov 05 11:46:34 2012] [error] Command stream corrupted, last command was -1
System.NullReferenceException: Object reference not set to an instance of an object
  at Mono.WebServer.BaseApplicationHost.EndOfRequest (Mono.WebServer.MonoWorkerRequest mwr) [0x00000] in <filename unknown>:0
  at Mono.WebServer.ModMonoApplicationHost.ProcessRequest (Int32 reqId, System.String verb, System.String queryString, System.String path, System.String protocol, System.String localAddress, Int32 serverPort, System.String remoteAddress, Int32 remotePort, System.String remoteName, System.String[] headers, System.String[] headerValues, System.Object worker) [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) Mono.WebServer.ModMonoApplicationHost:ProcessRequest (int,string,string,string,string,string,int,string,int,string,string[],string[],object)
  at Mono.WebServer.ModMonoWorker.InnerRun (System.Object state) [0x00000] in <filename unknown>:0
  at Mono.WebServer.ModMonoWorker.Run (System.Object state) [0x00000] in <filename unknown>:0
Comment 2 Ben 2012-11-09 12:12:03 UTC
This may be down to the version of mod-mono-server and the version of .NET you are using.

So I Tried all combinations under Using mono 3.0.0, mod_mono 2.10, xsp 2.10, SUSE 12.1, Linux 3.1.10 x86_64.

Code compiled under Visual Studio 2010.  New clean build server with only one 'Hello World' .asmx method.

Testing a cold start of Apache, and respawn by killing mod-mono-server process.

ASP     mod-mono-server    Test             Result
--------------------------------------------------------
3.5     2                  Apache start     OK
3.5     2                  Respawn          OK
3.5     4                  Apache start     Fail: Exception #1
3.5     4                  Respawn          N/A
4.0     2                  Apache start     Fail: Exception #2
4.0     2                  Respawn          N/A
4.0     4                  Apache start     Fail: Exception #1
4.0     4                  Respawn          N/A


Exception #1:
============

Output in /var/log/apache2/error_log

Exception caught during reading the configuration file:
System.MissingMethodException: Method not found: 'System.Configuration.IConfigurationSectionHandler.Create'.
  at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String configKey) [0x00000] in <filename unknown>:0
  at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0
  at System.Configuration.ConfigurationManager.get_AppSettings () [0x00000] in <filename unknown>:0
  at Mono.WebServer.Apache.Server.get_AppSettings () [0x00000] in <filename unknown>:0
  at Mono.WebServer.Apache.Server+ApplicationSettings..ctor () [0x00000] in <filename unknown>:0

Exception #2:
============

Output in browser:

Non-web exception. Exception origin (name of application or object): System.Configuration.
Exception stack trace:
at System.Configuration.ConfigurationSection.DeserializeSection (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at System.Configuration.Configuration.GetSectionInstance (System.Configuration.SectionInfo config, Boolean createDefaultInstance) [0x00000] in <filename unknown>:0
at System.Configuration.ConfigurationSectionCollection.get_Item (System.String name) [0x00000] in <filename unknown>:0
at System.Configuration.Configuration.GetSection (System.String path) [0x00000] in <filename unknown>:0
at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName, System.String path, System.Web.HttpContext context) [0x00000] in <filename unknown>:0
at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName, System.String path) [0x00000] in <filename unknown>:0
at System.Web.Configuration.WebConfigurationManager.GetWebApplicationSection (System.String sectionName) [0x00000] in <filename unknown>:0
at System.Web.Compilation.BuildManager.get_CompilationConfig () [0x00000] in <filename unknown>:0
at System.Web.Compilation.BuildManager.Build (System.Web.VirtualPath vp) [0x00000] in <filename unknown>:0
at System.Web.Compilation.BuildManager.GetCompiledType (System.Web.VirtualPath virtualPath) [0x00000] in <filename unknown>:0
at System.Web.Compilation.BuildManager.GetCompiledType (System.String virtualPath) [0x00000] in <filename unknown>:0
at System.Web.HttpApplicationFactory.InitType (System.Web.HttpContext context) [0x00000] in <filename unknown>:0 

So, not a lot of success today....
Comment 3 Ben 2012-11-20 05:09:52 UTC
I believe I have some more details of what may be causing this problem.

The latest version of mod-mono in the mono repository is 2.10.0:

http://download.mono-project.com/sources/mod_mono/

This is the version where the mod-mono-server4 does not work, and therefore .NET 4.0 code cannot be run.

However there are later versions, a version 2.10.2 is kicking around somewhere which may fix this problem.  But I can't find the source for it!!

I note the GIT is up to 2.11.  It may be we will have to compile directly from this?

Ben
Comment 4 Pablo Ruiz García 2012-11-22 06:55:13 UTC
This seems to be fixed (or at least works for me), using xsp-3.0 (can be found at xsp's github site as 3.0 tag).
Comment 5 Ben 2012-11-26 04:13:37 UTC
That must be different to xsp-2.10.2, the published latest version, which does not work.  When 3,0 is live, I will test again.
Comment 6 Pablo Ruiz García 2012-11-26 07:26:11 UTC
While 3.0 tarball is not published, it's tagged at github and available for download there. (just fyi)
Comment 7 Mathias 2014-02-26 04:49:26 UTC
There is at least workaround for this, until there is an actual release:

ln -s /usr/lib/mono/4.0/mod-mono-server4.exe /usr/lib/mono/4.5/mod-mono-server4.exe
ln -s /usr/lib/mono/4.0/xsp4.exe /usr/lib/mono/4.5/xsp4.exe

and edit /usr/bin/mod-mono-server4 and /usr/bin/xsp4, changing the path of the exe files from /usr/lib/mono/4.0/ to /usr/lib/mono/4.5/
Comment 8 Rodrigo Kumpera 2017-07-13 00:17:36 UTC
We no longer support mod-mono.