-
Notifications
You must be signed in to change notification settings - Fork 64
Error uploading large PDFs #35
Comments
This isn't enough information to help at all. Can you paste a the error stack trace? Have you made sure the the Radiant Config files allow files as large as the pdf? Do other files upload? Take a look at the mailing list, maybe there are some similar issues there. |
I've been looking everywhere for three days. It works fine for other types of files --I was able to upload a 15MB .gif for instance, no problem. I am also able to upload a 100KB PDF, but an 800K .pdf fails. I will try to gather more information about the issue. Currently this is happening on a remote host in production mode. I will setup a local install and see if it happens there too. |
Download the log files, the will show the 500 error and tell you what is happening. /log/production. I could be the pdf, as well. Try it with a different, but also large pdf. |
I think I may have narrowed down the issue. When installing on my host I installed the Paperclipped extension before the Settings extension. (Also, in try to adjust for that I ran I think I need to back up somehow and install the Settings extension before the Paperclipped extension and see if that fixes it. Do you have any advice.thoughts on this? |
This has nothing to do with your problem. Sounds like you have two different versions of paperclipped and perhaps your environment.rb file is wrong. LikeI said, download the log files. |
Processing Admin::AssetsController#new (for 70.119.230.177 at 2011-01-30 11:57:56) [GET] Parameters: {"action"=>"new", "controller"=>"admin/assets"} Rendering template within layouts/application Rendering admin/assets/new Completed in 33ms (View: 30, DB: 1) | 200 OK [http://cafemezz.com/admin/assets/new] Processing Admin::AssetsController#create (for 70.119.230.177 at 2011-01-30 11:58:29) [POST] Parameters: {"commit"=>"Create {{name}}", "action"=>"create", "authenticity_token"=>"S7uzUc5B6U6OP1nBUIyBFXI8DHdF3HUhyFvM1uUjinE=", "controller"=>"admin/as sets", "asset"=>{"title"=>"PDF Seasonal", "caption"=>"", "asset"=>#}} [paperclip] identify '-format' '%wx%h' '/tmp/stream,31705,0.pdf[0]' 2>/dev/null [paperclip] convert '/tmp/stream,31705,0.pdf[0]' '-resize' '42x' '-crop' '42x42+0+21' '+repage' '/tmp/stream,31705,0,31705,0.png' 2>/dev/null [paperclip] identify '-format' '%wx%h' '/tmp/stream,31705,0.pdf[0]' 2>/dev/null [paperclip] convert '/tmp/stream,31705,0.pdf[0]' '-resize' '100x100>' '/tmp/stream,31705,0,31705,1.png' 2>/dev/null [paperclip] identify '-format' '%wx%h' '/tmp/stream,31705,0.pdf[0]' 2>/dev/null [paperclip] convert '/tmp/stream,31705,0.pdf[0]' '-resize' '150x100>' '/tmp/stream,31705,0,31705,0' 2>/dev/null ActiveRecord::StatementInvalid (Mysql::Error: MySQL server has gone away: INSERT INTO `assets` (`updated_by_id`, `created_at`, `title`, `asset_file_name`, `a sset_file_size`, `created_by_id`, `updated_at`, `asset_content_type`, `caption`) VALUES(NULL, '2011-01-30 17:59:24', 'PDF Seasonal', 'seasonal.pdf', 1343447, 1, '2011-01-30 17:59:24', 'application/pdf', '')): vendor/extensions/paperclipped/app/controllers/admin/assets_controller.rb:24:in `create' radiant (0.9.1) vendor/plugins/haml/rails/./lib/sass/plugin/rails.rb:20:in `process' passenger (2.2.15) lib/phusion_passenger/rack/request_handler.rb:92:in `process_request' passenger (2.2.15) lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop' passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:441:in `start_request_handler' passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:381:in `handle_spawn_application' passenger (2.2.15) lib/phusion_passenger/utils.rb:252:in `safe_fork' passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:377:in `handle_spawn_application' passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in `__send__' passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in `main_loop' passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously' passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:163:in `start' passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:222:in `start' passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:253:in `spawn_rails_application' passenger (2.2.15) lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add' passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:247:in `spawn_rails_application' passenger (2.2.15) lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize' passenger (2.2.15) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize' passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:246:in `spawn_rails_application' passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:145:in `spawn_application' passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:278:in `handle_spawn_application' passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in `__send__' passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in `main_loop' passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously' Rendering /home/cafemezz/radiant/public/500.html (500 Internal Server Error) Processing SiteController#show_page (for 166.137.8.84 at 2011-01-30 11:59:42) [GET] Parameters: {"url"=>["pdf", "lunch.pdf"], "action"=>"show_page", "controller"=>"site"} Rendering template within layouts/application Rendering site/not_found (404) Completed in 36ms (View: 2, DB: 3) | 404 Not Found [http://www.cafemezz.com/pdf/lunch.pdf] |
Your server is timing out. ActiveRecord::StatementInvalid (Mysql::Error: MySQL server has gone away It creates the asset and record, but cannot insert it into the MySQL database. I looks like the request is taking over a minute. Does this file upload to the local copy? We have pdfs with over 10mb, but then again, we run our own servers. |
Yes. It works with the local server. My shared host seems to be getting bogged down in the converts. It takes about a minute or so for a large PDF. I will contact my host and see if the can do anything about the timeout. But I also wonder why Paperclipped is trying to create thumbnails for PDF files? Does that actually work? I looked at the one of assets folders for my local app, for a file called |
Checkout the paperclip gem itself. You can probably turn this off. |
Finally got it working!!! I added the following code to
So it's no longer running the PDF through convert. The only issue I have now is that somehow in the process of working on this, the "Create Asset" button now says "Create {{name}}". Something to do with the language extensions I am sure, but why would it not be putting in the variable for |
Check out the yaml file in locale/en.yaml. It probably has the wrong translation. In the view, check the key and then correct it in the en.yaml file. |
I looked at the view, the button is being generated with |
When I try to upload a large PDF file (800K) there is a long delay after the upload is complete and then an Application Error occurs.
The text was updated successfully, but these errors were encountered: