TicketPDF wkhtmltopdf error

When I attempt to use the wkhtmltopdf via the TicketPDF plugin, I always get the same error:

error: could not find component for path ‘/NoAuth/css/print.css’
context:


3: <head>
4: <title><% $title %></title>
5:
6: <style>
7: <& /NoAuth/css/print.css &>
8: section > div { padding: 3px 10px; }
9: label { display: inline-block; width: 150px; }
10: </style>
11: </head>

code stack: /var/www/rt/local/plugins/RT-Extension-TicketPDF/html/Ticket/PDF/Simple.html:7
/var/www/rt/local/plugins/RT-Extension-TicketPDF/html/Ticket/PDF/Display.pdf:16
/var/www/rt/share/html/Ticket/autohandler:66
/var/www/rt/sbin/…/lib/RT/Interface/Web.pm:697
/var/www/rt/sbin/…/lib/RT/Interface/Web.pm:376
/var/www/rt/share/html/autohandler:53

raw error

the “raw” error is:

could not find component for path '/NoAuth/css/print.css'


Trace begun at /usr/local/libdata/perl5/site_perl/HTML/Mason/Request.pm line 1239
HTML::Mason::Request::comp('RT::Interface::Web::Request=HASH(0x1d4e3f681298)', '/NoAuth/css/print.css') called at /var/www/rt/local/plugins/RT-Extension-TicketPDF/html/Ticket/PDF/Simple.html line 7
HTML::Mason::Commands::__ANON__('id', 41) called at /usr/local/libdata/perl5/site_perl/HTML/Mason/Component.pm line 135
HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x1d4de76d6658)', 'id', 41) called at /usr/local/libdata/perl5/site_perl/HTML/Mason/Request.pm line 1302
eval {...} at /usr/local/libdata/perl5/site_perl/HTML/Mason/Request.pm line 1292
HTML::Mason::Request::comp(undef, undef, undef, 'id', 41) called at /usr/local/libdata/perl5/site_perl/HTML/Mason/Request.pm line 1355
HTML::Mason::Request::scomp('RT::Interface::Web::Request=HASH(0x1d4e3f681298)', '/Ticket/PDF/Simple.html', 'id', 41) called at /var/www/rt/local/plugins/RT-Extension-TicketPDF/html/Ticket/PDF/Display.pdf line 16
HTML::Mason::Commands::__ANON__('id', 41, 'tpl', 'Simple') called at /usr/local/libdata/perl5/site_perl/HTML/Mason/Component.pm line 135
HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x1d4e65366a78)', 'id', 41, 'tpl', 'Simple') called at /usr/local/libdata/perl5/site_perl/HTML/Mason/Request.pm line 1302
eval {...} at /usr/local/libdata/perl5/site_perl/HTML/Mason/Request.pm line 1292
HTML::Mason::Request::comp(undef, undef, undef, 'id', 41, 'tpl', 'Simple') called at /usr/local/libdata/perl5/site_perl/HTML/Mason/Request.pm line 955
HTML::Mason::Request::call_next('RT::Interface::Web::Request=HASH(0x1d4e3f681298)') called at /var/www/rt/share/html/Ticket/autohandler line 66
HTML::Mason::Commands::__ANON__('id', 41, 'tpl', 'Simple') called at /usr/local/libdata/perl5/site_perl/HTML/Mason/Component.pm line 135
HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x1d4de315c958)', 'id', 41, 'tpl', 'Simple') called at /usr/local/libdata/perl5/site_perl/HTML/Mason/Request.pm line 1302
eval {...} at /usr/local/libdata/perl5/site_perl/HTML/Mason/Request.pm line 1292
HTML::Mason::Request::comp(undef, undef, undef, 'id', 41, 'tpl', 'Simple') called at /var/www/rt/sbin/../lib/RT/Interface/Web.pm line 697
RT::Interface::Web::ShowRequestedPage('HASH(0x1d4dc210ce98)') called at /var/www/rt/sbin/../lib/RT/Interface/Web.pm line 376
RT::Interface::Web::HandleRequest('HASH(0x1d4dc210ce98)') called at /var/www/rt/share/html/autohandler line 53
HTML::Mason::Commands::__ANON__('id', 41, 'tpl', 'Simple') called at /usr/local/libdata/perl5/site_perl/HTML/Mason/Component.pm line 135
HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x1d4de315cf58)', 'id', 41, 'tpl', 'Simple') called at /usr/local/libdata/perl5/site_perl/HTML/Mason/Request.pm line 1300
eval {...} at /usr/local/libdata/perl5/site_perl/HTML/Mason/Request.pm line 1292
HTML::Mason::Request::comp(undef, undef, undef, 'id', 41, 'tpl', 'Simple') called at /usr/local/libdata/perl5/site_perl/HTML/Mason/Request.pm line 481
eval {...} at /usr/local/libdata/perl5/site_perl/HTML/Mason/Request.pm line 481
eval {...} at /usr/local/libdata/perl5/site_perl/HTML/Mason/Request.pm line 433
HTML::Mason::Request::exec('RT::Interface::Web::Request=HASH(0x1d4e3f681298)') called at /usr/local/libdata/perl5/site_perl/HTML/Mason/PSGIHandler.pm line 96
eval {...} at /usr/local/libdata/perl5/site_perl/HTML/Mason/PSGIHandler.pm line 96
HTML::Mason::Request::PSGI::exec('RT::Interface::Web::Request=HASH(0x1d4e3f681298)') called at /usr/local/libdata/perl5/site_perl/HTML/Mason/Interp.pm line 342
HTML::Mason::Interp::exec(undef, undef, 'id', 41, 'tpl', 'Simple') called at /usr/local/libdata/perl5/site_perl/HTML/Mason/PSGIHandler.pm line 59
eval {...} at /usr/local/libdata/perl5/site_perl/HTML/Mason/PSGIHandler.pm line 59
HTML::Mason::PSGIHandler::invoke_mason('HTML::Mason::PSGIHandler::Streamy=HASH(0x1d4e1459f580)', 'HASH(0x1d4e4d523940)', 'HASH(0x1d4d712fa7f0)') called at /usr/local/libdata/perl5/site_perl/HTML/Mason/PSGIHandler/Streamy.pm line 52
HTML::Mason::PSGIHandler::Streamy::__ANON__('CODE(0x1d4ddf8745e0)') called at /usr/local/libdata/perl5/site_perl/Plack/Util.pm line 339
Plack::Util::__ANON__('CODE(0x1d4e5ed483e8)') called at /usr/local/libdata/perl5/site_perl/Starman/Server.pm line 198
Starman::Server::dispatch_request('Starman::Server=HASH(0x1d4e36b9ead8)', 'HASH(0x1d4dc4fd9928)') called at /usr/local/libdata/perl5/site_perl/Starman/Server.pm line 298
Starman::Server::process_request('Starman::Server=HASH(0x1d4e36b9ead8)', 'Net::Server::Proto::TCP=GLOB(0x1d4e02af9598)') called at /usr/local/libdata/perl5/site_perl/Net/Server.pm line 72
Net::Server::run_client_connection('Starman::Server=HASH(0x1d4e36b9ead8)') called at /usr/local/libdata/perl5/site_perl/Net/Server/PreFork.pm line 225
eval {...} at /usr/local/libdata/perl5/site_perl/Net/Server/PreFork.pm line 225
Net::Server::PreFork::run_child('Starman::Server=HASH(0x1d4e36b9ead8)') called at /usr/local/libdata/perl5/site_perl/Net/Server/PreFork.pm line 183
Net::Server::PreFork::run_n_children('Starman::Server=HASH(0x1d4e36b9ead8)', 5) called at /usr/local/libdata/perl5/site_perl/Net/Server/PreFork.pm line 107
Net::Server::PreFork::loop('Starman::Server=HASH(0x1d4e36b9ead8)') called at /usr/local/libdata/perl5/site_perl/Net/Server.pm line 58
Net::Server::run('Starman::Server=HASH(0x1d4e36b9ead8)', 'port', 'ARRAY(0x1d4d6c170a48)', 'host', '*', 'proto', 'tcp', 'serialize', 'none', 'min_servers', 5, 'min_spare_servers', 4, 'max_spare_servers', 4, 'max_servers', 5, 'max_requests', 1000, 'user', 1001, 'group', '67 67', 'listen', 1024, 'check_for_waiting', 1, 'no_client_stdout', 1) called at /usr/local/libdata/perl5/site_perl/Starman/Server.pm line 106
Starman::Server::run('Starman::Server=HASH(0x1d4e36b9ead8)', 'CODE(0x1d4e1459f5e0)', 'HASH(0x1d4e225848f8)') called at /usr/local/libdata/perl5/site_perl/Plack/Handler/Starman.pm line 25
Plack::Handler::Starman::run('Plack::Handler::Starman=HASH(0x1d4e22584958)', 'CODE(0x1d4e1459f5e0)') called at /usr/local/libdata/perl5/site_perl/Plack/Loader.pm line 84
Plack::Loader::run('Plack::Loader=HASH(0x1d4d68ea9388)', 'Plack::Handler::Starman=HASH(0x1d4e22584958)') called at /usr/local/libdata/perl5/site_perl/Plack/Runner.pm line 277
Plack::Runner::run('RT::PlackRunner=HASH(0x1d4def90e8f8)') called at /var/www/rt/sbin/../lib/RT/PlackRunner.pm line 150
eval {...} at /var/www/rt/sbin/../lib/RT/PlackRunner.pm line 150
RT::PlackRunner::run('RT::PlackRunner=HASH(0x1d4def90e8f8)') called at /var/www/rt/sbin/rt-server line 162

