Hi there!
I´ve installed the wkhtmltopdf toolkit in my shared host, and it worked. I´ve tested quite thoroughly and it worked just fine.
Now it doesn´t and I don´t understand why?
When I try to generate "some" pdfs (not all of them! sometimes it works), this error appears in a blank page:
Warning: MySQL server has gone away query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (4, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:8680:\"MySQL server has gone away\nquery: INSERT INTO watchdog\n (uid, type, message, variables, severity, link, location, referer, hostname, timestamp)\n VALUES\n (4, 'print_pdf', 'wkhtmltopdf: Loading pages (1/5)\\n[> ] 0%\\r[======> ] 10%\\rWarning: Blocked access to file \\nWarning: Blocked access to file \\nWarning: Blocked access to file \\n[===============> ] 26%\\r[============================================================] 100%\\rReso in /home/union/public_html/includes/database.mysqli.inc on line 128
Unable to stream pdf: headers already sent
Warning: MySQL server has gone away query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (4, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:339:\"MySQL server has gone away\nquery: UPDATE sessions SET uid = 4, cache = 1305140454, hostname = '200.114.148.130', session = 'node_overview_filter|a:0:{}og_last|s:4:\\"9530\\";user_overview_filter|a:0:{}dblog_overview_filter|a:0:{}', timestamp = 1305140546 WHERE sid = 'c68421e95712e4ab0907259b870af174'\";s:5:\"%file\";s:47:\"/home/union/public_html/includes/session.inc\";s:5:\"%line\";i:70;}', 3, '', 'http://www.union.com/printpdf/10196/all', 'http://www.union.com/consorcio/montevideo-2/liquidacion/10196', � in /home/union/public_html/includes/database.mysqli.inc on line 128
Warning: MySQL server has gone away query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (4, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:84:\"MySQL server has gone away\nquery: UPDATE users SET access = 1305140546 WHERE uid = 4\";s:5:\"%file\";s:47:\"/home/union/public_html/includes/session.inc\";s:5:\"%line\";i:75;}', 3, '', 'http://www.union.com/printpdf/10196/all', 'http://www.union.com/consorcio/montevideo-2/liquidacion/10196', '200.114.148.130', 1305140546) in /home/union/public_html/includes/database.mysqli.inc on line 128
I´ve checked de log and this is what it shows:
Tipo print_pdf
Fecha Miércoles, 11 Mayo, 2011 - 15:12
Usuario rosamunda
Ubicación http://www.union.com/printpdf/recibos/12688
Referente http://www.union.com/consorcio/demostraci%C3%B3n-115/liquidacion/12688
Mensaje wkhtmltopdf: Loading pages (1/5) [> ] 0% [======> ] 10% Warning: Blocked access to file Warning: Blocked access to file Warning: Blocked access to file [=============> ] 23% [============================================================] 100% Resolving links (2/5) [============================================================] Page 1 of 1 Counting pages (3/5) [============================================================] Page 1 of 1 Printing pages (5/5) [> ] Preparing [===================> ] Page 1 of 3 [=======================================> ] Page 2 of 3 [============================================================] Page 3 of 3 Done
Severidad aviso
Nombre del host 200.114.148.130
Operaciones
I´m running print 6.1.12 version and it seems that the problem should have been solved... (Warning: Blocked access to file).
I´ve changed anything, nor installed nothing, and I´m quite puzzled about this! Please, any help will be very much appreciated!
Rosamunda
Comments
Comment #1
Rosamunda commentedI´m sorry, I meant that I haven´t changed anything in my installation....
Comment #2
Rosamunda commentedAfter checking inch by inch each file, I´ve discovered that one of my print.tpl files inside my theme folder didn´t have the modifications explained here. So I´ve chenged it and tested it again.
Then the errors are a little different:
So I´ve went to my dev site wich is a copy of the working live site, and tested there. It works there perfectly fine (is the same shared hosting). The only difference is the performance: the dev site has all performance settings turn off, while the live site (the one that doesn´t work) has those performance settings on (cache: normal, page compression ON, Optimize CSS files ON, Optimize JavaScript files ON).
After trying again with the performance settings turned to OFF, the site will take forever to load. In fact, it won´t load at all. It keeps loadingd, forever. Literally.
Hope this enlights a bit about the core problem, if there is one...Any thoughts on this?
Many, many thanks in advance!
Rosamunda
Comment #3
Rosamunda commentedI´ve solved the problem, but it´s kinda weird, because it´s about commenting
<?php //print $print['base_href']; ?>inside<head>.After changing my template according to this the problem didn´t got solved. It only worked commenting that line.
I just wanted to add this solution here in case someone else get this issue aswell...
Cheers,
Rosamunda
Comment #5
Rosamunda commentedI would like to have some thoughts on this.. I mean it was just a coincidence? Was it a bug? Is somewhat a random thing that sometimes appears and sometimes doesn´t?
Comment #6
jcnventura@Rosamunda: what is the URL of your site and what was the value of the base_href line.
FYI: by removing that line and since the print page is usually in http://domain.tld/print/nid, whereas the normal page is usually in http://domain.tld/alias, if you specify images by relative path (ie < img src="images/nice.jpg" >), instead of getting the file from the correct place (http://domain.tld/images/nice.jpg) it will try to get them from a print-relative path(http://domain.tld/print/images/nice.jpg). This works fine for everyone else, which makes me think that you have a site-specific problem.
Comment #7
jcnventuraNo further info in 2 weeks. Closing the issue.