[CommunityEngine] Amazon s3 Integration Error

9 views
Skip to first unread message

SS

unread,
Oct 28, 2009, 7:06:05 PM10/28/09
to CommunityEngine
Hi,
I was wondering if any of you guys have gotten the error message below
on Heroku when trying to upload an image via the 'Edit Profile' for a
user. I tried finding the problem and did quite bit of online
research. The only suggestion that I found was to remove the 'x' from
vendor/plugins/attachment_fu/lib/geometry.rb (line 28):

# Construct an object from a geometry string
RE = /\A(\d*)(?:(\d+)?)?([-+]\d+)?([-+]\d+)?([%!<>@]?)\Z/

Everyone says that that should be enough, however I'm still having the
same problem. Any suggestions?

<b>Server error message:</b>

Processing UsersController#update (for 174.0.115.254 at 2009-10-28
12:09:26) [PUT]
Parameters: {"user"=>{"birthday(2i)"=>"10", "birthday(3i)"=>"27",
"zip"=>"", "description"=>"<p>I am all powerful</p>", "birthday
(1i)"=>"1994"}, "commit"=>"Save Changes", "authenticity_token"=>"ne7/
J3rAOypK9FaR59US1EiEpy3PAm4zFRb1UtJLqMc=", "country_id"=>"",
"id"=>"admin", "avatar"=>{"uploaded_data"=>#<File:/tmp/
RackMultipart31171-0>}, "tag_list"=>""}

ArgumentError (invalid geometry format):
vendor/plugins/community_engine/plugins/attachment_fu/lib/
geometry.rb:36:in `from_s'
vendor/plugins/community_engine/plugins/attachment_fu/lib/
geometry.rb:90:in `/'
vendor/plugins/community_engine/plugins/attachment_fu/lib/
technoweenie/attachment_fu/processors/image_science_processor.rb:54:in
`resize_image'
vendor/plugins/community_engine/plugins/attachment_fu/lib/
technoweenie/attachment_fu.rb:464:in `resize_image_or_thumbnail!'
vendor/plugins/community_engine/plugins/attachment_fu/lib/
technoweenie/attachment_fu/processors/image_science_processor.rb:24:in
`process_attachment'
vendor/plugins/community_engine/plugins/attachment_fu/lib/
technoweenie/attachment_fu/processors/image_science_processor.rb:14:in
`with_image'
vendor/plugins/community_engine/plugins/attachment_fu/lib/
technoweenie/attachment_fu/processors/image_science_processor.rb:14:in
`with_image'
vendor/plugins/community_engine/plugins/attachment_fu/lib/
technoweenie/attachment_fu.rb:395:in `with_image'
vendor/plugins/community_engine/plugins/attachment_fu/lib/
technoweenie/attachment_fu/processors/image_science_processor.rb:21:in
`process_attachment'
vendor/plugins/community_engine/plugins/attachment_fu/lib/
technoweenie/attachment_fu.rb:486:in `run_callbacks'
vendor/plugins/community_engine/plugins/attachment_fu/lib/
technoweenie/attachment_fu.rb:293:in `create_or_update_thumbnail'
/usr/local/lib/ruby/gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/
extensions.rb:166:in `returning'
vendor/plugins/community_engine/plugins/attachment_fu/lib/
technoweenie/attachment_fu.rb:285:in `create_or_update_thumbnail'
vendor/plugins/community_engine/plugins/attachment_fu/lib/
technoweenie/attachment_fu.rb:450:in `after_process_attachment'
vendor/plugins/community_engine/plugins/attachment_fu/lib/
technoweenie/attachment_fu.rb:450:in `each'
vendor/plugins/community_engine/plugins/attachment_fu/lib/
technoweenie/attachment_fu.rb:450:in `after_process_attachment'
vendor/plugins/community_engine/plugins/attachment_fu/lib/
technoweenie/attachment_fu.rb:486:in `run_callbacks'
vendor/plugins/community_engine/app/controllers/users_controller.rb:
140:in `update'
haml (2.2.3) lib/sass/plugin/rails.rb:19:in `process'
/home/heroku_rack/lib/static_assets.rb:9:in `call'
/home/heroku_rack/lib/last_access.rb:25:in `call'
/home/heroku_rack/lib/date_header.rb:14:in `call'
thin (1.0.1) lib/thin/connection.rb:80:in `pre_process'
thin (1.0.1) lib/thin/connection.rb:78:in `catch'
thin (1.0.1) lib/thin/connection.rb:78:in `pre_process'
thin (1.0.1) lib/thin/connection.rb:57:in `process'
thin (1.0.1) lib/thin/connection.rb:42:in `receive_data'
eventmachine (0.12.6) lib/eventmachine.rb:240:in `run_machine'
eventmachine (0.12.6) lib/eventmachine.rb:240:in `run'
thin (1.0.1) lib/thin/backends/base.rb:57:in `start'
thin (1.0.1) lib/thin/server.rb:150:in `start'
thin (1.0.1) lib/thin/controllers/controller.rb:80:in `start'
thin (1.0.1) lib/thin/runner.rb:173:in `send'
thin (1.0.1) lib/thin/runner.rb:173:in `run_command'
thin (1.0.1) lib/thin/runner.rb:139:in `run!'
thin (1.0.1) bin/thin:6
/usr/local/bin/thin:20:in `load'
/usr/local/bin/thin:20

Rendering /disk1/home/slugs/72014_4d89f8e_77f5/mnt/public/500.html
(500 Internal Server Error)

SS

unread,
Oct 29, 2009, 1:23:53 PM10/29/09
to CommunityEngine
I don't understand how my local CE app is working okay, but I get the
above message on Heroku?

SS

Bruno Bornsztein

unread,
Oct 29, 2009, 1:32:46 PM10/29/09
to communi...@googlegroups.com
Heroku might be running a different version of Rmagick or Imagemagick than you have. Did you know I have a sample CE install running on Heroku:


Check out my application.yml for changes to the geometry strings that you might need to make:


Thanks,
Bruno

SS

unread,
Oct 29, 2009, 4:50:21 PM10/29/09
to CommunityEngine
I figured it out after hours and hours!
I'm glad that I found out what is happening,
because anyone else that is deploying CE on Heroku may come across the
same issue if relying on Rmagick gem.

The reason why my application was working locally but didn't work on
the server is because I'm using Rmagick gem and I don't have
ImageScience.
Therefore, in the /lib/technoweenie/attachment_fu.rb I had to change
the order of the default image processor

from:
@@default_processors = %w(ImageScience <b>Rmagick</b> MiniMagick Gd2
CoreImage)

to:
@@default_processors = %w(<b>Rmagick</b> ImageScience MiniMagick Gd2
CoreImage)

So that Heroku uses Rmagick as the default image processing as long as
it's found. Also, I found this resource valuable when solving the
problem:

http://www.themomorohoax.com/2009/01/29/invalid-geometry-format-geometry-rb-36-in-from-s


Cheers,
Siyan

P.S: I'm so happy... :)


On Oct 29, 11:32 am, Bruno Bornsztein <bruno.bornszt...@gmail.com>
wrote:
> Heroku might be running a different version of Rmagick or Imagemagick than
> you have. Did you know I have a sample CE install running on Heroku:
>
> http://github.com/bborn/ce-herokuhttp://ceheroku.heroku.com/
>
> Check out my application.yml for changes to the geometry strings that you
> might need to make:
>
> http://github.com/bborn/ce-heroku/blob/master/config/application.yml
>
> Thanks,
> Bruno
>

Bruno

unread,
Oct 30, 2009, 11:19:59 AM10/30/09
to CommunityEngine
Just to clarify what's happening here: att_fu will use ImageScience
(if available) before Rmagick. Since ImageScience is available on
Heroku, it uses that. If you're using Rmagick geometry strings in your
application.yml (which CE does by default), then you need to also tell
att_fu explicitly to use Rmagick, like this (notice the processor
option):

photo:
missing_thumb: '/images/icon_missing_thumb.png'
missing_medium: "/images/icon_missing_medium.png"
attachment_fu_options:
resize_to: "465>"
min_size: 1
max_size: 3
thumbnails: {thumb: "c100x100!", medium: "c290x320!", large:
"664>"}
storage: 's3'
processor: 'rmagick'
content_type: ['image/jpg', 'image/jpeg', 'image/pjpeg', 'image/
gif', 'image/png', 'image/x-png']


This is better than modifying att_fu's default processors directly.


On Oct 29, 3:50 pm, SS <stoyan.stoitch...@gmail.com> wrote:
> I figured it out after hours and hours!
> I'm glad that I found out what is happening,
> because anyone else that is deploying CE on Heroku may come across the
> same issue if relying on Rmagick gem.
>
> The reason why my application was working locally but didn't work on
> the server is because I'm using Rmagick gem and I don't have
> ImageScience.
> Therefore, in the /lib/technoweenie/attachment_fu.rb I had to change
> the order of the default image processor
>
> from:
>  @@default_processors = %w(ImageScience <b>Rmagick</b> MiniMagick Gd2
> CoreImage)
>
> to:
>  @@default_processors = %w(<b>Rmagick</b> ImageScience MiniMagick Gd2
> CoreImage)
>
> So that Heroku uses Rmagick as the default image processing as long as
> it's found. Also, I found this resource valuable when solving the
> problem:
>
> http://www.themomorohoax.com/2009/01/29/invalid-geometry-format-geome...

SS

unread,
Oct 30, 2009, 9:30:11 PM10/30/09
to CommunityEngine
Thanks Bruno for your suggestion,
I agree with you that if I can make that change in the config file
will be way better than the source lib, I just wasn't aware of that
parameter :)

Regards,
Siyan
Reply all
Reply to author
Forward
0 new messages