Defect #5024
closedInternal error after clicking on link to PDF Export
Added by Sheng Wang over 14 years ago. Updated over 13 years ago.
0%
Description
- browse http://www.redmine.org/issues/408
- Click on link to PDF Export
Error information:
Internal error An error occurred on the page you were trying to access. If you continue to experience problems please contact your redMine administrator for assistance. Back
Files
Capture.PNG (3.17 KB) Capture.PNG | David Sedlar, 2010-03-12 16:16 | ||
sl.yml.diff (333 Bytes) sl.yml.diff | Patch for /config/locales/sl.ylm | David Sedlar, 2010-03-12 16:50 |
Related issues
Updated by Eric Davis over 14 years ago
- Category set to Website (redmine.org)
- Resolution set to Cant reproduce
Works for me, can anyone else reproduce this error?
Updated by Sheng Wang over 14 years ago
But I let a lot of people try it, all of them reproduct this error:
Browse this page ok. However, a click on PDF export, first appeared a very long wait, and then throw 500 internal error.
Here are our machines Environment:
Debian Iceweasel/3.5.8 (like Firefox/3.5.8) Windows XP IE6 Windows 7 IE8
In addition, we are all from China. Could it be that character set problem?
Updated by David Sedlar over 14 years ago
I can confirm this bug, although I cannot confirm it on the redmine.org page, but it happens on my 0.9.3 production version. It does NOT happen when using English language. But it does happen with certain languages.
An example is the Slovenian language. Here is some code from my sl.yml:
... general_lang_name: 'Slovenščina' general_csv_separator: ',' general_csv_decimal_separator: '.' general_csv_encoding: ISO-8859-1 general_pdf_encoding: ISO-8859-1 general_first_day_of_week: '1' ...
The error can always be reproduced, the exact error as stated in my Redmine log is:
Processing IssuesController#show to pdf (for 10.200.100.16 at 2010-03-11 14:59:10) [GET] Parameters: {"format"=>"pdf", "action"=>"show", "id"=>"3", "controller"=>"issues"} NoMethodError (private method `gsub' called for 337.794921875:Float): lib/redmine/export/pdf.rb:94:in `Cell' lib/redmine/export/pdf.rb:306:in `issue_to_pdf' lib/redmine/export/pdf.rb:303:in `issue_to_pdf' app/controllers/issues_controller.rb:119 app/controllers/issues_controller.rb:116:in `show' Rendering D:/Ruby/Redmine/public/500.html (500 Internal Server Error)
Any information on this?
Updated by Sheng Wang over 14 years ago
- The error can always be reprodued in redmine 0.8.7 production.
- what is more,this error is not always occur, it will only appear in the case of the issue is too long.
- When this error occurs, CUP will reach 100%.
Updated by Sheng Wang over 14 years ago
Oh, I'm sorry.
It should be the CPU rather than the CUP
Updated by David Sedlar over 14 years ago
Upon further inspection there seems to be a problem with some of the language templates and this method:
def number_to_human_size(number, *args)
It seems the method is supposed to take a number as an argument and return the text in the appropriate human readable form (ie. 356.56 KB). But instead it somehow returns a Float insted, without converting it to human text form. Thus the methos gsub is not found for type Float.
Updated by David Sedlar over 14 years ago
- File Capture.PNG Capture.PNG added
Forgot to mention, this only happens when there are attachments, because that is when the number_to_human_size method is called. Also on the display page this value is not converted properly using some language templates. I've attached a screenshot.
Updated by David Sedlar over 14 years ago
- % Done changed from 0 to 20
Also, this bug is now 100% reproducible on this very page (because I have added the attachment). Switch to a language that is causing the problems (ie. Slovenščina) and click on PDF export on the bottom of this page. It will reproduce the error.
Updated by David Sedlar over 14 years ago
- File sl.yml.diff sl.yml.diff added
Another update:
The problem is related to some missing values in the language templates. For example the documentation for the method number_to_human_size parameters reads:
* :precision - Sets the level of precision (defaults to 1). * :separator - Sets the separator between the units (defaults to "."). * :delimiter - Sets the thousands delimiter (defaults to "").
But these setting are missing in some templates even though they should be there, especially if these values are not the same as defaults. For example, the Slovenščina language locale has a "," separator and "." delimiter.
Adding these two setting to the sl.yml template solved my problem. I am fairly certain that other languages which are affected have the same solution:
number: format: separator: ',' delimiter: '.'
I have also included a patch for the sl.ylm (Slovenščina) template.
Updated by Sheng Wang over 14 years ago
Thanks for your efforts! :)
But This page (http://www.redmine.org/issues/408) has no attachments, the 500 internal error still occurs.
I think your solution is another bug, rather than I pointed out that the bug.
On this question, I also think that too long issues description lead to error occurs.
once one issue with too long description (In particular, there is a particularly long line) lead to this error, then I split the long line issue description information into two lines, it work well.
Updated by Fitz Agard over 14 years ago
I've encountered the same "defect" using redmine 0.9.3 stable with english. I can replicate on my server irrespective of the issue size or with/without attachments.
After sometime I decided to upgrade to the latest in the svn repository. I backed up my database.yml and email.yml. I wiped the location clean and performed an svn checkout. I'm now on Redmine 0.9.3.devel.3668 (MySQL) and I'm still seeing the issue. I'm now wondering if there is some configuration setting in the database (i have no idea, just guessing) that is making this happen.
I have a different server running Redmine 0.9.3.devel.3608 (MySQL) and I'm not seeing the issue there.
Thanks for looking into this.
Updated by Fitz Agard over 14 years ago
Here is the output to the log:
Processing IssuesController#show to pdf (for 00.000.00.000 at 2010-04-12 12:12:04) [GET]
Parameters: {"controller"=>"issues", "action"=>"show", "id"=>"10", "format"=>"pdf"}
TypeError (can't convert String into Integer):
lib/redmine/export/pdf.rb:258:in `issue_to_pdf'
app/controllers/issues_controller.rb:123:in `block (2 levels) in show'
app/controllers/issues_controller.rb:119:in `show'
<internal:prelude>:8:in `synchronize'
passenger (2.2.11) lib/phusion_passenger/rack/request_handler.rb:92:in `process_request'
passenger (2.2.11) lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
passenger (2.2.11) lib/phusion_passenger/railz/application_spawner.rb:418:in `start_request_handler'
passenger (2.2.11) lib/phusion_passenger/railz/application_spawner.rb:358:in `block in handle_spawn_application'
passenger (2.2.11) lib/phusion_passenger/utils.rb:184:in `safe_fork'
passenger (2.2.11) lib/phusion_passenger/railz/application_spawner.rb:354:in `handle_spawn_application'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:163:in `start'
passenger (2.2.11) lib/phusion_passenger/railz/application_spawner.rb:213:in `start'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:262:in `block (2 levels) in spawn_rails_application'
passenger (2.2.11) lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:256:in `block in spawn_rails_application'
passenger (2.2.11) lib/phusion_passenger/abstract_server_collection.rb:80:in `block in synchronize'
<internal:prelude>:8:in `synchronize'
passenger (2.2.11) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
Rendering /srv/www/vhosts/site/public/500.html (500 Internal Server Error)
Updated by Sheng Wang over 14 years ago
Sheng Wang wrote:
Steps:
- browse http://www.redmine.org/issues/408
- Click on link to PDF Export
Error information:
[...]
Key points:
The browser's preferred language set to Chinese will appear in this exception. However, the browser's preferred language set to English will not appear.
Updated by Muntek Singh over 14 years ago
I am unable to reproduce using any language on trunk r3696 nor on redmine.org
Updated by Sheng Wang over 14 years ago
But, once I set browser preferred language to Chinese, browse http://www.redmine.org/issues/408 , click PDF export, internal error could occur. However, set browser preferred language to english, it could not occur.
Updated by Muntek Singh over 14 years ago
Ah ok, doing traditional chinese and using that exact issue #408 I am able to reproduce. Does not error with any other random issue I checked.
Updated by Sheng Wang over 14 years ago
I think this is the pdf export function bug. What's more, only too long issue can lead to this exception.
I once encountered similar problems:
There is a long long issue description inline. Once I click pdf export, it occur internal error. In addition, the CPU up to 100%。 then, I split the long line issue description information into two lines, it work well.
So, I think when deal with long string , memory overflow may occur.
Updated by Toshi MARUYAMA over 13 years ago
- Resolution deleted (
Cant reproduce)
Updated by Toshi MARUYAMA over 13 years ago
- Category changed from Website (redmine.org) to PDF export
Updated by Toshi MARUYAMA over 13 years ago
sl.yml.diff has committed r4004 #6009.
Updated by Toshi MARUYAMA over 13 years ago
source:trunk/config/locales/sl.yml@3610#L128
"general_pdf_encoding": UFT-8
Updated by Toshi MARUYAMA over 13 years ago
- Status changed from New to Closed
- Resolution set to Duplicate
Updated by Toshi MARUYAMA over 13 years ago
- Status changed from Closed to Reopened
- % Done changed from 20 to 0
- Resolution deleted (
Duplicate)
I confirmed #408 has error in Traditional Chinese.
We need to check after redmine.org updates 1.2.
Updated by Etienne Massip over 13 years ago
Guess it is not up to date to latest stable, far from that (no subtasking support), so that could take a while =)
Updated by Toshi MARUYAMA over 13 years ago
- Status changed from Reopened to Closed
I confirmed Redmine 1.1 http://www.redmine.org/issues/408#note-48 eats CPU 100% in Traditional Chinese, and it fixed in 1.2.