Welcome Guest | Login

attachment_fu + EOFError?

Hello,
Weird problem I am experiencing. I can upload files to my s3 account, but maybe after 4 times, my rails app starts to no longer upload. If i killall -user dispatch.fcgi, I can upload again for a few times before it stops. any ideas?

here is my prod.log

EOFError (end of file reached):
   /usr/local/lib/ruby/1.8/net/protocol.rb:133:in `sysread'
   /usr/local/lib/ruby/1.8/net/protocol.rb:133:in `rbuf_fill'
   /usr/local/lib/ruby/1.8/timeout.rb:56:in `timeout'
   /usr/local/lib/ruby/1.8/timeout.rb:76:in `timeout'
   /usr/local/lib/ruby/1.8/net/protocol.rb:132:in `rbuf_fill'
   /usr/local/lib/ruby/1.8/net/protocol.rb:116:in `readuntil'
   /usr/local/lib/ruby/1.8/net/protocol.rb:126:in `readline'
   /usr/local/lib/ruby/1.8/net/http.rb:2017:in `read_status_line'
   /usr/local/lib/ruby/1.8/net/http.rb:2006:in `read_new'
....


and after the first crash, i get a new one"

Errno::EPIPE (Broken pipe):
   /usr/local/lib/ruby/1.8/net/protocol.rb:175:in `write'
   /usr/local/lib/ruby/1.8/net/protocol.rb:175:in `write0'
   /usr/local/lib/ruby/1.8/net/protocol.rb:151:in `write'
   /usr/local/lib/ruby/1.8/net/protocol.rb:166:in `writing'
   /usr/local/lib/ruby/1.8/net/protocol.rb:150:in `write'
   /usr/local/lib/ruby/1.8/net/http.rb:1571:in `write_header'
   /usr/local/lib/ruby/1.8/net/http.rb:1536:in `send_request_with_body'
   /usr/local/lib/ruby/1.8/net/http.rb:1522:in `exec'
   /usr/local/lib/ruby/1.8/net/http.rb:1045:in `request'
   /vendor/plugins/aws-s3-0.3.0/lib/aws/s3/connection.rb:41:in `request'
   /vendor/plugins/aws-s3-0.3.0/lib/aws/s3/connection.rb:46:in `call'
   /vendor/plugins/aws-s3-0.3.0/lib/aws/s3/connection.rb:46:in `request'
   /vendor/plugins/aws-s3-0.3.0/lib/aws/s3/base.rb:69:in `request'
   /vendor/plugins/aws-s3-0.3.0/lib/aws/s3/base.rb:84:in `put'
   /vendor/plugins/aws-s3-0.3.0/lib/aws/s3/object.rb:239:in `store'
   /vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/s3_backend.rb:294:in `save_to_storage'
   /vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:369:in `after_process_attachment'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:333:in `send'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:333:in `callback'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:330:in `each'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:330:in `callback'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:243:in `create_or_update'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1551:in `save_without_validation!'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/validations.rb:762:in `save_without_transactions!'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/transactions.rb:133:in `save!'
   /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/
abstract/database_statements.rb:59:in `transaction'

2007-05-29 04:53 PM

Hello,

Could you please post a ticket on this issue to support team with the exact links and the steps  so that we can recreate the errors and try to fix it. ~Thanks

2007-05-29 06:59 PM

HostingRails Support
hi, trouble ticket sent..thank you.

2007-05-29 08:21 PM

I'm having the same problem as far as I can tell. I'll file a ticket as well.

2007-06-05 06:36 PM

You may explicitly need to define which processor attachment_fu should use (it has support for RMagick, ImageScience, or MiniMagick). In the absense of an explicit directive about which one to use it chooses one on its own.

Could you try this again explicitly chosing RMagick as the processor
has_attachment :content_type => :image,
:processor=> :rmagick
Please contact support if that doesn't help.

2007-06-05 07:28 PM

I was already using an explicit :processor => :Rmagick

I've filed a ticket.

Thanks for the ideas though.

2007-06-05 11:45 PM

We have received the ticket and we are checking the issue. We will update you on this as soon as possible.

2007-06-06 12:21 AM

Regards,
Rahul
i think it has something to do with ruby and the aws-s3 gem. the reason i think this is because i get the same error after being logged into the s3 shell from my account. after about 10 minutes of typing various commands (creating deleting uploading to buckets and such), i started recieving the same print out errors. i had to exit and relogin into my s3shell and the error messages were gone. after googleing around, ive read it may be related to ruby/s3 not matching on timeout/header information which causes a spike in server cpu which then closes the connection. but then again, i tried the s3 amazon tutorial and uploaded fine. odd behavior.

2007-06-06 07:33 AM

hmm, maybe the issue is when attachment_fu uploads the images to amazon s3. i wonder if it resizes the first, uploads to s3, than resizes the next sized photo, uploads to s3, etc...while keeping an open connection to amazon, and that connection closes. i wonder if amazon monitors the amount of uploads per a given time and closes connection if it senses some kind of abuse?

2007-06-06 07:36 AM

Quick question - do you have Rails frozen in your app?  I believe this solves the error, or at least part of it, as others around the net have encountered seg defaulting with the attachment_fu gem on shared servers when the rails version wasn't frozen.

Just go to your RAILS_ROOT and issue

rake rails:freeze:gems

(this will freeze the Rails 1.2.3 gems)

Then restart your Mongrel(s) or fastcgi.

Let me know how it goes.
~William

2007-06-06 07:44 AM

I followed your advice, William, and it seems to be working. I've only had a few minutes to test over lunch, but I'll give it more of a workout tonight.

2007-06-06 01:57 PM

hi Panels, if things work out, please let me know. i have a mongrel as well so it seems that i may use it for image upload to amazon.

thanks

2007-06-06 02:23 PM

hi, i was wondering if you still experience the same issues being on mongrel? maybe mongrel is best to use for attachment_fu and amazon s3?

thanks

2007-06-12 11:54 AM

hi, i found this. maybe it can provide some kind of insight?

http://flexrails.blogspot.com/2007/05/errnoepipe-broken-pipe.html

2007-06-14 10:59 AM

I apologize for taking so long to get back. I've been traveling and just got back. Freezing Rails seems to have done the trick in my case. I can't reproduce the error now and it was pretty consistent before. Thanks for help. The mySQL post wasn't related to my problem but it's a good one to know about in case I run across a similar issue.

2007-06-14 03:45 PM

hey, thanks for the reply. i also just freezed rails and  it seems that its helped.  i uploaded maybe 10-15 files and no crashes. i wonder how freezinf rails/gems have anything to do with mysql/protocol/etc...

2007-06-14 06:04 PM

I think it's because freezing local Rails/gems would align your local version to that of the server. This fixes it.

2007-06-14 10:14 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.