the problem: both my prod and dev environment is using nginx and unicorn, i am trying to use wicked_pdf gem to generate a pdf version of my user list page, it is working in the dev environment. however in production, the request kept timing out and i noticed that before it's timing out, the pdf file will appear in /tmp folder with size 0, however, right after the timeout (unicorn process is killed) the pdf will finish rendering, but it's not being displayed on the browser. In my dev environment, the file will be removed from /tmp folder and displayed in browser. the dev and production env are the same for the files involved (to my knowledge)
the setup added the following line in the respective files:
Gemfile: gem 'wkhtmltopdf-binary', '~> 0.9.9.3' gem 'wicked_pdf'
config/mime_types.rb
Mime::Type.register "application/pdf", :pdf
config/application.rb
config.middleware.use WickedPdf::Middleware
controller:
redirect_to "/t24_user/t24_to_ad_user.pdf"
i suspect this could be some deadlock issue, however, i can't seem to find any logs other than:
unicorn.stderr.log, and there is no err in the production.log file:
E, [2020-07-10T17:55:23.889910 #31607] ERROR -- : worker=1 PID:31617 timeout (46s > 45s), killing
E, [2020-07-10T17:55:23.901877 #31607] ERROR -- : reaped #<Process::Status: pid 31617 SIGKILL (signal 9)> worker=1
I, [2020-07-10T17:55:23.902035 #31607] INFO -- : worker=1 spawning...
I, [2020-07-10T17:55:23.905433 #39297] INFO -- : worker=1 spawned pid=39297
I, [2020-07-10T17:55:23.905655 #39297] INFO -- : worker=1 ready
any help would be appreciated.