This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 4899 - language-negotiation failure leaves $lang undefined, crashes validator
Summary: language-negotiation failure leaves $lang undefined, crashes validator
Status: RESOLVED FIXED
Alias: None
Product: Validator
Classification: Unclassified
Component: check (show other bugs)
Version: 0.8.0
Hardware: PC Windows XP
: P2 critical
Target Milestone: 0.8.1
Assignee: Olivier Thereaux
QA Contact: qa-dev tracking
URL: http://lists.w3.org/Archives/Public/w...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-31 17:39 UTC by Peter Foti
Modified: 2007-08-14 11:28 UTC (History)
3 users (show)

See Also:


Attachments

Description Peter Foti 2007-07-31 17:39:11 UTC
Open the validator page with Firefox.  I see this bug with Firefox 2.0.0.5 and after updating to 2.0.0.6, I still see it.  Attempt to validate any page and I'll get the following error:
<start error>

Software error:

HTML::Template->new() : Cannot open included file /usr/local/validator/share/templates/result.tmpl : file not found. at /usr/share/perl5/HTML/Template.pm line 1632
	HTML::Template::_init_template('HTML::Template=HASH(0x8f34a38)') called at /usr/share/perl5/HTML/Template.pm line 1205
	HTML::Template::_init('HTML::Template=HASH(0x8f34a38)') called at /usr/share/perl5/HTML/Template.pm line 1099
	HTML::Template::new('HTML::Template', 'die_on_bad_params', 0, 'cache', 1, 'filename', '/usr/local/validator/share/templates/result.tmpl', 'loop_context_vars', 1, ...) called at /usr/local/validator/httpd/cgi-bin/check line 312
	ModPerl::ROOT::ModPerl::Registry::usr_local_validator_httpd_cgi_2dbin_check::handler('Apache2::RequestRec=SCALAR(0x90d0fc0)') called at /usr/lib/perl5/ModPerl/RegistryCooker.pm line 203
	eval {...} called at /usr/lib/perl5/ModPerl/RegistryCooker.pm line 203
	ModPerl::RegistryCooker::run('ModPerl::Registry=HASH(0x90d0f6c)') called at /usr/lib/perl5/ModPerl/RegistryCooker.pm line 169
	ModPerl::RegistryCooker::default_handler('ModPerl::Registry=HASH(0x90d0f6c)') called at /usr/lib/perl5/ModPerl/Registry.pm line 30
	ModPerl::Registry::handler('ModPerl::Registry', 'Apache2::RequestRec=SCALAR(0x90d0fc0)') called at -e line 0
	eval {...} called at -e line 0

For help, please send mail to the webmaster ([no address given]), giving this error message and the time and date of the error. 

<end error>
Using Ethereal, I can see that this is coming back as an HTTP/1.1 500 Internal Server Error.  This is 100% consistent.  
I don't see this error with IE6.  
I don't see this error on a Linux PC running Firefox 1.5.0.7.
I'm not sure if this is specific to my installation of Firefox, or possibly a particular add on.  These are the addons that are installed:
ColorZilla 1.0
del.icio.us 1.2
DOM Inspector 1.8.1.6
Firebug 1.05
Google Notebook 1.0.0.17
Greasemonkey 0.7.20070607.0
Html Validator 0.8.3.9
lori 0.2.0.20070425
MeasureIt 0.3.6
Operator 0.7
Pearl Crescent Page Saver Basic 1.5
Quick Locale Switcher 1.6.2
Talkback 2.0.0.6
Web Developer 1.1.4

This bug also prevents certain Firefox extensions (Web Developer Toolbar) from being able to validate pages.
Comment 1 Olivier Thereaux 2007-08-01 23:58:10 UTC
I cannot reproduce this. Are you working on your own instance of the validator, or  on validator.w3.org ? Could you give more details?

many thanks.
Comment 2 Peter Foti 2007-08-06 17:02:09 UTC
I am not using a local copy of the validator.  I'm using the one at validator.w3.org.

Today I'm getting a slightly different error:

Software error:

HTML::Template->new() : Cannot open included file /usr/local/validator/share/templates/result.tmpl : file not found. at /usr/share/perl5/HTML/Template.pm line 1658
	HTML::Template::_init_template('HTML::Template=HASH(0x9914f0)') called at /usr/share/perl5/HTML/Template.pm line 1238
	HTML::Template::_init('HTML::Template=HASH(0x9914f0)') called at /usr/share/perl5/HTML/Template.pm line 1124
	HTML::Template::new('HTML::Template', 'die_on_bad_params', 0, 'cache', 1, 'filename', '/usr/local/validator/share/templates/result.tmpl', 'loop_context_vars', 1, ...) called at /usr/local/validator/httpd/cgi-bin/check line 312

For help, please send mail to the webmaster ([no address given]), giving this error message and the time and date of the error. 


Also, my Ethereal trace looks like this (I've replaced my IP address with <Client PC>):

No.     Time        Source                Destination           Protocol Info
      6 1.851209    <Client PC>             128.30.52.58          TCP      2957 > http [SYN] Seq=0 Ack=0 Win=65535 Len=0 MSS=1460

Frame 6 (62 bytes on wire, 62 bytes captured)
Internet Protocol, Src Addr: <Client PC> (<Client PC>), Dst Addr: 128.30.52.58 (128.30.52.58)
Transmission Control Protocol, Src Port: 2957 (2957), Dst Port: http (80), Seq: 0, Ack: 0, Len: 0

No.     Time        Source                Destination           Protocol Info
      7 1.874101    128.30.52.58          <Client PC>             TCP      http > 2957 [SYN, ACK] Seq=0 Ack=1 Win=5840 Len=0 MSS=1460

Frame 7 (62 bytes on wire, 62 bytes captured)
Internet Protocol, Src Addr: 128.30.52.58 (128.30.52.58), Dst Addr: <Client PC> (<Client PC>)
Transmission Control Protocol, Src Port: http (80), Dst Port: 2957 (2957), Seq: 0, Ack: 1, Len: 0

No.     Time        Source                Destination           Protocol Info
      8 1.874156    <Client PC>             128.30.52.58          TCP      2957 > http [ACK] Seq=1 Ack=1 Win=65535 Len=0

Frame 8 (54 bytes on wire, 54 bytes captured)
Internet Protocol, Src Addr: <Client PC> (<Client PC>), Dst Addr: 128.30.52.58 (128.30.52.58)
Transmission Control Protocol, Src Port: 2957 (2957), Dst Port: http (80), Seq: 1, Ack: 1, Len: 0

No.     Time        Source                Destination           Protocol Info
      9 1.874715    <Client PC>             128.30.52.58          HTTP     GET /check?uri=http%3A%2F%2Fvalidator.w3.org&charset=%28detect+automatically%29&doctype=Inline&group=0 HTTP/1.1

Frame 9 (913 bytes on wire, 913 bytes captured)
Internet Protocol, Src Addr: <Client PC> (<Client PC>), Dst Addr: 128.30.52.58 (128.30.52.58)
Transmission Control Protocol, Src Port: 2957 (2957), Dst Port: http (80), Seq: 1, Ack: 1, Len: 859
Hypertext Transfer Protocol

No.     Time        Source                Destination           Protocol Info
     10 1.902589    128.30.52.58          <Client PC>             TCP      http > 2957 [ACK] Seq=1 Ack=860 Win=6872 Len=0

Frame 10 (60 bytes on wire, 60 bytes captured)
Internet Protocol, Src Addr: 128.30.52.58 (128.30.52.58), Dst Addr: <Client PC> (<Client PC>)
Transmission Control Protocol, Src Port: http (80), Dst Port: 2957 (2957), Seq: 1, Ack: 860, Len: 0

No.     Time        Source                Destination           Protocol Info
     11 2.230557    128.30.52.58          <Client PC>             HTTP     HTTP/1.1 200 OK (text/html)

Frame 11 (1115 bytes on wire, 1115 bytes captured)
Internet Protocol, Src Addr: 128.30.52.58 (128.30.52.58), Dst Addr: <Client PC> (<Client PC>)
Transmission Control Protocol, Src Port: http (80), Dst Port: 2957 (2957), Seq: 1, Ack: 860, Len: 1061
Hypertext Transfer Protocol
Line-based text data: text/html

No.     Time        Source                Destination           Protocol Info
     12 2.230595    128.30.52.58          <Client PC>             HTTP     Continuation or non-HTTP traffic

Frame 12 (60 bytes on wire, 60 bytes captured)
Internet Protocol, Src Addr: 128.30.52.58 (128.30.52.58), Dst Addr: <Client PC> (<Client PC>)
Transmission Control Protocol, Src Port: http (80), Dst Port: 2957 (2957), Seq: 1062, Ack: 860, Len: 5
Hypertext Transfer Protocol

No.     Time        Source                Destination           Protocol Info
     13 2.230616    <Client PC>             128.30.52.58          TCP      2957 > http [ACK] Seq=860 Ack=1067 Win=64469 Len=0

Frame 13 (54 bytes on wire, 54 bytes captured)
Internet Protocol, Src Addr: <Client PC> (<Client PC>), Dst Addr: 128.30.52.58 (128.30.52.58)
Transmission Control Protocol, Src Port: 2957 (2957), Dst Port: http (80), Seq: 860, Ack: 1067, Len: 0

No.     Time        Source                Destination           Protocol Info
     21 4.236448    128.30.52.58          <Client PC>             TCP      http > 2957 [FIN, ACK] Seq=1067 Ack=860 Win=6872 Len=0

Frame 21 (60 bytes on wire, 60 bytes captured)
Internet Protocol, Src Addr: 128.30.52.58 (128.30.52.58), Dst Addr: <Client PC> (<Client PC>)
Transmission Control Protocol, Src Port: http (80), Dst Port: 2957 (2957), Seq: 1067, Ack: 860, Len: 0

No.     Time        Source                Destination           Protocol Info
     22 4.236502    <Client PC>             128.30.52.58          TCP      2957 > http [ACK] Seq=860 Ack=1068 Win=64469 Len=0

Frame 22 (54 bytes on wire, 54 bytes captured)
Internet Protocol, Src Addr: <Client PC> (<Client PC>), Dst Addr: 128.30.52.58 (128.30.52.58)
Transmission Control Protocol, Src Port: 2957 (2957), Dst Port: http (80), Seq: 860, Ack: 1068, Len: 0



Comment 3 Richard Porter 2007-08-06 23:25:20 UTC
I am no longer able to use the validator. i invariably get "Software Error" when trying to validate pages that were OK before. I'm using NetSurf on RISC OS 4.39.
Comment 4 Olivier Thereaux 2007-08-07 02:32:25 UTC
Hi Peter.

Thanks for the very helpful debug trace. I think I figured out the bug, on my way to patching the validator.

(In reply to comment #2)

> HTML::Template->new() : Cannot open included file
> /usr/local/validator/share/templates/result.tmpl : file not found. 

This should not be happening. The validator is supposed to be looking in /usr/local/validator/share/templates/[LANGUAGE]/result.tmpl where [LANGUAGE] is the localization language chosen. Right now, it's always english, the validator has not been translated yet.

I found that in some (rare) cases, the language detection goes wrong, e.g when the client sends:

telnet validator.w3.org 80
GET /check?uri=http%3A%2F%2Fvalidator.w3.org HTTP/1.1
Host: validator.w3.org
Accept-Language: en;q=0


Which is the HTTP equivalent of the silly joke:
"give me content in english.... NOT!!!"

I am patching the validator to fall back to its default language when this happens.
Comment 5 Olivier Thereaux 2007-08-07 05:48:03 UTC
fixed by the patch at:
http://lists.w3.org/Archives/Public/www-validator-cvs/2007Aug/0054.html

and successfully tested.

The patch will be in validator 0.8.1, released in the days to come.