ant-media / Ant-Media-Server

Ant Media Server is a live streaming engine software that provides adaptive, ultra low latency streaming by using WebRTC technology with ~0.5 seconds latency. Ant Media Server is auto-scalable and it can run on-premise or on-cloud.
https://antmedia.io
Other
4.29k stars 636 forks source link

Error: 'Request Header is Too Large' on First Login #6603

Open SelimEmre opened 2 months ago

SelimEmre commented 2 months ago

Short description

When attempting to log in for the first time, the following error is encountered: "Request header is too large." This issue consistently occurs during initial login attempts and appears to be related to the size of the request header being sent. It only resolves when using an incognito window.

The problem is related to the maxHttpHeaderSize parameter, which defaults to 8 KB or 8192 bytes. We may consider increasing this value to 64 KB or 65536 bytes. When I added <entry key="maxHttpHeaderSize" value="65536" /> to connectionProperties in the jee-container.xml file, the issue was resolved.

Environment

Steps to reproduce

  1. Start with ./start.sh
  2. Open the Ant Media Server dashboard at localhost:5080 using the Mozilla Firefox browser.

Expected Behavior

I expect to be able to access the Ant Media Server Dashboard.

Actual Behavior

I couldn't access the Ant Media Server Dashboard.

Workaround Solution

If I try using an incognito window, the issue is resolved.

Logs

Request Header (8.389 kb) details

GET / HTTP/1.1
Host: localhost:5080
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br, zstd
Connection: keep-alive
Cookie: sb-pzutazfybbuehbvkdlwk-auth-token-code-verifier=%22b59f450e4838ea9f0afb7f366bbac2d643cacaca9c52c29e88c1ac0ad01161cf873f828a82571f2c68b147471c7fd5357e2d589b13b0593f%22; sb-pzutazfybbuehbvkdlwk-auth-token=%5B%22eyJhbGciOiJIUzI1NiIsImtpZCI6ImYxT0xaRHlLNnJRd3J2bmYiLCJ0eXAiOiJKV1QifQ.eyJhdWQiOiJhdXRoZW50aWNhdGVkIiwiZXhwIjoxNzE3NzEwNzI4LCJpYXQiOjE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bWFpbF92ZXJpZmllZCI6ZmFsc2UsIm5hbWUiOiJTZWxpbSBFbXJlIFRveSIsInBob25lX3ZlcmlmaWVkIjpmYWxzZSwic3ViIjoiNmM0ZDZhMjUtMzQ3OC00ZjQyLWFjYzYtODQyNTFhZmYzM2Y0In0sInByb3ZpZGVyIjoiZW1haWwiLCJsYXN0X3NpZ25faW5fYXQiOiIyMDI0LTA1LTE4VDIyOjQ2OjM5LjA3NDc0NVoiLCJjcmVhdGVkX2F0IjoiMjAyNC0wNS0xOFQyMjo0NjozOS4wNzUxMjFaIiwidXBkYXRlZF9hdCI6IjIwMjQtMDUtMThUMjI6NDY6MzkuMDc1MTIxWiIsImVtYWlsIjoic2VsaW1lbXJldG95QGdtYWlsLmNvbSJ9XSwiY3JlYXRlZF9hdCI6IjIwMjQtMDUtMThUMjI6NDY6MzkuMDE4MjEzWiIsInVwZGF0ZWRfYXQiOiIyMDI0LTA3LTA1VDEyOjQxOjI5LjE1NTY4M1oiLCJpc19hbm9ueW1vdXMiOmZhbHNlfX0; _gcl_au=1.1.797622913.1721051871; _ga_7SK9WEGYNK=GS1.1.1722017799.11.1.1722019333.60.0.0; _ga=GA1.1.809598856.1721051873; calltrk_referrer=direct; calltrk_landing=http%3A//localhost%3A3000/thank-you%3Fage%3D55%26zipCode%3D33305; calltrk_session_id=cdaba9f3-4287-4299-a1bc-f443755293ac; _uetvid=7f5f33a0430a11ef8062a72e5e954264; ajs_anonymous_id=de03d7c6-d9b5-4166-a1d1-e4e3702294e1; _ga_180NL12WP6=GS1.1.1724283481.4.0.1724283481.0.0.0; sb-efmreilsowpsadgzgyeg-auth-token-code-verifier=base64-Ijc5MTUyN2Q4NTNjOGMzMjUyMjRkOWVlYzRiYTE1YjQ1ZDlhYmE5MWZhMTMyOGZjMTYzODYxYjAzNDQwY2QxYmVlNGNkYmQzODgzODg4NmI2NTZjODNjOGQ1NjIwOTUwMDEyZmRlYTkzMmU2ZmQzYjUi; sb-efmreilsowpsadgzgyeg-auth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type Exception Report

Message Request header is too large

Description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).

Exception

java.lang.IllegalArgumentException: Request header is too large
    org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:774)
    org.apache.coyote.http11.Http11InputBuffer.parseHeader(Http11InputBuffer.java:968)
    org.apache.coyote.http11.Http11InputBuffer.parseHeaders(Http11InputBuffer.java:593)
    org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:285)
    org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
    org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:904)
    org.apache.tomcat.util.net.Nio2Endpoint$SocketProcessor.doRun(Nio2Endpoint.java:1685)
    org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
    org.apache.tomcat.util.net.AbstractEndpoint.processSocket(AbstractEndpoint.java:1266)
    org.apache.tomcat.util.net.Nio2Endpoint.setSocketOptions(Nio2Endpoint.java:330)
    org.apache.tomcat.util.net.Nio2Endpoint$Nio2Acceptor.completed(Nio2Endpoint.java:470)
    org.apache.tomcat.util.net.Nio2Endpoint$Nio2Acceptor.completed(Nio2Endpoint.java:406)
    java.base/sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:129)
    java.base/sun.nio.ch.Invoker$2.run(Invoker.java:221)
    java.base/sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:113)
    org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1190)
    org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
    org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)
    java.base/java.lang.Thread.run(Thread.java:1583)
burak-58 commented 2 months ago

Thank you @SelimEmre for reporting issue and offering a solution. Let me put this to Backlog, your suggested solution can be used until we implement a permanent solution.

SelimEmre commented 1 month ago

Hello, can I help the project as much as possible?

Hi @Playmaker12345 of course, you can help with the project! You can fork the repository and create a pull request from your branch. Just make sure to add tests for your code 😎