• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7700 for generic doc work for TWiki-6.0.2. Use View topic Item7703 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.

Item5707: "tml2html did not send an HTTP header" error makes WYSIWYG editor unusable

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension WysiwygPlugin Normal Closed   patch 4.2.2

Edit Form Data

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

Detail

I'm running TWiki 4.2.0 and because the WYSIWYG editor has been messing up non-latin characters, and I've seen that those bugs were resolved in May 2008, using the configure script I've upgraded TinyMCEPlugin to version 16767 and WysiwygPlugin to version 16836.

Now the WYSIWYG editor is completely unusable - when I try to edit a page, in the editor box I can see a red message saying "There was a problem retrieving the page: Internal Server Error".

Apache logs the following error:

[Mon Jun 16 17:20:50 2008] [error] [client 10.101.4.2] Premature end of script headers: rest, referer: https://servername/bin/edit/Webname/Topicname?t=1213629645
[Mon Jun 16 17:20:50 2008] [warn] /bin/rest/WysiwygPlugin/tml2html did not send an HTTP header

-- TWiki:Main/AleksanderAdamowski - 16 Jun 2008

Sometimes I also get this:

[Mon Jun 16 17:57:16 2008] [error] [client 10.101.4.2] malformed header from script. Bad header=\x02: rest, referer: https://servername/bin/edit/Webname/TopicName?t=1213619387
[Mon Jun 16 17:57:16 2008] [warn] /bin/rest/WysiwygPlugin/tml2html did not send an HTTP header

-- TWiki:Main.AleksanderAdamowski - 16 Jun 2008

OK, there are more errors, I'm putting all I have. What's strange there are some HTML fragments in some of those errors:

[Mon Jun 16 16:40:03 2008] [error] [client 10.101.4.2] malformed header from script. Bad header=\x02: rest, referer: https://servername/bin/edit/WebName/TopicName?t=1213627198
[Mon Jun 16 16:40:03 2008] [warn] /bin/rest/WysiwygPlugin/tml2html did not send an HTTP header
[Mon Jun 16 16:40:54 2008] [error] [client 10.101.4.2] malformed header from script. Bad header=\x02: rest, referer: https://servername/bin/edit/WebName/TopicName?t=1213627232
[Mon Jun 16 16:40:54 2008] [warn] /bin/rest/WysiwygPlugin/tml2html did not send an HTTP header
[Mon Jun 16 16:41:48 2008] [error] [client 10.101.4.2] Premature end of script headers: rest, referer: https://servername/bin/edit/WebName/TopicName?t=1213627196
[Mon Jun 16 16:41:48 2008] [warn] /bin/rest/WysiwygPlugin/tml2html did not send an HTTP header
[Mon Jun 16 16:46:53 2008] [error] [client 10.101.4.2] malformed header from script. Bad header=\x02: rest, referer: https://servername/bin/edit/WebName/TopicName?t=1213627393
[Mon Jun 16 16:46:53 2008] [warn] /bin/rest/WysiwygPlugin/tml2html did not send an HTTP header
[Mon Jun 16 16:54:15 2008] [error] [client 10.101.4.2] malformed header from script. Bad header=\x02: rest, referer: https://servername/bin/edit/WebName/TopicName?t=1213628049
[Mon Jun 16 16:54:15 2008] [warn] /bin/rest/WysiwygPlugin/tml2html did not send an HTTP header
[Mon Jun 16 17:14:53 2008] [error] [client 10.101.4.2] malformed header from script. Bad header=\x02: rest, referer: https://servername/bin/edit/WebName/TopicName?t=1213629286
[Mon Jun 16 17:14:53 2008] [warn] /bin/rest/WysiwygPlugin/tml2html did not send an HTTP header
[Mon Jun 16 17:15:19 2008] [error] [client 10.101.4.2] malformed header from script. Bad header=\x02: rest, referer: https://servername/bin/edit/WebName/TopicName?t=1213629315
[Mon Jun 16 17:15:19 2008] [warn] /bin/rest/WysiwygPlugin/tml2html did not send an HTTP header
[Mon Jun 16 17:20:50 2008] [error] [client 10.101.4.2] Premature end of script headers: rest, referer: https://servername/bin/edit/WebName/TopicName?t=1213629645
[Mon Jun 16 17:20:50 2008] [warn] /bin/rest/WysiwygPlugin/tml2html did not send an HTTP header
[Mon Jun 16 17:32:14 2008] [error] [client 10.101.4.2] malformed header from script. Bad header= width="100%" cellspacing="0" : rest, referer: https://servername/bin/edit/WebName/TopicName?t=1213630321
[Mon Jun 16 17:32:14 2008] [warn] /bin/rest/WysiwygPlugin/tml2html did not send an HTTP header
[Mon Jun 16 17:32:56 2008] [error] [client 10.101.4.2] malformed header from script. Bad header=\x02: rest, referer: https://servername/bin/edit/WebName/TopicName?t=1213630370
[Mon Jun 16 17:32:56 2008] [warn] /bin/rest/WysiwygPlugin/tml2html did not send an HTTP header
[Mon Jun 16 17:40:44 2008] [error] [client 10.101.4.2] malformed header from script. Bad header=\x02: rest, referer: https://servername/bin/edit/WebName/TopicName?t=1213630840
[Mon Jun 16 17:40:44 2008] [warn] /bin/rest/WysiwygPlugin/tml2html did not send an HTTP header
[Mon Jun 16 17:41:12 2008] [error] [client 10.101.4.2] malformed header from script. Bad header= width="100%" cellspacing="0" : rest, referer: https://servername/bin/edit/WebName/TopicName?t=1213630867
[Mon Jun 16 17:41:12 2008] [warn] /bin/rest/WysiwygPlugin/tml2html did not send an HTTP header
[Mon Jun 16 17:57:16 2008] [error] [client 10.101.4.2] malformed header from script. Bad header=\x02: rest, referer: https://servername/bin/edit/WebName/TopicName?t=1213619387
[Mon Jun 16 17:57:16 2008] [warn] /bin/rest/WysiwygPlugin/tml2html did not send an HTTP header
[Mon Jun 16 18:07:11 2008] [error] [client 10.101.4.21] malformed header from script. Bad header= width="100%" cellspacing="0" : rest, referer: https://servername/bin/edit/WebName/TopicName?t=1213632264
[Mon Jun 16 18:07:11 2008] [warn] /bin/rest/WysiwygPlugin/tml2html did not send an HTTP header
[Mon Jun 16 18:07:55 2008] [error] [client 10.101.4.21] Premature end of script headers: rest, referer: https://servername/bin/edit/WebName/TopicName?t=1213632448
[Mon Jun 16 18:07:55 2008] [warn] /bin/rest/WysiwygPlugin/tml2html did not send an HTTP header
[Mon Jun 16 18:08:31 2008] [error] [client 10.101.4.21] malformed header from script. Bad header=\x02: rest, referer: https://servername/bin/edit/WebName/TopicName?t=1213632484
[Mon Jun 16 18:08:31 2008] [warn] /bin/rest/WysiwygPlugin/tml2html did not send an HTTP header

