question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Message is sent before header is sent?

See original GitHub issue
java.lang.IllegalStateException: sendHeaders has not been called
	at com.linecorp.armeria.internal.shaded.guava.base.Preconditions.checkState(Preconditions.java:508)
	at com.linecorp.armeria.server.grpc.ArmeriaServerCall.doSendMessage(ArmeriaServerCall.java:245)
	at com.linecorp.armeria.server.grpc.ArmeriaServerCall.lambda$sendMessage$4(ArmeriaServerCall.java:240)
	at com.linecorp.armeria.common.RequestContext.lambda$makeContextAware$3(RequestContext.java:479)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
	at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:384)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:834)

It happened in Armeria 1.1.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
m50dcommented, Dec 11, 2020

Ah yes, sorry. The exceptions always come in pairs, with the first one being:

java.lang.IllegalStateException: call is closed
 	at com.linecorp.armeria.internal.shaded.guava.base.Preconditions.checkState(Preconditions.java:508)
 	at com.linecorp.armeria.server.grpc.ArmeriaServerCall.doSendHeaders(ArmeriaServerCall.java:230)
 	at com.linecorp.armeria.server.grpc.ArmeriaServerCall.lambda$sendHeaders$2(ArmeriaServerCall.java:220)
 	at com.linecorp.armeria.common.RequestContext.lambda$makeContextAware$3(RequestContext.java:502)
 	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
 	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
 	at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:384)
 	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
 	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
 	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
 	at java.base/java.lang.Thread.run(Thread.java:834)
1reaction
ikhooncommented, Nov 3, 2020

We got a report that is similar to this error from Armeria slack channel. I’m sure this is the same case or not yet. Let me investigate on the reported issue. On the otherhand, we can sample the original stacktrace that called ArmeriaServerCall.close() with -Dcom.linecorp.armeria.verboseExceptions=... if -Dcom.linecorp.armeria.verboseResponses=true is set. /cc @okue

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix "Headers already sent" error in PHP - Stack Overflow
This error message gets triggered when anything is sent before you send HTTP headers (with setcookie or header ) ...
Read more >
How to Fix the "Cannot Modify Header Information - Kinsta
The first thing you need to do when you run into the “Cannot modify header information – headers already sent by” error is...
Read more >
What is the "headers already sent" PHP error? - KnownHost
When PHP receives the first output ( print , echo , <html> ) it will “flush” the collected headers. Afterward, it can send...
Read more >
Warning: "Headers already sent" or "Cannot modify ... - Drupal
In short, it means that somewhere in the code, something was printed to the browser before Drupal had finished preparing the page. This...
Read more >
How to fix Headers already sent error in PHP - Edureka
The page/output always follows the headers. PHP has to pass the headers to the web server first. It can only do that once....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found