Defect #25702
closedExporting wiki page with specific table to PDF causes 500
0%
Description
I am getting this exception when saving the attached wiki page to PDF.
Started GET "/projects/sandbox/wiki/User3.pdf" for 74.143.73.222 at 2017-04-26 12:00:05 +0000 Processing by WikiController#show as PDF Parameters: {"project_id"=>"sandbox", "id"=>"User3"} Current user: LBlakey (id=25) Rendered wiki/show.pdf.erb (2394.5ms) Completed 500 Internal Server Error in 2447ms (ActiveRecord: 42.0ms) ActionView::Template::Error (undefined method `[]' for nil:NilClass): 1: <%= raw wiki_page_to_pdf(@page, @project) %> lib/redmine/export/pdf.rb:95:in `RDMwriteFormattedCell' lib/redmine/export/pdf/wiki_pdf_helper.rb:79:in `write_wiki_page' lib/redmine/export/pdf/wiki_pdf_helper.rb:55:in `wiki_page_to_pdf' app/views/wiki/show.pdf.erb:1:in `_app_views_wiki_show_pdf_erb___2725341082725750565_42106300' lib/redmine/sudo_mode.rb:63:in `sudo_mode'
Steps to reproduce
- Create a wiki page called User3
- Paste in the contents of the attached wiki_crash.txt file. Save
- Click the PDF link at the bottom of the page. Get 500 error and the above exception in the logs
- Edit the page and remove the last word "r" at the end of the table. Save
- Click the PDF link again. Page saves successfully
System Information
Uses the docker redmine:latest image
Environment: Redmine version 3.3.2.stable Ruby version 2.2.6-p396 (2016-11-15) [x86_64-linux] Rails version 4.2.7.1 Environment production Database adapter Mysql2 SCM: Subversion 1.8.10 Mercurial 3.1.2 Bazaar 2.7.0 Git 2.1.4 Filesystem Redmine plugins: no plugin installed
Files
Updated by Toshi MARUYAMA over 7 years ago
- Category changed from Wiki to PDF export
Updated by Toshi MARUYAMA over 7 years ago
I cannot reproduce.
Environment: Redmine version 3.3.3.stable Ruby version 1.9.3-p551 (2014-11-13) [x86_64-linux] Rails version 4.2.7.1 Environment production Database adapter SQLite SCM: Subversion 1.7.14 Mercurial 2.8.2 Cvs 1.12.13 Git 1.8.3.1 Filesystem Redmine plugins: no plugin installed
Updated by Leon Blakey over 7 years ago
Thanks for looking at this. This happens with textile, maybe your wiki syntax is still set to markdown?
I reproduced again on 3.3.3 (latest docker image) with that wiki page name and text.
Updated by Toshi MARUYAMA over 7 years ago
- Status changed from Needs feedback to Confirmed
- Affected version changed from 3.3.2 to 3.3.3
Started GET "/test-3.3-stable/projects/hg-main/wiki/Test.pdf" for 127.0.0.1 at 2017-06-29 14:53:31 +0900 Processing by WikiController#show as PDF Parameters: {"project_id"=>"hg-main", "id"=>"Test"} Current user: admin (id=1) Rendered wiki/show.pdf.erb (375.6ms) Completed 500 Internal Server Error in 583ms (ActiveRecord: 201.3ms) ActionView::Template::Error (undefined method `[]' for nil:NilClass): 1: <%= raw wiki_page_to_pdf(@page, @project) %> lib/redmine/export/pdf.rb:95:in `RDMwriteFormattedCell' lib/redmine/export/pdf/wiki_pdf_helper.rb:79:in `write_wiki_page' lib/redmine/export/pdf/wiki_pdf_helper.rb:55:in `wiki_page_to_pdf' app/views/wiki/show.pdf.erb:1:in `_app_views_wiki_show_pdf_erb___3121506352715590158_69887059880660' lib/redmine/sudo_mode.rb:63:in `sudo_mode'
Updated by Jun NAITOH about 7 years ago
This problem fixed by rbpdf 1.19.3.
please bundle update.
Updated by Go MAEDA about 7 years ago
Jun NAITOH wrote:
This problem fixed by rbpdf 1.19.3.
please bundle update.
The latest rbpdf fixed the same problem on our customer's instance. Thank you for updating the gem.
Updated by Go MAEDA about 7 years ago
- Target version set to 3.3.5
I think it would be better to update Gemfile to ensure that the fixed version of rbpdf will be installed.
Index: Gemfile
===================================================================
--- Gemfile (revision 16952)
+++ Gemfile (working copy)
@@ -21,7 +21,7 @@
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :x64_mingw, :mswin]
-gem "rbpdf", "~> 1.19.2"
+gem "rbpdf", "~> 1.19.3"
# Optional gem for LDAP authentication
group :ldap do
Updated by Toshi MARUYAMA about 7 years ago
- Status changed from Confirmed to Closed
- Resolution set to Fixed
Gemfile is updated in 3.3-stable, 3.4-stable, and trunk, thanks.