-- TWiki:Main.AleksanderAdamowski - 16 Jun 2008

What browser are you using? What server? What version of CGI is installed? What charset are you using?

tml2html just uses the standard CGI functions for compiling and sending HTTP responses, which obviously includes headers, so there's something odd going on here. Since it works for me (and most other people) all I can suggest at this stage is that you inspect the HTTP traffic using a packet sniffer such as ethereal and see if you can see what is going on.

-- CrawfordCurrie - 17 Jun 2008

I've disabled the WYSIWYG editor in the templates code (TWikibug:Item5709) and this is a production installation, so I cannot currently capture test traffic with a sniffer.

Web server is Apache (httpd-2.2.8-1.fc8) on Fedora Core 8 with mod_perl-2.0.3-14 and mod_ssl-2.2.8-1.fc8.

Perl is v5.8.8 built for x86_64-linux-thread-multi

Browser is Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9pre) Gecko/2008061604 Minefield/3.0pre

CGI on the server (I assume you mean the CPAN module) is perl-CGI-Simple-0.077-8.fc8.

Detailed list of all installed Perl-related RPMs:

perl-5.8.8-39.fc8
perl-Algorithm-Diff-1.1902-3.fc7
perl-Apache-Session-1.84-1.fc8
perl-Apache-Session-Wrapper-0.33-2.fc8
perl-Archive-Tar-1.34-1.fc8
perl-Archive-Zip-1.20-3.fc8
perl-Array-Compare-1.14-1.fc7
perl-Authen-DigestMD5-0.04-4.fc8
perl-Authen-SASL-2.10-1.fc8.1
perl-BSD-Resource-1.28-3.fc8
perl-CGI-Simple-0.077-8.fc8
perl-Class-Container-0.12-5.fc7
perl-Class-Data-Inheritable-0.06-2.fc8
perl-Class-Inspector-1.22-1.fc8
perl-Class-Singleton-1.4-1.fc8
perl-Compress-Raw-Zlib-2.005-3.fc8
perl-Compress-Zlib-2.005-2.fc8
perl-Convert-ASN1-0.21-2.fc8.1
perl-Convert-BinHex-1.119-6.fc8
perl-CPAN-1.76_02-39.fc8
perl-Crypt-PasswdMD5-1.3-2.fc8.1
perl-Curses-1.16-4.fc8
perl-Date-Pcalc-1.2-4.fc8.1
perl-DBD-MySQL-4.005-2.fc8.1
perl-DBD-Pg-1.49-5.fc8.2
perl-DBI-1.58-2.fc8
perl-devel-5.8.8-39.fc8
perl-Devel-StackTrace-1.18-2.fc8
perl-Devel-Symdump-2.07-3.fc8
perl-Digest-HMAC-1.01-16
perl-Digest-SHA1-2.11-4.fc8
perl-Email-Address-1.888-1.fc8
perl-Email-Send-2.185-3.fc8
perl-Email-Simple-1.999-1.fc7
perl-Event-1.09-2.fc8
perl-Exception-Class-1.23-3.fc7
perl-ExtUtils-CBuilder-0.19-1.fc8.1
perl-ExtUtils-Embed-1.26-39.fc8
perl-ExtUtils-MakeMaker-6.30-39.fc8
perl-ExtUtils-ParseXS-2.18-1.fc8.1
perl-File-Tail-0.99.3-5.fc8.1
perl-GD-2.35-2.fc8.1
perl-GDGraph-1.44-2.fc8.2
perl-GDTextUtil-0.86-9.fc8
perl-GSSAPI-0.24-1.fc7
perl-HTML-Parser-3.56-2.fc8
perl-HTML-Tagset-3.10-6.fc8
perl-IO-Compress-Base-2.005-2.fc8
perl-IO-Compress-Zlib-2.005-2.fc8
perl-IO-Socket-SSL-1.02-1.fc8.1
perl-IO-stringy-2.110-6.fc8
perl-IO-Tty-1.07-2.fc8.1
perl-IO-Zlib-1.07-1
perl-IPC-Run-0.80-3.fc7
perl-LDAP-0.34-3.fc7
perl-libs-5.8.8-39.fc8
perl-libs-5.8.8-39.fc8
perl-libwww-perl-5.808-3.fc8
perl-libxml-perl-0.08-2
perl-Mail-Sendmail-0.79-9.fc8.1
perl-MailTools-1.77-2.fc8
perl-MD5-2.03-1.fc8.1
perl-MIME-Lite-3.01-5.fc8.1
perl-MIME-tools-5.420-4.fc8
perl-Module-Build-0.2808-1.fc8
perl-Module-CoreList-2.11-1.fc8
perl-Module-Install-0.67-1.fc8
perl-Module-Pluggable-3.60-1.fc7
perl-Module-ScanDeps-0.75-1.fc8
perl-Net-DNS-0.61-1.fc8
perl-Net-IP-1.25-4.fc8
perl-Net-Jabber-2.0-7.fc8.1
perl-Net-SSLeay-1.30-5.fc8.1
perl-Net-Telnet-3.03-5.1
perl-Net-XMPP-1.02-2.fc7
perl-Newt-1.08-21.fc8
perl-Params-Validate-0.89-1.fc8
perl-PAR-Dist-0.25-1.fc8
perl-PDF-API2-0.69-2.fc8
perl-Pod-Coverage-0.18-2.fc6
perl-Pod-Escapes-1.04-5.fc8.1
perl-Pod-Readme-0.090-1.fc7
perl-Pod-Simple-3.05-1.fc8.1
perl-POE-0.9989-1.fc7
perl-POE-Filter-Zlib-1.8-1.fc7
perl-Regexp-Common-2.120-6.fc8
perl-Return-Value-1.302-3.fc8
perl-SOAP-Lite-0.68-5.fc8
perl-Socket6-0.19-4.fc8.1
perl-Spiffy-0.30-7.fc7
perl-String-CRC32-1.4-3.fc8
perl-TermReadKey-2.30-2
perl-Test-Base-0.54-2.fc8
perl-Test-Harness-2.56-39.fc8
perl-Test-Pod-1.26-1.fc6
perl-Test-Pod-Coverage-1.08-3.fc6
perl-Test-Portability-Files-0.05-4.fc7
perl-Test-Simple-0.62-39.fc8
perl-Text-Diff-0.35-4.fc7
perl-TimeDate-1.16-6.fc8
perl-Time-modules-2003.1126-4.fc8.1
perl-Tk-804.028-3.fc8
perl-URI-1.35-3.1
perl-version-0.7203-2.fc8
perl-XML-LibXML-1.62001-2.fc8.3
perl-XML-LibXML-Common-0.13-9
perl-XML-NamespaceSupport-1.09-2.fc8.1
perl-XML-Parser-2.34-8
perl-XML-SAX-0.16-2.fc8
perl-XML-Simple-2.17-1.fc8
perl-XML-Stream-1.22-6.fc8.1
perl-XML-Twig-3.29-4.fc8
perl-YAML-0.66-1.fc8
perl-YAML-Tiny-1.13-1.fc8

