My app works perfectly on my development server with Amazon S3 but
once deployed to Heroku, it breaks AFTER one successful upload. I am
able to create one post which has one attached image. Once uploaded,
the image file can be accessed without a problem.

The problem arises when trying to create additional posts with
attached files or when trying to upload a different file attachment
for the original working post.

I have spent all day on this and can't figure out why Heroku always
throws an error one any second upload to S3 after the app is rebuilt.

I have included the log that shows the successful creation of the
first post that includes an upload and the second post with an upload
that fails.

Processing MicropostsController#create (for 24.202.155.203 at
2010-10-28 16:41:18) [POST]
Parameters: {"commit"=>"Submit",
"micropost"=>{"start_date(1i)"=>"2010", "start_date(2i)"=>"10",
"start_date(3i)"=>"30", "title"=>"Bright Eyes",
"start_date(4i)"=>"23", "start_date(5i)"=>"39", "poster"=>#<File:/home/
slugs/333722_0c2b1ab_b46f-600809c5-4d87-4421-89b0-e07def6f4256/mnt/tmp/
RackMultipart20101028-11999-6tjb14-0>, "link1"=>"http://
www.youtube.com/watch?v=o5rhhQbyYV0", "link2"=>"http://www.youtube.com/
watch?v=o5rhhQbyYV0", "content"=>"Details", "venue"=>"il Motore"},
"action"=>"create", "authenticity_token"=>"gDBmWuBjv9PDjlLJMPJr1eL3w/
NXZ1jdsreIYQ0EUcU=", "controller"=>"microposts"}
[paperclip] identify -format %wx%h '/home/slugs/
333722_0c2b1ab_b46f-600809c5-4d87-4421-89b0-e07def6f4256/mnt/tmp/
stream,11999,0.jpg[0]'
[paperclip] convert '/home/slugs/
333722_0c2b1ab_b46f-600809c5-4d87-4421-89b0-e07def6f4256/mnt/tmp/
stream,11999,0.jpg[0]' -resize '375x550>' '/home/slugs/
333722_0c2b1ab_b46f-600809c5-4d87-4421-89b0-e07def6f4256/mnt/tmp/
stream,11999,0,11999,0'
[paperclip] identify -format %wx%h '/home/slugs/
333722_0c2b1ab_b46f-600809c5-4d87-4421-89b0-e07def6f4256/mnt/tmp/
stream,11999,0.jpg[0]'
[paperclip] convert '/home/slugs/
333722_0c2b1ab_b46f-600809c5-4d87-4421-89b0-e07def6f4256/mnt/tmp/
stream,11999,0.jpg[0]' -resize '200x' -crop '200x200+0+50' +repage '/
home/slugs/333722_0c2b1ab_b46f-600809c5-4d87-4421-89b0-e07def6f4256/
mnt/tmp/stream,11999,0,11999,1'
[paperclip] Saving attachments.
[paperclip] saving /assets/posters/1/original/bright-eyes.jpg
[paperclip] saving /assets/posters/1/large/bright-eyes.jpg
[paperclip] saving /assets/posters/1/thumb/bright-eyes.jpg
Redirected to http://gigkong.com/users/1
Completed in 628ms (DB: 23) | 302 Found [http://gigkong.com/gigs]

***The first post was successful. The second upload fails below where
"[paperclip] Saving attachments" should be. Code is the same on my dev
server and works***

Processing MicropostsController#create (for 24.202.155.203 at
2010-10-28 16:42:58) [POST]
Parameters: {"commit"=>"Submit",
"micropost"=>{"start_date(1i)"=>"2010", "start_date(2i)"=>"10",
"start_date(3i)"=>"30", "title"=>"Caribou", "start_date(4i)"=>"23",
"start_date(5i)"=>"42", "poster"=>#<File:/home/slugs/
333722_0c2b1ab_b46f-600809c5-4d87-4421-89b0-e07def6f4256/mnt/tmp/
RackMultipart20101028-11999-eah7cl-0>, "link1"=>"http://
www.youtube.com/watch?v=o5rhhQbyYV0", "link2"=>"http://www.youtube.com/
watch?v=o5rhhQbyYV0", "content"=>"Details", "venue"=>"Casa del
Popolo"}, "action"=>"create",
"authenticity_token"=>"gDBmWuBjv9PDjlLJMPJr1eL3w/NXZ1jdsreIYQ0EUcU=",
"controller"=>"microposts"}
[paperclip] identify -format %wx%h '/home/slugs/
333722_0c2b1ab_b46f-600809c5-4d87-4421-89b0-e07def6f4256/mnt/tmp/
stream,11999,0.jpg[0]'
[paperclip] convert '/home/slugs/
333722_0c2b1ab_b46f-600809c5-4d87-4421-89b0-e07def6f4256/mnt/tmp/
stream,11999,0.jpg[0]' -resize '375x550>' '/home/slugs/
333722_0c2b1ab_b46f-600809c5-4d87-4421-89b0-e07def6f4256/mnt/tmp/
stream,11999,0,11999,0'

NoMethodError (undefined method `[]' for nil:NilClass):
app/controllers/microposts_controller.rb:27:in `create'
/home/heroku_rack/lib/static_assets.rb:9:in `call'
/home/heroku_rack/lib/last_access.rb:15:in `call'
/home/heroku_rack/lib/date_header.rb:14:in `call'
thin (1.2.6) lib/thin/connection.rb:76:in `pre_process'
thin (1.2.6) lib/thin/connection.rb:74:in `catch'
thin (1.2.6) lib/thin/connection.rb:74:in `pre_process'
thin (1.2.6) lib/thin/connection.rb:57:in `process'
thin (1.2.6) lib/thin/connection.rb:42:in `receive_data'
eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'
eventmachine (0.12.10) lib/eventmachine.rb:256:in `run'
thin (1.2.6) lib/thin/backends/base.rb:57:in `start'
thin (1.2.6) lib/thin/server.rb:156:in `start'
thin (1.2.6) lib/thin/controllers/controller.rb:80:in `start'
thin (1.2.6) lib/thin/runner.rb:177:in `send'
thin (1.2.6) lib/thin/runner.rb:177:in `run_command'
thin (1.2.6) lib/thin/runner.rb:143:in `run!'
thin (1.2.6) bin/thin:6
/usr/ruby1.8.7/bin/thin:19:in `load'
/usr/ruby1.8.7/bin/thin:19

Rendering /disk1/home/slugs/
333722_0c2b1ab_b46f-600809c5-4d87-4421-89b0-e07def6f4256/mnt/public/
500.html (500 Internal Server Error)

=======

  def create
    @current_user = current_user
    @micropost =
current_user.microposts.build(params[:micropost])      ****line 27****
    if @micropost.save
      flash[:success] = "Micropost created!"
      redirect_to current_user
    else
      @feed_items = []
      render 'pages/home'
    end
  end

=======

Any help would be appreciated. Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.

Reply via email to