esi-test-server-docker
esi-test-server-docker copied to clipboard
ESI: Invalid method encountered
I am using the playground for resolving ESI fragmentation.
`
<esi:include src="http://10.35.249.181:5012/esi/fragment.html" ttl="230" maxwait="1000"/>
Output: ` <SPAN class="hide"> /Debugging Section/
I checked the backend server, it's giving Error: Parse Error: Invalid method encountered error I tried many things but I could not resolve this issues please suggest what I am doing wrong
Backend error: `[Error: Parse Error: Invalid method encountered] { bytesParsed: 267, code: 'HPE_INVALID_METHOD', reason: 'Invalid method encountered', rawPacket: <Buffer 47 45 54 20 2f 65 73 69 65 73 69 2f 65 6e 67 6c 69 73 68 2f 70 65 70 2f 67 2d 6f 2d 63 2d 30 30 38 2d 34 2d 70 61 67 65 2d 68 65 61 64 65 72 2e 68 74 ... 389 more bytes>, headerSent: true } GET /esi/Fragment.html HTTP/1.1 Accept: / Host: 10.35.249.181:5012
Via: 4.0 asi_server
X-Akamai-ClientIP: 127.0.0.1
X-Akamai-MD-Component3: cache:max-age230s</cache:max-age>
X-AKAMAI-FORCE-G2G-AUTH: On
Connection: close
`
Docker command : docker run -ti -p 8088:80 akamaiesi/ets-docker:latest --remote_origin http://10.35.249.181:5012 --debug 10.35.249.181 --geo 10.35.249.181:off --remote_origin 127.0.0.1:5012 --debug localhost --geo localhost:off
I've noticed two "--remote_origin" options/flags at your command, one of them is incorrect: --remote_origin http://10.35.249.181:5012/
the flag should look like: --remote_origin hostname:port - hostname and port to use for an additional remote/upstream origin
Hi @sjoulano ,
I am testing in the local system and I corrected the docker command but its not working docker run -ti -p 8088:80 akamaiesi/ets-docker:latest --remote_origin 10.35.249.181:5012 --debug 10.35.249.181 --geo 10.35.249.181:off --debug localhost --geo localhost:off
10.35.249.181 : local system IP
Server Error: [Error: Parse Error: Invalid method encountered] { bytesParsed: 71, code: 'HPE_INVALID_METHOD', reason: 'Invalid method encountered', rawPacket: <Buffer 47 45 54 20 2f 66 72 61 6d 67 6d 65 6e 74 2e 68 74 6d 6c 20 48 54 54 50 2f 31 2e 31 0d 0a 41 63 63 65 70 74 3a 20 2a 2f 2a 0d 0a 48 6f 73 74 3a 20 31 ... 431 more bytes>, headerSent: true } GET /framgment.html HTTP/1.1 Accept: / Host: 10.35.249.181:5012
Via: 4.0 asi_server
X-Akamai-ClientIP: 127.0.0.1
Cookie: Akamai-UnencDebug=Akamai-ClientIP=127.0.0.1;Akamai-CPDomain=.0.0.1;Akamai-DebugValue=On;Akamai-Expires=999999999
X-Akamai-MD-Component3: cache:max-age230s</cache:max-age>
X-AKAMAI-FORCE-G2G-AUTH: On
X-Akamai-Debug: Akamai-ClientIP=127.0.0.1;Akamai-CPDomain=.0.0.1;Akamai-DebugValue=On;Akamai-Expires=999999999
Connection: close
Analyze:
- Akamai ETS is giving some request headers, between the request headers extra spaces are there, and the server lot is able to parse the request headers.
- I put the console log for request headers, it is showing only two headers Accept: / Host: 10.35.249.181:5012
- In the above error message is showing bytesParsed error in line number 71 and I am checking what is the data in line number 71 then its showing space (" ").
Maybe it is related to the encoding? E.g. bytes to string conversion on your server.