<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>OnMyList Blog: aws-s3 woes</title>
    <link>http://blog.onmylist.com/articles/2007/06/08/aws-s3-woes</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>List your pants off!</description>
    <item>
      <title>aws-s3 woes</title>
      <description>&lt;p&gt;At &lt;span class="caps"&gt;OML&lt;/span&gt; we use Amazon&amp;#8217;s S3 for profile pics storage, we switched from local disk to S3 for scalability reasons when we need to move to multiple app servers or Amazon &lt;span class="caps"&gt;EC2&lt;/span&gt;. To implement S3 with &lt;a href="http://svn.techno-weenie.net/projects/plugins/attachment_fu/"&gt;attachment_fu&lt;/a&gt; was fairly straight-forward. However, we ran into a lot of problems with the aws-s3 gem. Basically the S3 backend, which uses aws-s3, failed with a broken pipe.&lt;/p&gt;


	&lt;p&gt;I did a bit of googling on this and found out the author of aws-s3 attempted to fix this in the latest subversion snapshot (# attempts changed to 10 by yours truly):&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="keyword"&gt;rescue&lt;/span&gt; &lt;span class="constant"&gt;Errno&lt;/span&gt;&lt;span class="punct"&gt;::&lt;/span&gt;&lt;span class="constant"&gt;EPIPE&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt; &lt;span class="constant"&gt;Timeout&lt;/span&gt;&lt;span class="punct"&gt;::&lt;/span&gt;&lt;span class="constant"&gt;Error&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt; &lt;span class="constant"&gt;Errno&lt;/span&gt;&lt;span class="punct"&gt;::&lt;/span&gt;&lt;span class="constant"&gt;EPIPE&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt; &lt;span class="constant"&gt;Errno&lt;/span&gt;&lt;span class="punct"&gt;::&lt;/span&gt;&lt;span class="constant"&gt;EINVAL&lt;/span&gt;
    &lt;span class="attribute"&gt;@http&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="ident"&gt;create_connection&lt;/span&gt;
    &lt;span class="ident"&gt;attempts&lt;/span&gt; &lt;span class="punct"&gt;==&lt;/span&gt; &lt;span class="number"&gt;10&lt;/span&gt; &lt;span class="punct"&gt;?&lt;/span&gt; &lt;span class="keyword"&gt;raise&lt;/span&gt; &lt;span class="punct"&gt;:&lt;/span&gt; &lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;attempts&lt;/span&gt; &lt;span class="punct"&gt;+=&lt;/span&gt; &lt;span class="number"&gt;1&lt;/span&gt;&lt;span class="punct"&gt;;&lt;/span&gt; &lt;span class="keyword"&gt;retry&lt;/span&gt;&lt;span class="punct"&gt;)&lt;/span&gt;
&lt;span class="keyword"&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;So I checked out the latest &lt;span class="caps"&gt;SVN&lt;/span&gt; snapshot as a plugin, but it didn&amp;#8217;t quite fix it, from time to time I still got the same error. So I ended up retrying it a couple more time in my own rescue block, if it still fails, then catch the exception and fail gracefully.&lt;/p&gt;


	&lt;p&gt;It seems to work for me, feel free to post comments if you are still having problems with profile pics&amp;#8230; It would be great if you would also email the pics you tried to upload to &lt;a href="mailto:feedback@onmylist.com"&gt;feedback@onmylist.com&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Thanks! Now go &lt;a href="http://www.onmylist.com/lists/new"&gt;list your pants off&lt;/a&gt;!&lt;/p&gt;</description>
      <pubDate>Fri, 08 Jun 2007 17:30:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:e483b46a-f4f2-44dd-b195-3ab80777d34e</guid>
      <author>Andrew</author>
      <link>http://blog.onmylist.com/articles/2007/06/08/aws-s3-woes</link>
      <category>Ruby on Rails</category>
      <category>attachment_fu</category>
      <category>amazon</category>
      <category>s3</category>
      <category>ec2</category>
      <category>aws</category>
      <category>ruby</category>
      <category>RoR</category>
      <category>rubyonrails</category>
      <category>rails</category>
      <trackback:ping>http://blog.onmylist.com/articles/trackback/10</trackback:ping>
    </item>
    <item>
      <title>"aws-s3 woes" by Jerusalem Real Estate</title>
      <description>It also kept crashing for me. But it seems that the latest version fixed that issue, so right now it's working like magic.</description>
      <pubDate>Mon, 07 Apr 2008 03:24:15 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:32717d01-6958-4430-8b92-aba6c2bfbdd5</guid>
      <link>http://blog.onmylist.com/articles/2007/06/08/aws-s3-woes#comment-10335</link>
    </item>
    <item>
      <title>"aws-s3 woes" by celpjefscycle</title>
      <description>Thanks for information. 
many interesting things 
Celpjefscylc</description>
      <pubDate>Fri, 11 Jan 2008 18:14:13 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:9043b44c-0036-4ed7-8025-1a2de9cd3e27</guid>
      <link>http://blog.onmylist.com/articles/2007/06/08/aws-s3-woes#comment-4070</link>
    </item>
    <item>
      <title>"aws-s3 woes" by papyromancer</title>
      <description>Great tip!</description>
      <pubDate>Tue, 04 Dec 2007 13:47:15 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:ce9fec2d-e2df-444a-895f-c0ebc86dcf16</guid>
      <link>http://blog.onmylist.com/articles/2007/06/08/aws-s3-woes#comment-1272</link>
    </item>
  </channel>
</rss>
