Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDFkit error on libappstest #310

Closed
crowesn opened this issue Jun 9, 2022 · 6 comments · Fixed by #379
Closed

PDFkit error on libappstest #310

crowesn opened this issue Jun 9, 2022 · 6 comments · Fixed by #379
Assignees
Labels
bug Something isn't working
Milestone

Comments

@crowesn
Copy link
Contributor

crowesn commented Jun 9, 2022

I, [2022-06-08T16:00:40.691314 #1347] INFO -- : [6673b991-7e76-4e85-bdad-403c90a8add6] Completed 500 Internal Server Error in 247ms (ActiveRecord: 4.4ms)
F, [2022-06-08T16:00:40.691768 #1347] FATAL -- : [6673b991-7e76-4e85-bdad-403c90a8add6]
F, [2022-06-08T16:00:40.691798 #1347] FATAL -- : [6673b991-7e76-4e85-bdad-403c90a8add6] PDFKit::ImproperWkhtmltopdfExitStatus (Command failed (exitstatus=1): /opt/webapps/treatment_databas
e/shared/vendor/bundle/ruby/2.7.0/bin/wkhtmltopdf --quiet --page-size Letter --margin-top 0.75in --margin-right 0.75in --margin-bottom 0.75in --margin-left 0.75in --encoding UTF-8 --print-
media-type --dpi 96 --footer-right Page\ \[page\] --footer-font-size 8 --footer-left \[date\] - -):
F, [2022-06-08T16:00:40.691812 #1347] FATAL -- : [6673b991-7e76-4e85-bdad-403c90a8add6]
F, [2022-06-08T16:00:40.691849 #1347] FATAL -- : [6673b991-7e76-4e85-bdad-403c90a8add6] app/controllers/conservation_records_controller.rb:99:in `build_pdf'
@crowesn
Copy link
Contributor Author

crowesn commented Jun 9, 2022

Resolve with
gem install executable_hooks
gem install wkhtmltopdf-binary

ln -s /opt/webapps/treatment_database/shared/vendor/bundle/ruby/2.7.0/gems/wkhtmltopdf-binary-0.12.6.5/bin/wkhtmltopdf_centos_8_amd64.gz /opt/webapps/treatment_database/shared/vendor/bundle/ruby/2.7.0/gems/wkhtmltopdf-binary-0.12.6.5/bin/wkhtmltopdf_ol_8.6_amd64.gz

@crowesn crowesn self-assigned this Jun 9, 2022
@crowesn crowesn added the bug Something isn't working label Jun 9, 2022
@hortongn
Copy link
Member

hortongn commented Jun 9, 2022

@crowesn Nice job. I do see that wkhtmltopdf-binary is already in our Gemfile. Are you sure it was necessary for you to install that gem again? But maybe our bundle install into the vendor directory isn't where it likes to live?

Also, that symlink looks brittle like it would break if we change our ruby version or the wkhtmltopdf-binary version. So we need to come up with a way to stabilize it or something.

@crowesn
Copy link
Contributor Author

crowesn commented Jun 9, 2022 via email

@crowesn
Copy link
Contributor Author

crowesn commented Jul 1, 2022

@hortongn Can we close this issue since we've crafted a solution?

@hortongn hortongn closed this as completed Jul 1, 2022
@crowesn
Copy link
Contributor Author

crowesn commented Jan 13, 2023

Reviewer reported broken pdf download on libappstest:

Was not able to download the abbreviated treatment report for i37045015.

Log showed the app was looking for a 8.7 version of wkhtmltopdf (our prior symlink fix has 8.6 version), probably bumped during updates.
Fixed by adding new symlink to bin dir but this reiterates how brittle our fix is.

ln -s /opt/webapps/treatment_database/shared/vendor/bundle/ruby/2.7.0/gems/wkhtmltopdf-binary-0.12.6.5/bin/wkhtmltopdf_centos_8_amd64.gz /opt/webapps/treatment_database/shared/vendor/bundle/ruby/2.7.0/gems/wkhtmltopdf-binary-0.12.6.5/bin/wkhtmltopdf_ol_8.7_amd64.gz

@crowesn crowesn reopened this Jan 13, 2023
@crowesn crowesn added this to the Version 1.0 milestone Feb 3, 2023
@crowesn
Copy link
Contributor Author

crowesn commented Feb 7, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants