# Random Closed Stream error

**URL:** <https://www.ruby-forum.com/t/random-closed-stream-error/138693>\
**Category:** Rails\
**Created:** [May 26, 2008, 9:29pm UTC](https://www.ruby-forum.com/t/random-closed-stream-error/138693 "2008-05-26T21:29:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![soroe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f9ae1b/32.png) [@soroe](https://www.ruby-forum.com/u/soroe)\
**Post date:** [May 26, 2008, 9:29pm UTC](https://www.ruby-forum.com/t/random-closed-stream-error/138693/1 "2008-05-26T21:29:32Z")

</div>

Hey Guys,

I’ve been getting a random ‘closed stream’ exception with my app. I  
can’t reliably duplicate the problem. It seems to crop up every 20th  
request or so… A snippet from the call-stack appears below. If I hit  
the browser refresh button, the request completes successfully.

I’m working on Ubuntu 8.04 (Hardy Heron) with Rails 2.0.2 and Mongrel  
1.1.4

Any ideas would be really appreciated.

==================================  
closed stream

/usr/lib/ruby/1.8/tempfile.rb:151:in `close' /usr/lib/ruby/1.8/tempfile.rb:151:in`callback’  
vendor/rails/activerecord/lib/active\_record/validations.rb:518:in `call' vendor/rails/activerecord/lib/active_record/validations.rb:518:in`send’  
vendor/rails/activerecord/lib/active\_record/validations.rb:518:in  
`validates\_presence\_of’

---

<div class="post-metadata">

**Author:** ![soroe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f9ae1b/32.png) [@soroe](https://www.ruby-forum.com/u/soroe)\
**Post date:** [June 28, 2008, 12:40am UTC](https://www.ruby-forum.com/t/random-closed-stream-error/138693/2 "2008-06-28T00:40:37Z")

</div>

Did you ssolve this problem , I’ve the same error sometimes any idea  
of what is the problem or how fix that ??

On 26 mayo, 14:29, Sonny C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![soroe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f9ae1b/32.png) [@soroe](https://www.ruby-forum.com/u/soroe)\
**Post date:** [June 28, 2008, 12:54am UTC](https://www.ruby-forum.com/t/random-closed-stream-error/138693/3 "2008-06-28T00:54:25Z")

</div>

Foreero I. wrote:

> Did you ssolve this problem , I’ve the same error sometimes any idea  
> of what is the problem or how fix that ??
> 
> On 26 mayo, 14:29, Sonny C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

Ivan,

Unfortunately, not. I haven’t had time to fully investigate. I suspect  
it has something to do with the image\_science graphics package that I  
use with attachment\_fu. Would you, by any chance also be using  
either/both of these plugins?

Sonny.

---

<div class="post-metadata">

**Author:** ![soroe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f9ae1b/32.png) [@soroe](https://www.ruby-forum.com/u/soroe)\
**Post date:** [June 28, 2008, 8:01pm UTC](https://www.ruby-forum.com/t/random-closed-stream-error/138693/4 "2008-06-28T20:01:56Z")

</div>

No , I have not these plugins installed in my app. I thought that it  
have to do with mongrel.

I’ll investigate about this , if I found something to solve this I’ll  
warning you … and if you have something please let me know what you  
found.

Thanks for pay attention to my question

---

<div class="post-metadata">

**Author:** ![soroe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f9ae1b/32.png) [@soroe](https://www.ruby-forum.com/u/soroe)\
**Post date:** [August 19, 2008, 9:04pm UTC](https://www.ruby-forum.com/t/random-closed-stream-error/138693/5 "2008-08-19T21:04:14Z")

</div>

Foreero I. wrote:

> No , I have not these plugins installed in my app. I thought that it  
> have to do with mongrel.
> 
> I’ll investigate about this , if I found something to solve this I’ll  
> warning you … and if you have something please let me know what you  
> found.
> 
> Thanks for pay attention to my question

Ivan,

Are you using Ubuntu 8.04 or some other flavour of Linux? I’ve never  
seen this issue when my app is deployed to a server with Solaris…

Sonny.
