# Error serving generated xml - Windows - Apache - Mongrel

**URL:** <https://www.ruby-forum.com/t/error-serving-generated-xml-windows-apache-mongrel/92382>\
**Category:** Deployment\
**Created:** [April 18, 2007, 10:21pm UTC](https://www.ruby-forum.com/t/error-serving-generated-xml-windows-apache-mongrel/92382 "2007-04-18T22:21:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![b0rdslide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@b0rdslide](https://www.ruby-forum.com/u/b0rdslide)\
**Post date:** [April 18, 2007, 10:21pm UTC](https://www.ruby-forum.com/t/error-serving-generated-xml-windows-apache-mongrel/92382/1 "2007-04-18T22:21:32Z")

</div>

I am attempting to follow the document created by Brain Hogan on  
“Serving Multiple Rails Applications on Windows with Apache and Mongrel”  
and all seems well except for one issue. One of my actions generates an  
xml document and uses the “send\_data” method to return the file.  
However, this is the error I get when executing this controller action:

Proxy Error  
The proxy server received an invalid response from an upstream server.  
The proxy server could not handle the request GET  
/cbf\_dev/admin/generate\_spreadsheet\_xml/2.

Reason: Error reading from remote server

This function works as expected when calling Mongrel directly, but as  
soon as I proxy the call through Apache to Mongrel, the above error.

Can anyone help me solve this issues? I think it is something to do with  
the way Apache (and the reverse\_proxy\_fix.rb file described in document  
mentioned above) is attempting to reconcile the name?

This newbie thanks you in advance for any help.

Kevin.

---

<div class="post-metadata">

**Author:** ![b0rdslide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@b0rdslide](https://www.ruby-forum.com/u/b0rdslide)\
**Post date:** [April 18, 2007, 11:32pm UTC](https://www.ruby-forum.com/t/error-serving-generated-xml-windows-apache-mongrel/92382/2 "2007-04-18T23:32:41Z")

</div>

Forget this request. I discovered the problem was due to spaces being in  
the name of the file I was sending. As soon as I changed the name from  
“CMBS Design.xls” to “CMBS-Design.xls”, everything started working.

Thanks,  
Kevin

---

<div class="post-metadata">

**Author:** ![b0rdslide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@b0rdslide](https://www.ruby-forum.com/u/b0rdslide)\
**Post date:** [April 19, 2007, 12:01am UTC](https://www.ruby-forum.com/t/error-serving-generated-xml-windows-apache-mongrel/92382/3 "2007-04-19T00:01:44Z")

</div>

Well, I thought I fixed this problem entirely, but now it seems to  
happen if the xml generation takes too long. Could Apache be timing out  
waiting for the “send\_data” response?

If so, does anyone know how to fix that issue?

Kevin

---

<div class="post-metadata">

**Author:** ![b0rdslide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@b0rdslide](https://www.ruby-forum.com/u/b0rdslide)\
**Post date:** [April 25, 2007, 4:29am UTC](https://www.ruby-forum.com/t/error-serving-generated-xml-windows-apache-mongrel/92382/4 "2007-04-25T04:29:29Z")

</div>

@Kevin:  
Hey, glad you find that useful.

What version of Apache are you using? Are you tied to that particular  
setup  
on Windows? I have some alternative solutions you might be able to use  
as  
well–contact me off-list for that.

You may need to add the right mime type to Apache. It sounds like the  
proxy  
stuff doesn’t like the response it’s seeing. Anything jump out at you in  
the  
apache logs?

If you can maybe send me code I can try to replicate it here. I am very  
interested in problems with the setups I share with people… 🙂

---

<div class="post-metadata">

**Author:** ![b0rdslide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@b0rdslide](https://www.ruby-forum.com/u/b0rdslide)\
**Post date:** [April 25, 2007, 4:38pm UTC](https://www.ruby-forum.com/t/error-serving-generated-xml-windows-apache-mongrel/92382/5 "2007-04-25T16:38:22Z")

</div>

To follow-up, XML files were coming through as MIME text/xml while all  
my generated XML that has no problems is application/xml

I’ve added AddType application/xml to my Apache conf and we’ll see how  
that goes.

On Apr 25, 9:17 am, “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![b0rdslide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@b0rdslide](https://www.ruby-forum.com/u/b0rdslide)\
**Post date:** [April 25, 2007, 3:17pm UTC](https://www.ruby-forum.com/t/error-serving-generated-xml-windows-apache-mongrel/92382/6 "2007-04-25T15:17:58Z")

</div>

This sounds like it might be related to a problem that cropped up with  
my app a few weeks ago.

Setup  
RHEL 4  
Apache 2.2.3  
Ruby 1.8.4  
Rails 1.1.6  
Mongrel 1.0.1 (8 running) with fastthread 0.6.2

After I commented out a line in a flat non generated XML and added one  
node in another XML file I’ve noticed errors cropping up serving the  
documents getting 404’s not all the time but once out of every 55  
times or so.

I have a bit of a different Apache/Mongrel setup. Everything is  
ProxyPass’d to Mongrel so the XML file is initially handled by Mongrel  
to Apache. That’s why the problem you’re having struck me as possibly  
being related.

I removed the commented line from the XML thinking that perhaps there  
was a strange character code introduced, a tab or something. The file  
passes all validation tests so I’m at a bit of a lost what it is about  
these two XML files and just these XML files that Mongrel has problems  
with.

Nothing has been changed in the setup other than the XML (well ok a  
couple of unrelated views) I can’t roll back the changes to the XML as  
I need them.

Is there any other information I can contribute? I’ll keep testing  
around.

This is line that was changed for one of the files, I removed it  
entirely yesterday and am checking logs for any improvements :

\<subSection key=“community” name=“Community News” section\_path="/  
community/news/" blank\_window=“false” auto\_select\_id=“community\_news” /

>

---

<div class="post-metadata">

**Author:** ![b0rdslide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@b0rdslide](https://www.ruby-forum.com/u/b0rdslide)\
**Post date:** [May 23, 2007, 5:10pm UTC](https://www.ruby-forum.com/t/error-serving-generated-xml-windows-apache-mongrel/92382/7 "2007-05-23T17:10:37Z")

</div>

Hi,  
I dont have an answer to your quesion. I just started trying to use  
the same document to serve multiple rails applications on Windows.

Page 5 of 13: Section - Link the configurations  
Include conf/httpd-webbrick-proxy.conf

After adding this include line into the httpd.conf file, apache does not  
restart because it cannot load the httpd-webbrick-proxy.conf file. Do I  
have to download this file separately. I do not see the  
httpd-webbrick-proxy.conf in the Apache2/conf directory.

I would appreciate any help.  
Thanks  
Udai

Kevin A. wrote:

> I am attempting to follow the document created by Brain Hogan on  
> “Serving Multiple Rails Applications on Windows with Apache and Mongrel”  
> and all seems well except for one issue. One of my actions generates an  
> xml document and uses the “send\_data” method to return the file.  
> However, this is the error I get when executing this controller action:
> 
> Proxy Error  
> The proxy server received an invalid response from an upstream server.  
> The proxy server could not handle the request GET  
> /cbf\_dev/admin/generate\_spreadsheet\_xml/2.
> 
> Reason: Error reading from remote server
> 
> This function works as expected when calling Mongrel directly, but as  
> soon as I proxy the call through Apache to Mongrel, the above error.
> 
> Can anyone help me solve this issues? I think it is something to do with  
> the way Apache (and the reverse\_proxy\_fix.rb file described in document  
> mentioned above) is attempting to reconcile the name?
> 
> This newbie thanks you in advance for any help.
> 
> Kevin.
