I've set up nginx to work with ServiceStack on Ubuntu 10.04.

This is the command line I use to start fastcgi-mono-server4:

/usr/lib/mono/4.0/fastcgi-mono-server4.exe --appconfigdir /etc/init.d/mono-fastcgi /socket=unix:/var/tmp/SOCK-WW /logfile=/var/log/mono/fastcgi.log &

nginx is set up correctly to communicate with fastcgi via sockets:

...
location / {
        root /var/www/server01;
        index index.html index.htm default.aspx Default.aspx;
        fastcgi_index Default.aspx;
        fastcgi_pass unix:/var/tmp/SOCK-WW;
        include /etc/nginx/fastcgi_params;
}
...

The website gets delivered correctly, but in my fastcgi.log I see these lines on every request:

[2013-08-01 10:43:37Z] Notice  Beginning to receive records on connection.
[2013-08-01 10:43:37Z] Error   Failed to process connection. Reason: The object was used after being disposed.

The versions of software involved:

  • nginx/1.1.19
  • fastcgi-mono-server4.exe 2.10.0.0
  • Mono JIT compiler version 2.10.8.1 (Debian 2.10.8.1-1ubuntu2.2)

Is there a way to get rid of this error? Is this error severe anyway?

The fastcgi-mono-server4.exe is crashing randomly on my server and I want to sort out all possible errors, as I've not found any reasonable crashlogs yet.

2

There are 2 best solutions below

0
On

Usage of XSP 3.0.11 (most likely 3+) solves the problem. At least you will not see "bad gateway" in case of correct configuration. XSP of version 3 will be installed in another directory and it does not contain that bug. I guess that the issue is related to very old XSP release available at mono-project downloads. So to get new one - go to github and save source of mono/xsp as tar.gz archive, unpack it, run ./autogen.sh to generate scripts and then do all as usual (configure, make, make install).

1
On

Could you try with a recent mono and/or xsp?

By recent I mean mono > 3.0 and a xsp tag from github > 3.0 or even master.