question

Matt Kruse avatar image
Matt Kruse asked

"Application response did not provide a Content-Length header"(but it does)

I finally have a test app up and running, connected, and my Echo is correctly calling my endpoint. Unfortunately, every time I return a response, I get this in my Echo console: "Application response did not provide a Content-Length header" I validated through debugging tools that my response does, in fact, have a Content-Length header. What else can I do to debug this? Here is my test app url. It is a temporary vm through koding.com, but I think it should stay up: https://umkk06bc52d8.mkruse.koding.io/
alexa skills kitsubmission testing certification
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matt Kruse avatar image
Matt Kruse answered
I suspect that the Echo is not correctly handling lower-case headers. By the spec, headers must be case-insensitive. Node.js sends back headers in lowercase, like content-length. But perhaps the Echo server is looking for Content-Length exactly? That might explain it?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matt Kruse avatar image
Matt Kruse answered
I was able to hack the Node source code, and change the case of the headers. Unfortunately that did not solve the problem. Even when I return it as "Content-Length", the Echo results still say I am not sending a Content-Length header. Clearly, I am. Any ideas?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matt Kruse avatar image
Matt Kruse answered
For reference, here is exactly what Chrome sees as the response when I request my endpoint url: Connection: keep-alive Content-Length: 143 Content-Type: application/json Date: Mon, 20 Apr 2015 13:00:02 GMT {"version":"1.0","response":{"outputSpeech":{"type":"PlainText","text":"Congratulations, Matt, you made an Echo app"},"shouldEndSession":true}}
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matt Kruse avatar image
Matt Kruse answered
I'm not sure if anyone is actually listening, but is there any example app url we can test with? I'd like to hit a working endpoint and compare the results to my own - headers, json structure, etc. That would be helpful for debugging. I don't even need to install the actual app, just hit the endpoint and inspect the response. Thanks
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jiggybyte avatar image
Jiggybyte answered
Hey Matt...I have a .Net solution that I am working with (web api) and am sending back the Json with a content-length in the header as well....and getting the exact same issue. I can watch the header fly by me in chrome dev tools, and all is well. The header is properly formatted with a length and the proper type. So...no dice for me in .Net either. I am hoping someone comments on my .Net thread and has a working example. Right now the Echo interface seems pretty strictly limited to Java...which is highly frustrating. I hope someone replies here with a general fix, because you are NOT alone.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

JBachand avatar image
JBachand answered
I have a working php endpoint, but no custom headers are being used. Maybe its your ssl config thats causing the issue? Requests must be https and you have to get the right cert info for that, took me a while to get that right.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matt Kruse avatar image
Matt Kruse answered
I don't think it's an SSL issue, because it communicates just fine to my endpoint. I have entered the certificate, etc. I originally had a certificate error and it did tell me that. If it is an SSL issue, I don't know what it would be. JBachand, can you let us know your endpoint url? That way I could connect to it and see your response.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matt Kruse avatar image
Matt Kruse answered
I re-installed openssl (Windows) to get the latest version and re-generated my key and certificate. Installed them on my server and in my Echo app config, and still the same issue persists. I'm not setting any custom headers, and I've made sure that the Content-Length header is generated and correct. I would love to have more detail in the Echo App card that is produced. I would also like to see a working example endpoint url, rather than just docs. Clearly there is something going on, but I have no way to diagnose the problem. Inspecting headers of a successful app endpoint would be very helpful.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jiggybyte avatar image
Jiggybyte answered
My app is currently hosted on an azure site and I am hitting the https endpoint...I don't think it's ssl for me. No posts/thoughts from Amazon?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matt Kruse avatar image
Matt Kruse answered
I got an endpoint to work successfully on a php server, using a legit wildcard cert. So I know that I am doing the technical part correctly. I'm trying to resolve the question of whether SSL is the root issue. I have a self-signed cert, which I generated on my Windows machine using openssl. I thought maybe that was the issue, that the cert was generated on a different machine, so I installed openssl on the server itself and re-generated, but still not luck. I am copying the correct certificate.pem contents into the Amazon Developer panel. I compared headers between the working endpoint and my non-working one, and they are identical. Content is identical. Content-Length is identical. Is there any other way to diagnose potential SSL issues? I connect to the endpoint directly from my browsers (FF, Chrome) and both give me a SSL warning but after I add an exception they both show the content correctly and all the headers. This to me makes it seem like SSL is working correctly? Is there anything else to check?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.