• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item3619: PublishContrib stops on htmldoc failure

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension PublishContrib Normal Closed   n/a  

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

If htmldoc sends a minor error, PublishContrib does not give the resulting PDF to the user even though the PDF has been created.

Example: I have a topic with a too wide picture. When I run htmldoc on the prompt, I get the following message:

$ htmldoc --webpage --links --linkstyle plain --outfile /tmp/tt.pdf /home/httpd/twiki/export/Mettenmeier_940/WebHome.html
ERR014: Image on page 1 too large - truncation or overlapping may occur!
PAGES: 1
BYTES: 226000

Nevertheless the PDF file has been created.

When I try to create a PDF from that topic with the help of PublishContrib I get the following error in the browser:

Content-type: text/plain TWiki detected an internal error - please check your TWiki logs and webserver logs for more information. htmldoc failed: 1path

In the error.log I get the following:

[Mon Feb 12 21:30:16 2007] [error] [client 192.168.139.1] htmldoc '--webpage' '--links' '--linkstyle' 'plain' '--outfile' '/home/httpd/twiki/export/Mettenmeier_1048.pdf' '/home/httpd/twiki/export/Mettenmeier_1048/WebHome.html' -> , referer: http://twiki-mm-soft/twiki/bin/view/Mettenmeier/ExportToHTML
[Mon Feb 12 21:30:16 2007] [error] [client 192.168.139.1] htmldoc failed: 1// at /usr/share/perl/5.8/CGI/Carp.pm line 314., referer: http://twiki-mm-soft/twiki/bin/view/Mettenmeier/ExportToHTML
[Mon Feb 12 21:30:16 2007] [error] [client 192.168.139.1] \tCGI::Carp::realdie('htmldoc failed: 1//') called at /usr/share/perl/5.8/CGI/Carp.pm line 385, referer: http://twiki-mm-soft/twiki/bin/view/Mettenmeier/ExportToHTML
[Mon Feb 12 21:30:16 2007] [error] [client 192.168.139.1] \tCGI::Carp::die('htmldoc failed: 1//') called at /home/httpd/twiki/lib/TWiki/Contrib/PublishContrib/pdf.pm line 58, referer: http://twiki-mm-soft/twiki/bin/view/Mettenmeier/ExportToHTML
[Mon Feb 12 21:30:16 2007] [error] [client 192.168.139.1] \tTWiki::Contrib::PublishContrib::pdf::close('TWiki::Contrib::PublishContrib::pdf=HASH(0x8695984)') called at /home/httpd/twiki/lib/TWiki/Contrib/Publish.pm line 242, referer: http://twiki-mm-soft/twiki/bin/view/Mettenmeier/ExportToHTML
[Mon Feb 12 21:30:16 2007] [error] [client 192.168.139.1] \tTWiki::Contrib::Publish::publish('TWiki=HASH(0x88bb208)') called at /home/httpd/twiki/lib/TWiki/UI.pm line 109, referer: http://twiki-mm-soft/twiki/bin/view/Mettenmeier/ExportToHTML
[Mon Feb 12 21:30:16 2007] [error] [client 192.168.139.1] \tTWiki::UI::__ANON__() called at /home/httpd/twiki/lib/CPAN/lib///Error.pm line 379, referer: http://twiki-mm-soft/twiki/bin/view/Mettenmeier/ExportToHTML
[Mon Feb 12 21:30:16 2007] [error] [client 192.168.139.1] \teval {...} called at /home/httpd/twiki/lib/CPAN/lib///Error.pm line 371, referer: http://twiki-mm-soft/twiki/bin/view/Mettenmeier/ExportToHTML
[Mon Feb 12 21:30:16 2007] [error] [client 192.168.139.1] \tError::subs::try('CODE(0x8c96628)', 'HASH(0x8c277b0)') called at /home/httpd/twiki/lib/TWiki/UI.pm line 158, referer: http://twiki-mm-soft/twiki/bin/view/Mettenmeier/ExportToHTML
[Mon Feb 12 21:30:16 2007] [error] [client 192.168.139.1] \tTWiki::UI::run('CODE(0x83075fc)') called, referer: http://twiki-mm-soft/twiki/bin/view/Mettenmeier/ExportToHTML

The PDF file is created but it is not handed over to the user.

Of course, the initial error comes out of htmldoc. But I think, this error message should be handeld by the plugin: The user may get a warning but the resulting PDF file should be handed over to the user.

-- TWiki:Main/MarkusHesse - 12 Feb 2007

PublishContrib only reacts to a non-zero exit code coming from htmldoc (in this case, error code 1), which is normally taken as indicating a fatal error. If we have to parse the error message from htmldoc, that's pretty crap.

Anyone got a patch that fixes this? I don't use PDF output myself, so the motivation isn't strong. The obvious hack is to comment out this line from pdf.pm:

die "htmldoc failed: $exit/$data/$@" if $exit;

-- TWiki:Main.CrawfordCurrie - 13 Feb 2007

OK, I refactored the reporter to make this less aggressive, but it is an error.

CC

ItemTemplate
Summary PublishContrib stops on htmldoc failure
ReportedBy TWiki:Main.MarkusHesse
Codebase 4.0.4
SVN Range TWiki-4.1.1, Fri, 09 Feb 2007, build 12817
AppliesTo Extension
Component PublishContrib
Priority Normal
CurrentState Closed
WaitingFor

Checkins 12961
TargetRelease n/a
ReleasedIn

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2007-02-22 - CrawfordCurrie
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback