# Mongrel as service....odd

**URL:** <https://www.ruby-forum.com/t/mongrel-as-service-odd/86166>\
**Category:** Deployment\
**Created:** [February 20, 2007, 11:11am UTC](https://www.ruby-forum.com/t/mongrel-as-service-odd/86166 "2007-02-20T11:11:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dieffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/45deac/32.png) [@dieffe](https://www.ruby-forum.com/u/dieffe)\
**Post date:** [February 20, 2007, 11:11am UTC](https://www.ruby-forum.com/t/mongrel-as-service-odd/86166/1 "2007-02-20T11:11:07Z")

</div>

I have an odd ( at least for me ) problem with Mongrel running as  
service.  
Im trying to deploy RoR on a Win2003 server using Mongrel as service  
and isapi rewriter for IIS.  
When i run mongrel from shell (ruby script/server -p 4000) i can use  
my application with no problem of any sort.  
When i use mongrel running as service i get a “invalid argument” error  
and when i hit the refresh button the controller works fine.  
Is there any difference in mongrel running in shell mode or service  
mode?

Another question: is there any HowTo for dummies on how to install and  
deploy RoR on a fresh linux based server?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![dieffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/45deac/32.png) [@dieffe](https://www.ruby-forum.com/u/dieffe)\
**Post date:** [February 20, 2007, 2:12pm UTC](https://www.ruby-forum.com/t/mongrel-as-service-odd/86166/2 "2007-02-20T14:12:31Z")

</div>

On 2/20/07, Fausto [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> mode?

Fausto, in the future will be really helpful if you provide versions  
of the gems (mongrel & rails) you’re using.

In the past, mongrel\_service (0.1.0) used to duplicate mongrel\_rails  
code to implement as service. Since latest release (0.3.1), that is  
replaced with original mongrel\_rails code (totally DRY).

My suggestions:

1. Since you said you tested your application with webrick, I’ll try  
doing it with mongrel\_rails

> cd c:\path\to\my\app  
> mongrel\_rails start -p 4000

Check if it works or not. (browse to your app URL directly  
[http://localhost:4000/](http://localhost:4000/)).

1. If that worked, now perform the same with mongrel\_service ‘console’  
functionality:

> mongrel\_service console single -c “c:\path\to\my\app” -p 4000

Please note that: quotes for path are required if spaces to folders  
are used. console and single parameter are needed: they inform  
mongrel\_service that you will simulate the service and single is the  
one ruby-process service bundled into the executable.

1. If all these things worked, that indicates something is wrong with  
the command line of the service itself (called Image Path).

Check the Services console from the Administrative Tools (or  
Start-\>Run… services.msc). Look for your service name and double  
click on it.

Verify the command line (Executable Path) looks something like this:

C:\Ruby\bin\mongrel\_service.exe single -c “c:\path\to\my\app” -p 4000

IMPORTANT NOTE: since you say you’re using IIS rewrite, I’ll suggest  
you check these rules in case all the previous instructions worked.

Also, you didn’t indicate “production” environment, please check your  
development database is set in config/database.yml and you’re sure to  
run it that way.

> Another question: is there any HowTo for dummies on how to install and  
> deploy RoR on a fresh linux based server?

Not my field of action 🙂

## – Luis L. Multimedia systems

Leaders are made, they are not born. They are made by hard effort,  
which is the price which all of us must pay to achieve any goal that  
is worthwhile.  
Vince Lombardi

---

<div class="post-metadata">

**Author:** ![dieffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/45deac/32.png) [@dieffe](https://www.ruby-forum.com/u/dieffe)\
**Post date:** [February 20, 2007, 9:24pm UTC](https://www.ruby-forum.com/t/mongrel-as-service-odd/86166/3 "2007-02-20T21:24:59Z")

</div>

First of all thanks for your reply,  
the versions im using are:

Ruby 1.8.5  
RubyGem 0.9.0  
Rails 1.2.1  
Mongrel\_Service 0.3.1  
Mongrel 1.0.1

I tryed as you suggested and when i run mongrel via command line  
mongrel\_rails start -p 4000 no problem, running the server version via  
console took me to the problem as i copy pasted as follows:

Errno::EINVAL in Contatti#lista  
Showing app/views/contatti/lista.rhtml where line #16 raised:

Invalid argument

Any hints?

Thanks

---

<div class="post-metadata">

**Author:** ![dieffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/45deac/32.png) [@dieffe](https://www.ruby-forum.com/u/dieffe)\
**Post date:** [February 21, 2007, 4:12pm UTC](https://www.ruby-forum.com/t/mongrel-as-service-odd/86166/4 "2007-02-21T16:12:51Z")

</div>

\<%= link\_to\_image("delete.gif", {:controller =\> 'contatti', :action =\> 'cancella', :id =\> contatti}, :confirm =\> 'Eliminare?', :method =\> :post, :border=\>0) %\>

line 16

Here it is the model:

class Contatti \< ActiveRecord::Base

file\_column :image

belongs\_to :“collega”,  
:class\_name =\> “Referenti”,  
:foreign\_key =\> “referente\_id”  
belongs\_to :“collega2”,  
:class\_name =\> “Professioni”,  
:foreign\_key =\> “professione\_id”  
belongs\_to :ruolo  
belongs\_to :quartieri

validates\_presence\_of :nome, :message =\> “, Specificare il nome”  
validates\_presence\_of :cognome, :message =\> “, Specificare il cognome”  
validates\_uniqueness\_of :cognome, :scope =\> [:cognome, :nome]

validates\_associated :collega  
end

---

<div class="post-metadata">

**Author:** ![dieffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/45deac/32.png) [@dieffe](https://www.ruby-forum.com/u/dieffe)\
**Post date:** [February 22, 2007, 3:14pm UTC](https://www.ruby-forum.com/t/mongrel-as-service-odd/86166/5 "2007-02-22T15:14:40Z")

</div>

On 2/21/07, Fausto [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> class Contatti \< ActiveRecord::Base  
> belongs\_to :quartieri
> 
> validates\_presence\_of :nome, :message =\> “, Specificare il nome”  
> validates\_presence\_of :cognome, :message =\> “, Specificare il cognome”  
> validates\_uniqueness\_of :cognome, :scope =\> [:cognome, :nome]
> 
> validates\_associated :collega  
> end

You have a backtrace? since you’re showing me “contatti” in the view,  
that means you’re getting contatti = Contatti.find(…) somewhere in  
your controller…

Also check tabs and whitespaces since .rhtml (erb) is a bitch parsing  
them

## – Luis L. Multimedia systems

Leaders are made, they are not born. They are made by hard effort,  
which is the price which all of us must pay to achieve any goal that  
is worthwhile.  
Vince Lombardi

---

<div class="post-metadata">

**Author:** ![dieffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/45deac/32.png) [@dieffe](https://www.ruby-forum.com/u/dieffe)\
**Post date:** [February 20, 2007, 9:35pm UTC](https://www.ruby-forum.com/t/mongrel-as-service-odd/86166/6 "2007-02-20T21:35:00Z")

</div>

On 2/20/07, Fausto [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I tryed as you suggested and when i run mongrel via command line  
> mongrel\_rails start -p 4000 no problem, running the server version via  
> console took me to the problem as i copy pasted as follows:

so mongrel\_rails start worked when you tried access that page, but the  
console service didn’t?

What contains app/views/contatti/lista.rhtml where line #16 ?

## – Luis L. Multimedia systems

Leaders are made, they are not born. They are made by hard effort,  
which is the price which all of us must pay to achieve any goal that  
is worthwhile.  
Vince Lombardi

---

<div class="post-metadata">

**Author:** ![dieffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/45deac/32.png) [@dieffe](https://www.ruby-forum.com/u/dieffe)\
**Post date:** [February 24, 2007, 9:06pm UTC](https://www.ruby-forum.com/t/mongrel-as-service-odd/86166/7 "2007-02-24T21:06:18Z")

</div>

The Contatti class is properly defined in the model since i can access  
it via both console and browser running mongrel not as service.  
Do you suggest that the whitespace policy is different from the  
service and non service version of mongrel?

Thanks

---

<div class="post-metadata">

**Author:** ![dieffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/45deac/32.png) [@dieffe](https://www.ruby-forum.com/u/dieffe)\
**Post date:** [February 24, 2007, 10:18pm UTC](https://www.ruby-forum.com/t/mongrel-as-service-odd/86166/8 "2007-02-24T22:18:30Z")

</div>

On 2/24/07, Fausto [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> The Contatti class is properly defined in the model since i can access  
> it via both console and browser running mongrel not as service.  
> Do you suggest that the whitespace policy is different from the  
> service and non service version of mongrel?

Since services execute with a user account other than your (actually,  
the run using LocalService account). They cannot access a lot of  
things, these could be: directories, networked drives, etc.

Often these problems are related to permissions. I file marked just  
for you will fail tried to access under a service, but this isn’t the  
case.

Without the backtrace, I cannot help you deep into the problem, since  
I cannot recreate here these conditions.

Also, the command line used to start the service is very important, if  
you could access service manager (Start-\>Run…-\>services.msc) and  
copy the Executable Path shown under your services properties (also  
the User account used to run your service).

Regards,

## – Luis L. Multimedia systems

Leaders are made, they are not born. They are made by hard effort,  
which is the price which all of us must pay to achieve any goal that  
is worthwhile.  
Vince Lombardi

---

<div class="post-metadata">

**Author:** ![dieffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/45deac/32.png) [@dieffe](https://www.ruby-forum.com/u/dieffe)\
**Post date:** [February 26, 2007, 5:24pm UTC](https://www.ruby-forum.com/t/mongrel-as-service-odd/86166/9 "2007-02-26T17:24:50Z")

</div>

Hi.

I too am having the same symptoms:

Backtrace:  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active\_support/deprecation.rb:12:in  
`write' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/deprecation.rb:12:in `puts’  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active\_support/deprecation.rb:12  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active\_support/deprecation.rb:23:in  
`call' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/deprecation.rb:23:in `warn’  
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action\_view/helpers/url\_helper.rb:331:in  
`convert_options_to_javascript!' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/helpers/url_helper.rb:69:in `link\_to’  
#{RAILS\_ROOT}/app/views/users/list.rhtml:19:in  
`_run_rhtml_47app47views47users47list46rhtml' #{RAILS_ROOT}/app/views/users/list.rhtml:8:in `each’  
#{RAILS\_ROOT}/app/views/users/list.rhtml:8:in  
`\_run\_rhtml\_47app47views47users47list46rhtml’

Please ask if you want the full trace, since it’s more space to waste on  
the thread.

The services are: “c:/ruby/bin/mongrel\_service.exe” single -e production  
-p 4001 -a 0.0.0.0 -l “log/mongrel.log” -P “log/mongrel.pid” -c  
“C:/boxback” -t 0 -r “public” -n 1024

C:/boxback is my application root.

A precise explanation of how things happen is: Webrick OR mongrel as a  
non-service, everything’s fine.  
With mongrel as a service under lighttpd proxied to IIS with ISAPI  
Rewrite and using the Reverse Proxy plugin, when I am -linked- by a  
redirect from a create/edit/destroy scaffolding, I get the crash.

More relevant info:  
The same happens if I use paginate or @regions = Region.find(:all)

The region file text is:  
\<% for region in @regions %\>

 \<% for column in Region.content\_columns %\> \<% if column.name == "logo\_url" %\>   
 ![]()  
 \<% end %\> \<%= simple\_format region.send(column.name) %\> \<% end %\> \<%= link\_to 'Show', :action =\> 'show', :id =\> region %\> \<%= link\_to 'Edit', :action =\> 'edit', :id =\> region %\> \<%= link\_to 'Destroy', { :action =\> 'destroy', :id =\> region }, :confirm =\> 'Are you sure?', :post =\> true %\> -------ERROR POINTS TO THIS BLANK LINE HERE------- \<% end %\>

Finally, please note that this application was heavily tested and torn  
apart by a small QA group before the migration into  
IIS/lighttpd/mongrel. I haven’t a clue what’s wrong.

Luis L. wrote:

> On 2/24/07, Fausto [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > The Contatti class is properly defined in the model since i can access  
> > it via both console and browser running mongrel not as service.  
> > Do you suggest that the whitespace policy is different from the  
> > service and non service version of mongrel?
> 
> Since services execute with a user account other than your (actually,  
> the run using LocalService account). They cannot access a lot of  
> things, these could be: directories, networked drives, etc.
> 
> Often these problems are related to permissions. I file marked just  
> for you will fail tried to access under a service, but this isn’t the  
> case.
> 
> Without the backtrace, I cannot help you deep into the problem, since  
> I cannot recreate here these conditions.
> 
> Also, the command line used to start the service is very important, if  
> you could access service manager (Start-\>Run…-\>services.msc) and  
> copy the Executable Path shown under your services properties (also  
> the User account used to run your service).
> 
> Regards,
> 
> ## – Luis L. Multimedia systems
> 
> Leaders are made, they are not born. They are made by hard effort,  
> which is the price which all of us must pay to achieve any goal that  
> is worthwhile.  
> Vince Lombardi

---

<div class="post-metadata">

**Author:** ![dieffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/45deac/32.png) [@dieffe](https://www.ruby-forum.com/u/dieffe)\
**Post date:** [February 26, 2007, 5:31pm UTC](https://www.ruby-forum.com/t/mongrel-as-service-odd/86166/10 "2007-02-26T17:31:40Z")

</div>

Actually a correction to the above statement and a partial solution.

I hadn’t rebooted all my services on exactly one test I did, so this is  
the truth of it:

When I use the paginate command in the controller, I get the error  
-EVERY- time I create/edit/delete. It worked fine under heavy testing  
before the migration.  
When I replace it with @region = Regions.find(:all) and -really- reboot  
all my mongrel services, it works perfectly.

It seems either SQL Server, Mongrel, ISAPI Rewrite, or the Reverse proxy  
screws with some of the underlying code in paginate…I have no clue  
why, but most of my problems were resolved by taking pagination out of  
my app.

I really like pagination, though…suggestions appreciated.

---

<div class="post-metadata">

**Author:** ![dieffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/45deac/32.png) [@dieffe](https://www.ruby-forum.com/u/dieffe)\
**Post date:** [February 26, 2007, 5:55pm UTC](https://www.ruby-forum.com/t/mongrel-as-service-odd/86166/11 "2007-02-26T17:55:23Z")

</div>

On 2/26/07, C.jay Martin [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi.
> 
> I too am having the same symptoms:

Mmm, not the same, let me ask you a few things:

- What database backend are you using?
- Since the backend require native bindings (and also some dll). Are  
these dlls (sqlite3.dll or libmysql.dll) available system wide? (try  
putting them into windows\system32).
- if plain mongrel\_rails start … works, then you could try:

mongrel\_service console single “all the parameters you use with your  
service”:

mongrel\_service console single -e production -p 4001 -a 0.0.0.0 -l  
“log/mongrel.log” -P “log/mongrel.pid” -c “C:/boxback” -t 0 -r  
“public” -n 1024

And see if the application works or report errors.

- In case it works, now you need to get if your environment (and the  
permissions) are good to run the service.

Please follow the instructions I posted to mongrel-users about similar  
problems:

[http://rubyforge.org/pipermail/mongrel-users/2007-February/003004.html](http://rubyforge.org/pipermail/mongrel-users/2007-February/003004.html)

Using psexec -l cmd.exe you get a restricted console, try running  
mongrel\_rails in it and check the console for errors.

> Finally, please note that this application was heavily tested and torn  
> apart by a small QA group before the migration into  
> IIS/lighttpd/mongrel. I haven’t a clue what’s wrong.

Often is not a problem of test, but permissions of NTFS filesystem or  
bugs in the Ruby VM and implementation under windows, who will guess  
that?

Anyway, a lot of these problems could be solved, like the one on the  
list I make references previously.

Hope could get a solution for the “missing log” of mongrel\_service in  
the following days.

## – Luis L. Multimedia systems

Leaders are made, they are not born. They are made by hard effort,  
which is the price which all of us must pay to achieve any goal that  
is worthwhile.  
Vince Lombardi

---

<div class="post-metadata">

**Author:** ![dieffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/45deac/32.png) [@dieffe](https://www.ruby-forum.com/u/dieffe)\
**Post date:** [February 26, 2007, 6:16pm UTC](https://www.ruby-forum.com/t/mongrel-as-service-odd/86166/12 "2007-02-26T18:16:25Z")

</div>

On 2/26/07, C.jay Martin [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> all my mongrel services, it works perfectly.

AFAIK, mongrel didn’t mess with Rails, but there exist lot of cases  
that thigns mess up… 😛

> It seems either SQL Server, Mongrel, ISAPI Rewrite, or the Reverse proxy  
> screws with some of the underlying code in paginate…I have no clue  
> why, but most of my problems were resolved by taking pagination out of  
> my app.
> 
> I really like pagination, though…suggestions appreciated.

Will Paginate?

[http://errtheblog.com/post/929](http://errtheblog.com/post/929)

## – Luis L. Multimedia systems

Leaders are made, they are not born. They are made by hard effort,  
which is the price which all of us must pay to achieve any goal that  
is worthwhile.  
Vince Lombardi

---

<div class="post-metadata">

**Author:** ![dieffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/45deac/32.png) [@dieffe](https://www.ruby-forum.com/u/dieffe)\
**Post date:** [February 26, 2007, 6:34pm UTC](https://www.ruby-forum.com/t/mongrel-as-service-odd/86166/13 "2007-02-26T18:34:27Z")

</div>

On 2/26/07, C.jay Martin [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> -not- that, then I’ll still be stuck at square one.

Ok, post you progress on this subject or contact me off the list in  
any case. Maybe you could provide more inside information and I could  
recreate the scenario here to get into the issue.

Regards,

## – Luis L. Multimedia systems

Leaders are made, they are not born. They are made by hard effort,  
which is the price which all of us must pay to achieve any goal that  
is worthwhile.  
Vince Lombardi

---

<div class="post-metadata">

**Author:** ![dieffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/45deac/32.png) [@dieffe](https://www.ruby-forum.com/u/dieffe)\
**Post date:** [February 26, 2007, 6:25pm UTC](https://www.ruby-forum.com/t/mongrel-as-service-odd/86166/14 "2007-02-26T18:25:38Z")

</div>

Looking up, I’m still pretty sure it’s the same problem, at least to the  
root. It’s the exact same error, and more specifically, a refresh works  
just fine.

1. The database backend is SQL Server. This is required by the IT dept  
here. The bindings are system-wide.

2. I tried adding “console” before single, it didn’t do anything  
helpful.

3. I tried psexec -l cmd.exe and running mongrel\_rails. It worked  
perfectly and showed no errors.

RE: Permissions: I gave the folder full permissions for all users, and  
it didn’t help.

Worst of all, the error seems to be “sometimes” now that I disabled  
pagination. I -think- it might be a login-limit to the scheduler user  
on the database. I’m communicating with the DB Admin regarding that  
now. If it -is- that, the error could use to be more clear. If it’s  
-not- that, then I’ll still be stuck at square one.

Luis L. wrote:

> On 2/26/07, C.jay Martin [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Hi.
> > 
> > I too am having the same symptoms:
> 
> Mmm, not the same, let me ask you a few things:
> 
> - What database backend are you using?
> - Since the backend require native bindings (and also some dll). Are  
> these dlls (sqlite3.dll or libmysql.dll) available system wide? (try  
> putting them into windows\system32).
> - if plain mongrel\_rails start … works, then you could try:
> 
> mongrel\_service console single “all the parameters you use with your  
> service”:
> 
> mongrel\_service console single -e production -p 4001 -a 0.0.0.0 -l  
> “log/mongrel.log” -P “log/mongrel.pid” -c “C:/boxback” -t 0 -r  
> “public” -n 1024
> 
> And see if the application works or report errors.
> 
> - In case it works, now you need to get if your environment (and the  
> permissions) are good to run the service.
> 
> Please follow the instructions I posted to mongrel-users about similar  
> problems:
> 
> [http://rubyforge.org/pipermail/mongrel-users/2007-February/003004.html](http://rubyforge.org/pipermail/mongrel-users/2007-February/003004.html)
> 
> Using psexec -l cmd.exe you get a restricted console, try running  
> mongrel\_rails in it and check the console for errors.
> 
> > Finally, please note that this application was heavily tested and torn  
> > apart by a small QA group before the migration into  
> > IIS/lighttpd/mongrel. I haven’t a clue what’s wrong.
> 
> Often is not a problem of test, but permissions of NTFS filesystem or  
> bugs in the Ruby VM and implementation under windows, who will guess  
> that?
> 
> Anyway, a lot of these problems could be solved, like the one on the  
> list I make references previously.
> 
> Hope could get a solution for the “missing log” of mongrel\_service in  
> the following days.
> 
> ## – Luis L. Multimedia systems
> 
> Leaders are made, they are not born. They are made by hard effort,  
> which is the price which all of us must pay to achieve any goal that  
> is worthwhile.  
> Vince Lombardi

---

<div class="post-metadata">

**Author:** ![dieffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/45deac/32.png) [@dieffe](https://www.ruby-forum.com/u/dieffe)\
**Post date:** [February 26, 2007, 7:54pm UTC](https://www.ruby-forum.com/t/mongrel-as-service-odd/86166/15 "2007-02-26T19:54:11Z")

</div>

Garth Smedley wrote:

> Please continue to post progress with this issue, we have something  
> similar with a page that works fine under WEBrick but has the same error  
> once in a while under IIS/mongrel.

I’m still awaiting information from the DBA. He doesn’t seem to be in  
today. Once I took out pagination, and the other developer stopped  
testing it with me, the error counts dropped to about 1 in 7 or 1 in 8,  
with me having to push it with simultaneous connections. Either  
something is drastically wrong with mongrel’s concurrency capabilities,  
or something’s up with SQL Server. At this point, I’m pretty convinced  
there’s nothing in my code or NTFS permissions doing this.

---

<div class="post-metadata">

**Author:** ![dieffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/45deac/32.png) [@dieffe](https://www.ruby-forum.com/u/dieffe)\
**Post date:** [February 26, 2007, 7:46pm UTC](https://www.ruby-forum.com/t/mongrel-as-service-odd/86166/16 "2007-02-26T19:46:39Z")

</div>

Please continue to post progress with this issue, we have something  
similar with a page that works fine under WEBrick but has the same error  
once in a while under IIS/mongrel.

---

<div class="post-metadata">

**Author:** ![dieffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/45deac/32.png) [@dieffe](https://www.ruby-forum.com/u/dieffe)\
**Post date:** [February 26, 2007, 8:09pm UTC](https://www.ruby-forum.com/t/mongrel-as-service-odd/86166/17 "2007-02-26T20:09:21Z")

</div>

We just tried removing IIS & isapi rewrite and haven’t been able to  
reproduce the problem since. This makes me wonder if it isn’t some odd  
interaction between IIS and Mongrel.

---

<div class="post-metadata">

**Author:** ![dieffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/45deac/32.png) [@dieffe](https://www.ruby-forum.com/u/dieffe)\
**Post date:** [February 26, 2007, 8:04pm UTC](https://www.ruby-forum.com/t/mongrel-as-service-odd/86166/18 "2007-02-26T20:04:28Z")

</div>

C.jay Martin wrote:

> Garth Smedley wrote:
> 
> > Please continue to post progress with this issue, we have something  
> > similar with a page that works fine under WEBrick but has the same error  
> > once in a while under IIS/mongrel.
> 
> I’m still awaiting information from the DBA. He doesn’t seem to be in  
> today. Once I took out pagination, and the other developer stopped  
> testing it with me, the error counts dropped to about 1 in 7 or 1 in 8,  
> with me having to push it with simultaneous connections. Either  
> something is drastically wrong with mongrel’s concurrency capabilities,  
> or something’s up with SQL Server. At this point, I’m pretty convinced  
> there’s nothing in my code or NTFS permissions doing this.

NTFS Permissions update:

Tossed the whole thing onto a test box, gave ruby, my app, mongrel, etc  
full user permissions. Still seems to happen.

---

<div class="post-metadata">

**Author:** ![dieffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/45deac/32.png) [@dieffe](https://www.ruby-forum.com/u/dieffe)\
**Post date:** [February 26, 2007, 8:09pm UTC](https://www.ruby-forum.com/t/mongrel-as-service-odd/86166/19 "2007-02-26T20:09:47Z")

</div>

On 2/26/07, C.jay Martin [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > with me having to push it with simultaneous connections. Either  
> > something is drastically wrong with mongrel’s concurrency capabilities,  
> > or something’s up with SQL Server. At this point, I’m pretty convinced  
> > there’s nothing in my code or NTFS permissions doing this.
> 
> NTFS Permissions update:
> 
> Tossed the whole thing onto a test box, gave ruby, my app, mongrel, etc  
> full user permissions. Still seems to happen.

You still use the SQL Server as backend, right?

Could you try a clean rails app as service? put some test controller  
(like hello world action).

If that don’t fail, is related to our SQL Server connection that  
timeout and raise some issues (randomly it seems).

## – Luis L. Multimedia systems

Leaders are made, they are not born. They are made by hard effort,  
which is the price which all of us must pay to achieve any goal that  
is worthwhile.  
Vince Lombardi

---

<div class="post-metadata">

**Author:** ![dieffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/45deac/32.png) [@dieffe](https://www.ruby-forum.com/u/dieffe)\
**Post date:** [February 26, 2007, 8:47pm UTC](https://www.ruby-forum.com/t/mongrel-as-service-odd/86166/20 "2007-02-26T20:47:33Z")

</div>

Can’t totally rule out Mongrel routing, because the test was so simple  
and I was unable to enforce two simultaneous attempts, but the hello  
program, loaded on over 20 panes simultaneously, had zero errors…

Second-check. I did the same exact thing with the login screen for the  
real program (it doesn’t link to the database…that’s -IT- for  
differences) and not one error. It has to be DB related.

I think all that leaves is the DB, Rails’ link to the database, or  
Mongrel’s treatment of the processes in regards to the DB. It’s  
definitely related to the DB though.

Luis L. wrote:

> On 2/26/07, C.jay Martin [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > > with me having to push it with simultaneous connections. Either  
> > > something is drastically wrong with mongrel’s concurrency capabilities,  
> > > or something’s up with SQL Server. At this point, I’m pretty convinced  
> > > there’s nothing in my code or NTFS permissions doing this.
> > 
> > NTFS Permissions update:
> > 
> > Tossed the whole thing onto a test box, gave ruby, my app, mongrel, etc  
> > full user permissions. Still seems to happen.
> 
> You still use the SQL Server as backend, right?
> 
> Could you try a clean rails app as service? put some test controller  
> (like hello world action).
> 
> If that don’t fail, is related to our SQL Server connection that  
> timeout and raise some issues (randomly it seems).
> 
> ## – Luis L. Multimedia systems
> 
> Leaders are made, they are not born. They are made by hard effort,  
> which is the price which all of us must pay to achieve any goal that  
> is worthwhile.  
> Vince Lombardi

[Next page](https://www.ruby-forum.com/t/mongrel-as-service-odd/86166.md?page=2)