-- TWiki:Main.AleksanderAdamowski - 17 Jun 2008

RPMs don't help me, I'm afraid. I need the version numbers of the perl modules.

I would recommend that you make a second, test, install of standard TWiki 4.2.0 that you can use to reproduce the problem. I have no idea what is going on here, and packet sniffing is an obvious debug step.

Note that I just uploaded a fix for utf-8 in WysiwygPlugin, if that is part of the problem.

-- TWiki:Main.CrawfordCurrie - 17 Jun 2008

OK, I'll be setting up a parallel test installation of TWiki on that server.

With respect to RPMs, their versions correspond directly to versions of CPAN modules (with the -X.fc8 suffix removed from RPM versions). They are converted from CPAN modules by some automated script.

-- TWiki:Main.AleksanderAdamowski - 18 Jun 2008

Aleksander - the rpms contains more than one CPAN lib. The version of the RPM is not always the version of the CPAN lib.

Especially the CGI module is NOT part of perl-CGI-Simple normally but part of the standard perl rpm which in your case is perl-5.8.8-39.fc8 and that does not tell Crawford much.

To see the version of the CPAN module use this command line

perl -e 'use CGI::Session; print "$CGI::Session::VERSION\n";'

as an example to see the version of CGI::Session

or perl -e 'use CGI; print "$CGI::VERSION\n";' to see the version of CGI.