When I symlink /var/web/rt/static/css/base/print.css to /var/web/rt/html/NoAuth/print.css, I get further, but this time the error appears in the proper RT context, and reads:

Error: Loading pages (1/6) [> ] 0% [======> ] 10%

There’s a corresponding error on RT’s stderr:

[16876] [Fri May 24 19:18:05 2019] [error]: Error: Loading pages (1/6)
 (/var/www/rt/share/html/Elements/Error:78)                  ] 10%

with literally no other information.

It doesn’t matter if I select Generate PDF → Simple or → Display, both produce the same error.

I’m running 4.4.3, extracted to /var/www on OpenBSD, under the built-in Starman server, behind OpenBSD’s relayd(8) reverse-proxy. So far, everything else works properly, so I don’t think it’s OpenBSD or relayd or installation-specific?

Any pointers appreciated.
Thanks,
-Adam

(P.S. DevelMode is already on, I left it on after I got tired of forgetting to clear the cache and restart RT after every change.)

Its not a BPS extension so I haven’t looked at the code, but I see this in the README:

Newer versions of the utility have issues importing local CSS and JS resources and currently do not work with this extension.

Maybe the version of wkhtmltopdf is too new?

That is a possibility. I’m using v12 of wkhtmltopdf, where the docs only talk about v11 and v10. (Neither v10 nor v11 are available as a package for me.)

Is there any other way to generate reasonably-well-formatted, externally-portable “printouts” of a ticket?

I haven’t tried that extension so I do not know how it looks to do the printout, I know most browsers support printing a web page. That is not formatted well?

It also looks like you can get different versions of the Perl module here:

https://cpan.metacpan.org/authors/id/T/TB/TBR/

1 - No, the default ticket view is most definitely not suitable for printing. Fonts are too big, layout doesn’t work for portrait-mode page, input boxes and buttons are included.
2 - Wkhtmltopdf is an external binary, the TicketPDF extension appears to call it directly.

I’ll try my luck figuring out how to ask for support on that specific Perl module / extension.
Thanks anyway,
-Adam