{"action":"created","issue":{"url":"https://api.github.com/repos/janfoeh/paperclip-optimizer/issues/17","labels_url":"https://api.github.com/repos/janfoeh/paperclip-optimizer/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/janfoeh/paperclip-optimizer/issues/17/comments","events_url":"https://api.github.com/repos/janfoeh/paperclip-optimizer/issues/17/events","html_url":"https://github.com/janfoeh/paperclip-optimizer/pull/17","id":58947577,"number":17,"title":"Solve erratic \"Errno::ENOENT: No such file or directory\" on the fileutils.rb stat method","user":{"login":"cavi21","id":146249,"avatar_url":"https://avatars.githubusercontent.com/u/146249?v=3","gravatar_id":"","url":"https://api.github.com/users/cavi21","html_url":"https://github.com/cavi21","followers_url":"https://api.github.com/users/cavi21/followers","following_url":"https://api.github.com/users/cavi21/following{/other_user}","gists_url":"https://api.github.com/users/cavi21/gists{/gist_id}","starred_url":"https://api.github.com/users/cavi21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cavi21/subscriptions","organizations_url":"https://api.github.com/users/cavi21/orgs","repos_url":"https://api.github.com/users/cavi21/repos","events_url":"https://api.github.com/users/cavi21/events{/privacy}","received_events_url":"https://api.github.com/users/cavi21/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-02-25T18:26:28Z","updated_at":"2015-02-25T21:20:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/janfoeh/paperclip-optimizer/pulls/17","html_url":"https://github.com/janfoeh/paperclip-optimizer/pull/17","diff_url":"https://github.com/janfoeh/paperclip-optimizer/pull/17.diff","patch_url":"https://github.com/janfoeh/paperclip-optimizer/pull/17.patch"},"body":"Hi! since I include this processor in our flow, I being experiencing the return of errors randomly, like this one below:\r\n ```\r\nAn Errno::ENOENT occurred in background at 2015-02-02 20:49:32 UTC :\r\n\r\n  No such file or directory - /tmp/83adcf1ccdc34521790435a27d35c13420150202-29204-19pmkse20150202-29204-17joo6a20150202-29204-kqducm\r\n  /usr/lib64/ruby/1.9.1/fileutils.rb:1515:in `stat'\r\n\r\n  -------------------------------\r\nBacktrace:\r\n-------------------------------\r\n\r\n  /usr/lib64/ruby/1.9.1/fileutils.rb:1515:in `stat'\r\n  /usr/lib64/ruby/1.9.1/fileutils.rb:1515:in `block in fu_each_src_dest'\r\n  /usr/lib64/ruby/1.9.1/fileutils.rb:1531:in `fu_each_src_dest0'\r\n  /usr/lib64/ruby/1.9.1/fileutils.rb:1513:in `fu_each_src_dest'\r\n  /usr/lib64/ruby/1.9.1/fileutils.rb:395:in `cp'\r\n  /data/shared/bundled_gems/ruby/1.9.1/gems/paperclip-4.2.1/lib/paperclip/io_adapters/abstract_adapter.rb:42:in `copy_to_tempfile'\r\n  /data/shared/bundled_gems/ruby/1.9.1/gems/paperclip-4.2.1/lib/paperclip/io_adapters/file_adapter.rb:13:in `cache_current_values'\r\n  /data/shared/bundled_gems/ruby/1.9.1/gems/paperclip-4.2.1/lib/paperclip/io_adapters/file_adapter.rb:5:in `initialize'\r\n  /data/shared/bundled_gems/ruby/1.9.1/gems/paperclip-4.2.1/lib/paperclip/io_adapters/registry.rb:29:in `new'\r\n  /data/shared/bundled_gems/ruby/1.9.1/gems/paperclip-4.2.1/lib/paperclip/io_adapters/registry.rb:29:in `for'\r\n  /data/shared/bundled_gems/ruby/1.9.1/gems/paperclip-4.2.1/lib/paperclip/attachment.rb:528:in `post_process_style'\r\n```\r\n\r\nAnd I dig a lot to found the possible root of the problem, the thing is the way the [**make**](https://github.com/janfoeh/paperclip-optimizer/blob/master/lib/paperclip-optimizer/processor.rb#L14) method is implemented on this processor.\r\nI change a few things in order to mimic the way the native [**Thumbnail**](https://github.com/thoughtbot/paperclip/blob/master/lib/paperclip/thumbnail.rb) processor work in paperclip, using the [**Tempfile**](http://ruby-doc.org//stdlib-1.9.3/libdoc/tempfile/rdoc/Tempfile.html) ruby library.\r\n\r\nSince I change this I no longer get the error above.\r\n\r\nHope this helps, and please if there is anything else, or maybe if I miss something please don't hesitate to let me know!\r\n\r\nHave a nice week!"},"comment":{"url":"https://api.github.com/repos/janfoeh/paperclip-optimizer/issues/comments/76062520","html_url":"https://github.com/janfoeh/paperclip-optimizer/pull/17#issuecomment-76062520","issue_url":"https://api.github.com/repos/janfoeh/paperclip-optimizer/issues/17","id":76062520,"user":{"login":"janfoeh","id":4675,"avatar_url":"https://avatars.githubusercontent.com/u/4675?v=3","gravatar_id":"","url":"https://api.github.com/users/janfoeh","html_url":"https://github.com/janfoeh","followers_url":"https://api.github.com/users/janfoeh/followers","following_url":"https://api.github.com/users/janfoeh/following{/other_user}","gists_url":"https://api.github.com/users/janfoeh/gists{/gist_id}","starred_url":"https://api.github.com/users/janfoeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janfoeh/subscriptions","organizations_url":"https://api.github.com/users/janfoeh/orgs","repos_url":"https://api.github.com/users/janfoeh/repos","events_url":"https://api.github.com/users/janfoeh/events{/privacy}","received_events_url":"https://api.github.com/users/janfoeh/received_events","type":"User","site_admin":false},"created_at":"2015-02-25T21:20:54Z","updated_at":"2015-02-25T21:20:54Z","body":"Out of curiosity, which optimizers do you have enabled? Is there a pattern, ie. is the error only occurring on a specific format? Is it reproducible with the same uploaded image?"}}