On my Centos the result is 3.15.

-- TWiki:Main.KennethLavrsen - 18 Jun 2008

My CGI version is 4.13:

# perl -e 'use CGI::Session; print "$CGI::Session::VERSION\n";'
4.13

I've also captured the http dialogue using Webscarab proxy. Here are the two relevant requests. Sensitive data (HTTP Basic authentication, session cookie and server's hostname) has been altered, other things are left unchanged.

-- AleksanderAdamowski - 19 Jun 2008

Aleksander. The 4.13 was CGI::Session. I admit this is confusing but CGI is not the same as CGI::Session.

-- TWiki:Main.KennethLavrsen - 19 Jun 2008

Oh, I should have read that more carefully. CGI is 3.29:

# perl -e 'use CGI; print "$CGI::VERSION\n";'
3.29

-- TWiki:Main.AleksanderAdamowski - 19 Jun 2008

So, any ideas?

-- TWiki:Main.AleksanderAdamowski - 26 Jun 2008

Crawford is on vacation away from computers so please wait another week and I am sure he will follow up.

Meanwhile Aleksander - did you setup the parallel test installation Crawford suggested?

You are the first ever to report this issue so we still suspect that there is something goofy in your existing installation.

-- TWiki:Main.KennethLavrsen - 26 Jun 2008

Nope, I didn't set it up yet. Need a separate virtual server for that - when setting up in the same system, the installations were getting a bit confused with respect to their paths. It's quite hard to run 2 TWikis on the same server. So I'll try setting a fresh installation on a separate server when I have time.

-- TWiki:Main.AleksanderAdamowski - 26 Jun 2008

I run 4 TWikis on my test server and it is dead easy.

So if you get problems then maybe we need to get a closer look at your server setup.

All you need to do to run two in parallel is different paths - both absolute file path and the alias and scriptalias. On http://merlin.lavrsen.dk I run both the current trunk, the next 4.2.1 code, the 4.1.2 code and the old Cairo (3.0) code.

I simply put them in each their own directory tree and make one http config file (in Redhat in /etc/httpd/conf.d) for each called twikitrunk.conf, twiki42.conf, twiki41.conf, cairo.conf. It is actually a good idea to have a parallel installation as an admin because it allows you to try out plugins and bug fixes without affecting the running installation. I also use virtual machines when I want to test different perl versions, but having the parallel installations has the advantage that the CPAN libs are exactly the same so you know things working in the parallel will also work in the production installation.

-- TWiki:Main.KennethLavrsen - 27 Jun 2008

Since I can't reproduce this problem on my own servers and the module versions are OK, I'm waiting for feedback from Aleksander on tests on the parallel TWiki.

-- TWiki:Main.CrawfordCurrie - 27 Jun 2008

OK, I've set up a parallel TWiki, which is a completely fresh installation of 4.2.0, no old data migrated from anywhere.

Now whenever I try to save a page that contains polish diacritical characters, I get an error page:

TWiki detected an internal error - please check your TWiki logs and webserver logs for more information.

Cannot decode string with wide characters

And I can see an error Cannot decode string with wide characters at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/Encode.pm line 166 in the httpd logs, among other errors (it looks like a stacktrace of some kind):

