0

I am trying to use http://manifest-validator.com/ to check my cache manifest file by URI. It has been failing with the message:

Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request POST /validate.
Reason: Error reading from remote server

I have tried removing my robots.txt file in case Disallow: / was causing problems.

Has anyone else experienced this Proxy Error? Is this something that I can fix or is it an error with manifest-validator.com ?

Paul Trotter
  • 607
  • 7
  • 14
  • It's not a problem with the website, it just successfully validated mine. Perhaps you could tell us the URL of your page? This error, if it's not in the website (which it isn't), is probably caused by something wrong on your server – markasoftware Aug 11 '14 at 16:50
  • You can also just try to validate the file by upload – markasoftware Aug 11 '14 at 16:50
  • Thanks for your help. This is one of my URI's that fails: http://nucreativetesting.co.uk/cache-test/test003/manifest.appcache I believe that 'validate by file upload' just checks that file syntax, so it wouldn't detect issues with files being listed in the manifest and not present on the server which would actually break the application cache when it was used. Therefore I'd like to get the validate by URI working. – Paul Trotter Aug 13 '14 at 14:24

1 Answers1

0

In short

The reason for your error in this validator is a missing content-type attribute in your http response headers. Add one like text/cache-manifest and it will work.

Explaining the details

First of all, here are the response headers sent by your server. Note the missing content-type:

robert@robert-ubuntu:~$ curl -I -X HEAD http://nucreativetesting.co.uk/cache-test/test003/manifest.appcache
HTTP/1.1 200 OK
Date: Tue, 07 Oct 2014 16:25:59 GMT
Server: Apache/2.4.9 (Unix)
Last-Modified: Mon, 11 Aug 2014 13:45:07 GMT
ETag: "46c-5005ac34a2331"
Accept-Ranges: bytes
Content-Length: 1132

Why the proxy error?

The validator you are using is a NodeJS project, proxied by an apache webserver. The reason you get an error is that the apache waits for NodeJS to generate a response but it's hanging. After some time it gets a timeout and returns your error.

So why is it hanging?

In the current implementation of this validator you find the following code [1]:

try {
  contentType = res.headers['content-type'].split(';')[0];
  if ( ['text/plain', 'text/cache-manifest'].indexOf( contentType ) === -1 ) {
    callback('ERR_MANIFEST_MIMETYPE');
    return;
  }
} catch(e) {
  // TODO: Debug statement in production, had some strange output in the error logs.
  // Should be removed again
  console.error('manifest.js: Content-Type');
  return;
}

We see that res.headers['content-type'] should get split, but if there's no content type in your request header, this will raise an Exception because res.headers['content-type'] is undefined. The Exception itself is just logged to the servers output but isn't handled with their callback() function. Thats the reason the request is hanging till timeout.

Conclusion

It might be a bug or bad error handling on their side or just very unusual to not have a content type in your header. I don't know. But it should work with a content type ;).

References

[1]: https://github.com/fhemberger/manifest-validator/blob/6d82bc4660c4daaa131fee3c19a88ae6e462a44b/app/lib/manifest.js#L63 code producing your error

delbertooo
  • 840
  • 5
  • 10