プロジェクト

全般

プロフィール

Vote #77848

未完了

Redmine Out of Memory Exception when exporting issues with lots of columns (> 50) to PDF

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
New
優先度:
高め
担当者:
-
カテゴリ:
PDF export_39
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
39
version_id:
0
issue_org_id:
23962
author_id:
123866
assigned_to_id:
0
comments:
5
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
110
ステータス-->[New]

説明

I was able to reproduce the bug descibed hereafter on a bitnami vanilla redmine install. This bug makes the server eventually run out of memory, so is quite severe in my opinion.

Environment:
  Redmine version                3.3.0.stable
  Ruby version                   2.1.10-p492 (2016-04-01) [x86_64-linux]
  Rails version                  4.2.6
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.9.4
  Cvs                            1.12.13
  Git                            2.7.4
  Filesystem                     
Redmine plugins:
  no plugin installed

The bug occurs when trying to export to pdf a list of issues (on the issues page) with a huge amount of columns (around 50 or more). It happens even if there is only 1 issue to export.

To reproduce the bug, you can create around 40 custom fields with a random name (30 chars) / format and assign them to a tracker / project. then create an issue with random content in the fields. Then on the issues page, export to pdf with all columns included.

Because anyway the pdf would not look nice with such big amount of columns, we could perhaps forbid the export if there are too many columns (lets say > 40) selected in the export.

This is what I added to mitigate the error, in app/controllers/issues_controller.rb#index:


if params[:format] == 'pdf' && @query.column_names.count > 40
  redirect_to(:back)
  flash[:error] = "Please reduce the amount of columns selected."
  return
end

After further investigation, I found the problem to be located in lib/redmine/export/pdf.rb, in the RDMMultiCell method. So it may be due to RBPDF...


journals

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
I could not reproduce this problem.

The procedure I did is as follows. :
# Create 1 issue with custom field.
# app/models/custom_field.rb "attr_protected :id" comment out.
http://www.redmine.org/projects/redmine/repository/entry/tags/3.4.4/app/models/custom_field.rb#L38
# Redmine Restart : touch tmp/restart.txt
# Create many issue custom fields
You can use this command in the console: (1..60).each { |i| CustomField.new(IssueCustomField.last.attributes.merge!({id:nil,name:"testooooooooooooooooooooooo-#{i}", is_for_all: true})).save }
# Go to /issues page
# Choose to display every columns and apply the filter
# Try to export to PDF

<pre>
$ ruby bin/about

sh: darcs: command not found
sh: bzr: command not found
Environment:
Redmine version 3.4.4.stable
Ruby version 2.1.2-p95 (2014-05-08) [i686-linux]
Rails version 4.2.8
Environment production
Database adapter SQLite
SCM:
Subversion 1.6.11
Mercurial 1.4
Git 1.7.12.4
Filesystem
Redmine plugins:
no plugin installed
</pre>
--------------------------------------------------------------------------------


related_issues

duplicates,Closed,28337,Problem when creating PDF with too many columns

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0