[Fri Jul 04 02:04:00 2008] [error] [client 212.76.37.196] Wide character in print at /var/www/twikitest/lib/TWiki/UI.pm line 18
5., referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215129815
[Fri Jul 04 02:04:00 2008] [error] [client 212.76.37.196] Cannot decode string with wide characters at /usr/lib64/perl5/5.8.8/x
86_64-linux-thread-multi/Encode.pm line 166., referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215129
815
[Fri Jul 04 02:04:00 2008] [error] [client 212.76.37.196]  at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/Encode.pm line 1
66, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215129815
[Fri Jul 04 02:04:00 2008] [error] [client 212.76.37.196] \tEncode::decode('utf8', '<p> Zlkl </p><p>za\xc5\xbc </p> <p> -- Main
.olo - 03 Jul 2008 </p>, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215129815
[Fri Jul 04 02:04:00 2008] [error] [client 212.76.37.196] ') called at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/Encode.
pm line 206, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215129815
[Fri Jul 04 02:04:00 2008] [error] [client 212.76.37.196] \tEncode::decode_utf8('<p> Zlkl </p><p>za\xc5\xbc </p> <p> -- Main.ol
o - 03 Jul 2008 </p>, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215129815
[Fri Jul 04 02:04:00 2008] [error] [client 212.76.37.196] ') called at /var/www/twikitest/lib/TWiki/Plugins/WysiwygPlugin/HTML2
TML.pm line 113, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215129815
[Fri Jul 04 02:04:00 2008] [error] [client 212.76.37.196] \tTWiki::Plugins::WysiwygPlugin::HTML2TML::convert('TWiki::Plugins::W
ysiwygPlugin::HTML2TML=HASH(0xf83200)', '<p> Zlkl </p><p>za\xc5\xbc </p> <p> -- Main.olo - 03 Jul 2008 </p>, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215129815
[Fri Jul 04 02:04:00 2008] [error] [client 212.76.37.196] ', 'HASH(0x1487970)') called at /var/www/twikitest/lib/TWiki/Plugins/WysiwygPlugin.pm line 228, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215129815
[Fri Jul 04 02:04:00 2008] [error] [client 212.76.37.196] \tTWiki::Plugins::WysiwygPlugin::TranslateHTML2TML('<p> Zlkl </p><p>za\xc5\xbc </p> <p> -- Main.olo - 03 Jul 2008 </p>, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215129815
[Fri Jul 04 02:04:00 2008] [error] [client 212.76.37.196] ', 'TestUtf01', 'Sandbox') called at /var/www/twikitest/lib/TWiki/Plugins/WysiwygPlugin.pm line 196, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215129815
[Fri Jul 04 02:04:00 2008] [error] [client 212.76.37.196] \tTWiki::Plugins::WysiwygPlugin::afterEditHandler('<!--WYSIWYG content - do not remove this comment, and never u...', 'TestUtf01', 'Sandbox', 'TWiki::Meta=HASH(0x14662d0)') called at /var/www/twikitest/lib/TWiki/Plugin.pm line 266, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215129815
[Fri Jul 04 02:04:00 2008] [error] [client 212.76.37.196] \tTWiki::Plugin::invoke('TWiki::Plugin=HASH(0x1283420)', 'afterEditHandler', '<!--WYSIWYG content - do not remove this comment, and never u...', 'TestUtf01', 'Sandbox', 'TWiki::Meta=HASH(0x14662d0)') called at /var/www/twikitest/lib/TWiki/Plugins.pm line 344, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215129815
[Fri Jul 04 02:04:00 2008] [error] [client 212.76.37.196] \tTWiki::Plugins::_dispatch('TWiki::Plugins=HASH(0xbe0670)', 'afterEditHandler', '<!--WYSIWYG content - do not remove this comment, and never u...', 'TestUtf01', 'Sandbox', 'TWiki::Meta=HASH(0x14662d0)') called at /var/www/twikitest/lib/TWiki/Plugins.pm line 647, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215129815
[Fri Jul 04 02:04:00 2008] [error] [client 212.76.37.196] \tTWiki::Plugins::_dispatch('TWiki::Plugins=HASH(0xbe0670)', 'afterEditHandler', '<!--WYSIWYG content - do not remove this comment, and never u...', 'TestUtf01', 'Sandbox', 'TWiki::Meta=HASH(0x14662d0)') called at /var/www/twikitest/lib/TWiki/Plugins.pm line 647, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215129815
[Fri Jul 04 02:04:00 2008] [error] [client 212.76.37.196] \tTWiki::Plugins::afterEditHandler('TWiki::Plugins=HASH(0xbe0670)', '<!--WYSIWYG content - do not remove this comment, and never u...', 'TestUtf01', 'Sandbox', 'TWiki::Meta=HASH(0x14662d0)') called at /var/www/twikitest/lib/TWiki/UI/Save.pm line 537, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215129815
[Fri Jul 04 02:04:00 2008] [error] [client 212.76.37.196] \tTWiki::UI::Save::save('TWiki=HASH(0xbe04f0)') called at /var/www/twikitest/lib/TWiki/UI.pm line 159, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215129815
[Fri Jul 04 02:04:00 2008] [error] [client 212.76.37.196] \tTWiki::UI::__ANON__() called at /var/www/twikitest/lib/CPAN/lib//Error.pm line 379, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215129815
[Fri Jul 04 02:04:00 2008] [error] [client 212.76.37.196] \teval {...} called at /var/www/twikitest/lib/CPAN/lib//Error.pm line 371, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215129815
[Fri Jul 04 02:04:00 2008] [error] [client 212.76.37.196] \tError::subs::try('CODE(0x605080)', 'HASH(0x11816f0)') called at /var/www/twikitest/lib/TWiki/UI.pm line 197, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215129815
[Fri Jul 04 02:04:00 2008] [error] [client 212.76.37.196] \tTWiki::UI::run('CODE(0xb75e90)', 'save', 1) called, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215129815
[Fri Jul 04 02:04:00 2008] [error] [client 212.76.37.196] Wide character in print at /var/www/twikitest/lib/TWiki.pm line 1719., referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215129815

Relevant settings from this installation's lib/LocalSite.cfg are:

...
$TWiki::cfg{Languages}{pl}{Enabled} = 1;
...
$TWiki::cfg{Site}{Locale} = 'pl_PL.UTF-8';
$TWiki::cfg{Site}{LocaleRegexes} = 1;
$TWiki::cfg{UpperNational} = '';
$TWiki::cfg{LowerNational} = '';
...
$TWiki::cfg{Plugins}{TinyMCEPlugin}{Enabled} = 1;
$TWiki::cfg{Plugins}{TwistyPlugin}{Enabled} = 1;
$TWiki::cfg{Plugins}{WysiwygPlugin}{Enabled} = 1;
...
$TWiki::cfg{Site}{CharSet} = 'utf-8';
$TWiki::cfg{Site}{Lang} = 'pl';
$TWiki::cfg{Site}{FullLang} = 'pl-pl';
$TWiki::cfg{UseLocale} = 1;

I've tested both with vanilla TWiki 4.2.0 and after using the configure script to install available (today's) updates for WysiwygPlugin, TinyMCEPlugin, TwistyContrib, BehaviourContrib etc. The errors remain the same.

-- TWiki:Main.AleksanderAdamowski - 04 Jul 2008

I'm guessing but it looks to me like you may have created those pages when your site character set was not set to UTF8. Now you are trying to edit with the site charset set to UTF8 and it doesn't like it.

I have tested UTF8 support with many different character sets now, and as long as you are consistent in your use of one character set, there should be no problem.

-- TWiki:Main.CrawfordCurrie - 04 Jul 2008

For each test, I've initialized a fresh new installation of TWiki, copied over my lib/LocalSite.cfg and bin/LocalLib.cfg, and then went to the Sandbox web, created a new topic, wrote some latin text, saved, then edited to add text with diacriticals.

Both creating the page and editing was done using the exact same configuration.

After that I were installing updates and repeating the tests.

I've also tried installing updates immediately after initializing a fresh TWiki installation, and only then creating/editing topics in Sandbox.

So these pages were not created with a different character set.

Actually there's a problem saving them at all when I put diacritical characters in them - I get the aforementioned error, new revisions don't make it to disk, the revision that's on disk still has only latin chars, it's the initial revision.

I cannot save pages that contain diacritical characters in other words.

-- TWiki:Main.AleksanderAdamowski - 04 Jul 2008

BTW, if that's significant, in my httpd.conf I have this directive:

AddDefaultCharset UTF-8

-- TWiki:Main.AleksanderAdamowski - 04 Jul 2008

The stack trace above suggests that the topic text has already been converted to unicode by the time it arrives in the WysiwygPlugin. So some mechanism is converting the UTF8 into unicode, either CGI.pm or in the web server. Please try turning off the AddDefaultCharset and seeing if that makes the problem go away.

-- CrawfordCurrie - 05 Jul 2008

I've commented out the AddDefaultCharset diretive in httpd.conf and nothing has changed, the error is the same:

[Mon Jul 07 17:21:18 2008] [error] [client 10.101.4.2] Wide character in print at /var/www/twikitest/lib/TWiki/UI.pm line 185., referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215444070
[Mon Jul 07 17:21:18 2008] [error] [client 10.101.4.2] Cannot decode string with wide characters at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/Encode.pm line 166., referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215444070
[Mon Jul 07 17:21:18 2008] [error] [client 10.101.4.2]  at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/Encode.pm line 166, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215444070
[Mon Jul 07 17:21:18 2008] [error] [client 10.101.4.2] \tEncode::decode('utf8', '<p> Zlkl\xc5\xbc\xc5\x82</p> <p> -- Main.olo - 03 Jul 2008 </p>, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215444070
[Mon Jul 07 17:21:18 2008] [error] [client 10.101.4.2] ') called at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/Encode.pm line 206, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215444070
[Mon Jul 07 17:21:18 2008] [error] [client 10.101.4.2] \tEncode::decode_utf8('<p> Zlkl\xc5\xbc\xc5\x82</p> <p> -- Main.olo - 03 Jul 2008 </p>, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215444070
[Mon Jul 07 17:21:18 2008] [error] [client 10.101.4.2] ') called at /var/www/twikitest/lib/TWiki/Plugins/WysiwygPlugin/HTML2TML.pm line 113, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215444070
[Mon Jul 07 17:21:18 2008] [error] [client 10.101.4.2] \tTWiki::Plugins::WysiwygPlugin::HTML2TML::convert('TWiki::Plugins::WysiwygPlugin::HTML2TML=HASH(0xf84240)', '<p> Zlkl\xc5\xbc\xc5\x82</p> <p> -- Main.olo - 03 Jul 2008 </p>, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215444070
[Mon Jul 07 17:21:18 2008] [error] [client 10.101.4.2] ', 'HASH(0x1488a80)') called at /var/www/twikitest/lib/TWiki/Plugins/WysiwygPlugin.pm line 228, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215444070
[Mon Jul 07 17:21:18 2008] [error] [client 10.101.4.2] \tTWiki::Plugins::WysiwygPlugin::TranslateHTML2TML('<p> Zlkl\xc5\xbc\xc5\x82</p> <p> -- Main.olo - 03 Jul 2008 </p>, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215444070
[Mon Jul 07 17:21:18 2008] [error] [client 10.101.4.2] ', 'TestUtf01', 'Sandbox') called at /var/www/twikitest/lib/TWiki/Plugins/WysiwygPlugin.pm line 196, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215444070
[Mon Jul 07 17:21:18 2008] [error] [client 10.101.4.2] \tTWiki::Plugins::WysiwygPlugin::afterEditHandler('<!--WYSIWYG content - do not remove this comment, and never u...', 'TestUtf01', 'Sandbox', 'TWiki::Meta=HASH(0x1467830)') called at /var/www/twikitest/lib/TWiki/Plugin.pm line 266, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215444070
[Mon Jul 07 17:21:18 2008] [error] [client 10.101.4.2] \tTWiki::Plugin::invoke('TWiki::Plugin=HASH(0x1284320)', 'afterEditHandler', '<!--WYSIWYG content - do not remove this comment, and never u...', 'TestUtf01', 'Sandbox', 'TWiki::Meta=HASH(0x1467830)') called at /var/www/twikitest/lib/TWiki/Plugins.pm line 344, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215444070
[Mon Jul 07 17:21:18 2008] [error] [client 10.101.4.2] \tTWiki::Plugins::_dispatch('TWiki::Plugins=HASH(0xbdf380)', 'afterEditHandler', '<!--WYSIWYG content - do not remove this comment, and never u...', 'TestUtf01', 'Sandbox', 'TWiki::Meta=HASH(0x1467830)') called at /var/www/twikitest/lib/TWiki/Plugins.pm line 647, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215444070
[Mon Jul 07 17:21:18 2008] [error] [client 10.101.4.2] \tTWiki::Plugins::afterEditHandler('TWiki::Plugins=HASH(0xbdf380)', '<!--WYSIWYG content - do not remove this comment, and never u...', 'TestUtf01', 'Sandbox', 'TWiki::Meta=HASH(0x1467830)') called at /var/www/twikitest/lib/TWiki/UI/Save.pm line 537, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215444070
[Mon Jul 07 17:21:18 2008] [error] [client 10.101.4.2] \tTWiki::UI::Save::save('TWiki=HASH(0xbdf200)') called at /var/www/twikitest/lib/TWiki/UI.pm line 159, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215444070
[Mon Jul 07 17:21:18 2008] [error] [client 10.101.4.2] \tTWiki::UI::__ANON__() called at /var/www/twikitest/lib/CPAN/lib//Error.pm line 379, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215444070
[Mon Jul 07 17:21:18 2008] [error] [client 10.101.4.2] \teval {...} called at /var/www/twikitest/lib/CPAN/lib//Error.pm line 371, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215444070
[Mon Jul 07 17:21:18 2008] [error] [client 10.101.4.2] \tError::subs::try('CODE(0x606070)', 'HASH(0x1182720)') called at /var/www/twikitest/lib/TWiki/UI.pm line 197, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215444070
[Mon Jul 07 17:21:18 2008] [error] [client 10.101.4.2] \tTWiki::UI::run('CODE(0xb74900)', 'save', 1) called, referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215444070
[Mon Jul 07 17:21:18 2008] [error] [client 10.101.4.2] Wide character in print at /var/www/twikitest/lib/TWiki.pm line 1719., referer: https://twiki.example.com/twikitest/bin/edit/Sandbox/TestUtf01?t=1215444070

-- TWiki:Main.AleksanderAdamowski - 07 Jul 2008

Very strange. Given that I can't reproduce this problem it's hard to know what to suggest.

-- TWiki:Main.CrawfordCurrie - 11 Jul 2008

Could you please post your Apache configuration? I've experienced similar behaviour running mod_perl if the rest script is run with mod_perl, and not cgi. With a more restrictive FileMatch like the one TWiki:Main.KennethLavrsen uses, it works: So NOT this (taken from some other website):

        #       <FilesMatch "^(?!configure)[a-z.]+$">
But this:
                <FilesMatch "(attach|edit|manage|rename|save|upload|view|.*auth).*">
                         SetHandler perl-script
...

-- TWiki:Main.OlivierRaginel - 21 Jul 2008

Downgrade to normal per TWiki:Codev.GeorgetownReleaseMeeting2008x07x21

-- TWiki:Main.KennethLavrsen - 22 Jul 2008

Just thought I'd add that I've been having exactly the same symptoms reported in the original post of this bug, running a fresh install of TWiki-4.2.1 on SME server 7.3 (from CentOS 4.6) The WYSIWYG editor was unusable ("Internal server error") and I had the same errors in my apache error logs.

I removed "|rest" from the FileMatch line in httpd.conf so it matched the one posted by Crawford Currie above and it fixed the problem.

-- TWiki:Main.OwenKaluza - 04 Aug 2008

Thanks Owen, that's useful to know. It suggests that this may be something to do with mod_perl.

-- TWiki:Main.CrawfordCurrie - 04 Aug 2008

Perhaps you can exchange a Vmware virtual machine for testing?

-- TWiki:Main.MartinCleaver - 04 Aug 2008

I'm getting it too: [Mon Aug 04 20:47:56 2008] [error] [client 10.207.192.233] Premature end of script headers: rest, referer: http://twikitest.futuresource.com/twiki/bin/edit/Sandbox/WebTopicList?t=1217900866 [Mon Aug 04 20:47:56 2008] [warn] /twiki/bin/rest/WysiwygPlugin/tml2html did not send an HTTP header

This is on Centos5.2 with mod_perl and a fresh install of TWiki-4.2.1 (also happens with an update of a working 4.2 install). I'm also getting this error: [Mon Aug 04 20:47:56 2008] [error] [client 10.207.192.233] (2)No such file or directory: Could not open password file: /var/www/html/twiki/data/.htpasswd, referer: http://twikitest.futuresource.com/twiki/bin/edit/Sandbox/WebTopicList?t=1217900866

even though I am using mod_auth_pam in apache and have turned off the options that should need .htpasswd file access.

-- TWiki:Main.LesMikesell - 05 Aug 2008

That really sounds like you need to restart your webserver. mod_perl heavily implicated.

Clearly I can't reproduce this, so I'm dependent on one of you guys to provide additional debugging support......

-- TWiki:Main.CrawfordCurrie - 05 Aug 2008

It must be mod_perl - taking 'rest' out of the FilesMatch list with the SetHandler perl-script fixes it. With mod_perl I get the error even if the edit button is the first page after restarting httpd.

-- TWiki:Main.LesMikesell - 07 Aug 2008

This appears to be a problem in Apache2. Investigating further,

-- TWiki:Main.CrawfordCurrie - 07 Aug 2008

I've got the same Error.

My Solution:

--- /var/www/twiki.old/lib/TWiki/Plugins/WysiwygPlugin.pm       2008-08-04 00:13:44.000000000 +0200
+++ /var/www/twiki/lib/TWiki/Plugins/WysiwygPlugin.pm   2008-08-06 16:02:53.000000000 +0200
@@ -647,6 +647,7 @@

     $text = Encode::encode_utf8($text);

+    local $| = 0;
     print "Content-Type: text/plain;charset=UTF-8\r\n";
     my $len; { use bytes; $len = length($text); };
     print "Content-length: ",$len,"\r\n";

See [1] for a explanation.

[1] http://perl.apache.org/docs/2.0/user/coding/coding.html#HTTP_Response_Headers

-- TWiki:Main.MatthiasFrey - 07 Aug 2008

Thanks Matthias; I had arrived at slightly different solution. Checking in shortly.

-- TWiki:Main.CrawfordCurrie - 07 Aug 2008

Fixed, committed to trunk and 4.2 branch, uploaded to TWiki.org.

If you are having this problem, update the WysiwygPlugin to the latest version on TWiki.org.

Marked "Waiting for release" for 4.2.2

-- CrawfordCurrie - 07 Aug 2008

ItemTemplate
Summary "tml2html did not send an HTTP header" error makes WYSIWYG editor unusable
ReportedBy TWiki:Main.AleksanderAdamowski
Codebase

SVN Range TWiki-5.0.0, Sun, 01 Jun 2008, build 16865
AppliesTo Extension
Component WysiwygPlugin
Priority Normal
CurrentState Closed
WaitingFor

Checkins TWikirev:17358 TWikirev:17359
TargetRelease patch
ReleasedIn 4.2.2
Topic attachments
I Attachment History Action Size Date Who Comment
Compressed Zip archivezip TWikibug_Item5707.zip r1 manage 8.1 K 2008-06-19 - 14:14 AleksanderAdamowski Captured dialog with /bin/rest/WysiwygPlugin/tml2html
Edit | Attach | Watch | Print version | History: r38 < r37 < r36 < r35 < r34 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r38 - 2008-08-15 - KennethLavrsen
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback