Project

General

Profile

Actions

Feature #3661

closed

Configuration option to disable pdf creation of issues

Added by micah anderson about 17 years ago. Updated 12 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
PDF export
Target version:
-
Resolution:
Fixed

Description

I am having a problem with Redmine processes dying, occupying lots of CPU/memory and being difficult to stop. I did some debugging and found that they were always working on issue_to_pdf. Google and other crawlers would go after these links, and for some reason get stuck there.

I looked to see if I could disable this functionality for the entire site installation (or per project) to test to see if this would solve my problem, but there was no option.

For the moment, I am using some robots.txt regexp functionality, which is not fully supported by the robots.txt RFC, but some crawlers will honor (such as google), but it would be nice if I could disable this in Redmine's config.


Related issues

Related to Redmine - Feature #31617: robots.txt: disallow crawling dynamically generated PDF documentsClosedGo MAEDAActions
Related to Redmine - Feature #44424: Add "Export issues" and "Export time entries" permissionsClosedGo MAEDAActions
Actions #1

Updated by micah anderson about 17 years ago

The phusion passenger documentation states:

If one of your application instances is frozen (stopped responding), then you can figure out where it is frozen by killing it with SIGABRT. This will cause the application to raise an exception, with a backtrace.

Here is the backtrace that I get on every process that seems to be hung:

SignalException (SIGABRT):
    /usr/lib/ruby/1.8/phusion_passenger/abstract_request_handler.rb:328:in `install_useful_signal_handlers'
    /vendor/plugins/rfpdf/lib/rfpdf/chinese.rb:213:in `call'
    /vendor/plugins/rfpdf/lib/rfpdf/chinese.rb:213:in `MBMultiCell'
    /vendor/plugins/rfpdf/lib/rfpdf/chinese.rb:147:in `MultiCell'
    /lib/redmine/export/pdf.rb:225:in `issue_to_pdf'
    /app/controllers/issues_controller.rb:108:in `show'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/mime_responds.rb:131:in `call'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/mime_responds.rb:131:in `custom'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/mime_responds.rb:160:in `call'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/mime_responds.rb:160:in `respond'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/mime_responds.rb:154:in `each'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/mime_responds.rb:154:in `respond'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/mime_responds.rb:107:in `respond_to'
    /app/controllers/issues_controller.rb:105:in `show'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/base.rb:1166:in `send'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/base.rb:1166:in `perform_action_without_filters'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/filters.rb:579:in `call_filters'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/filters.rb:572:in `perform_action_without_benchmark'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
    /usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/rescue.rb:201:in `perform_action_without_caching'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/caching/sql_cache.rb:13:in `passenger_orig_perform_action'
    /var/lib/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
    /var/lib/gems/1.8/gems/activerecord-2.1.2/lib/active_record/query_cache.rb:8:in `cache'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/caching/sql_cache.rb:12:in `passenger_orig_perform_action'
    /usr/lib/ruby/1.8/phusion_passenger/railz/request_handler.rb:64:in `perform_action'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/base.rb:529:in `send'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/base.rb:529:in `process_without_filters'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/filters.rb:568:in `process_without_session_management_support'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/session_management.rb:130:in `process'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/base.rb:389:in `process'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/dispatcher.rb:149:in `handle_request'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/dispatcher.rb:107:in `dispatch'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/dispatcher.rb:104:in `synchronize'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/dispatcher.rb:104:in `dispatch'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi'
    /var/lib/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/dispatcher.rb:35:in `dispatch'
    /usr/lib/ruby/1.8/phusion_passenger/railz/request_handler.rb:49:in `process_request'
    /usr/lib/ruby/1.8/phusion_passenger/abstract_request_handler.rb:206:in `main_loop'
    /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:376:in `start_request_handler'
    /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:334:in `handle_spawn_application'
    /usr/lib/ruby/1.8/phusion_passenger/utils.rb:182:in `safe_fork'
    /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:332:in `handle_spawn_application'
    /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:351:in `__send__'
    /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:351:in `main_loop'
    /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:195:in `start_synchronously'
    /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:162:in `start'
    /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:213:in `start'
    /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:261:in `spawn_rails_application'
    /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
    /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
    /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
    /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
    /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:254:in `spawn_rails_application'
    /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:153:in `spawn_application'
    /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:286:in `handle_spawn_application'
    /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:351:in `__send__'
    /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:351:in `main_loop'
    /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:195:in `start_synchronously'
    /usr/lib/phusion_passenger/passenger-spawn-server:61
Actions #2

Updated by Thierry Bernardini about 17 years ago

Hi,
I have the same problem on one of my public server. It would be nice if we could edit permissions in the "Roles and permissions" menu, so we could choose who can generate pdf (and atom and csv) and who can not.
Thanks

Actions #3

Updated by Thierry Bernardini about 17 years ago

Well this bug was too problematic for us. We appleid a temporary solution, which is to modify the Apache configuration to rewrite all the urls that are used to export to pdf. Now we don't have anymore crashes...

Actions #4

Updated by Qualle Jellyfish almost 17 years ago

i have also problem with export to pdf, if the page has images.

Actions #5

Updated by Toshi MARUYAMA over 15 years ago

  • Category changed from Issues to PDF export
Actions #6

Updated by Harald Welte over 7 years ago

I still think a global option to disable PDF generation would be a useful general option to have.

Even beyond that, it would be even better if PDF generation could be restricted to e.g. registered users or certain groups.

Actions #7

Updated by Go MAEDA over 6 years ago

  • Related to Feature #31617: robots.txt: disallow crawling dynamically generated PDF documents added
Actions #8

Updated by Soren Stoutner 23 days ago

Debian received a bug report requesting this feature and noting that it can be used to DoS web servers by overloading their CPU.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1141608

The bug report contains an Apache configuration that disables the PDF URLs, but it seems to me that it would be more elegant to have a feature inside of Redmine that could disable PDF generation, either globally or just for unauthenticated users.

Actions #9

Updated by Go MAEDA 22 days ago

I have proposed new permissions "Export issues" and "Export time entries" in #44424. They control the CSV and PDF export of issues and the CSV export of time entries.

Removing these permissions from the Anonymous role prevents unauthenticated users, including web crawlers, from exporting. This stops crawlers from overloading the server by mass-requesting PDF exports. This is the approach that was also suggested in #note-2 and #note-6.

Please see: Feature #44424: Add "Export issues" and "Export time entries" permissions

Actions #10

Updated by Go MAEDA 22 days ago

  • Related to Feature #44424: Add "Export issues" and "Export time entries" permissions added
Actions #11

Updated by Go MAEDA 14 days ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

The "Export issues" and "Export time entries" permissions proposed in #44424 have been committed to trunk and will be included in the next major release, Redmine 7.1.0.

With these permissions, the problem reported in this issue can be solved by removing "Export issues" from the Anonymous role. Anonymous users, including web crawlers, then can no longer request the PDF exports of issues, so they cannot overload the server by generating PDFs. Removing "Export time entries" as well prevents the CSV export of time entries in the same way.

Closing this issue as resolved by #44424.

Actions #12

Updated by Soren Stoutner 12 days ago

Thank you.

Actions

Also available in: Atom PDF