-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exceptions in controllers are hidden by an exception in the default error handler #10486
Comments
Same issue. It may be caused by sbt 1.4.0 |
Ping @eed3si9n |
+1 Seeing this issue in sbt 1.4.0 |
Yes, rolling back to SBT 1.3.13 makes the problem go away. |
An workaround is to use a custom |
This comment has been minimized.
This comment has been minimized.
@eed3si9n this is happening because |
I see. Thanks for the clarification. |
This comment has been minimized.
This comment has been minimized.
@jtjeferreira Got this fixed by #10458? |
No |
Short of reverting to 1.3.x, is there a fix/workaround for this?? Difficult to track down the underlying exception when it's swallowed upstream... |
Did you try this #10486 (comment) ? |
@jtjeferreira I did try that, yes, and it doesn't work (Play 2.8.2, sbt 1.4.3, scala 2.13.3). Reverting to sbt 1.3.11 "fixes" the issue, but I'd prefer to be on the sbt 1.4.x series. |
And you still have the same exception? Are you sure you are correctly overriding the HttpErrorHandler? Does the stack trace still mentions the default |
yes
yes # application.conf
play.http.errorHandler = "AppErrorHandler"
class AppErrorHandler(
environment: Environment,
config: Configuration,
sourceMapper: Option[SourceMapper],
router: Option[Router]
)
extends DefaultHttpErrorHandler(
environment, config, None, router
) {...} Not sure what's going on, but it makes Play + sbt 1.4.x unusable. |
Play 2.8.5, JDK 11, and still got the same issue with sbt 1.4.3 but works just fine in 1.3.13 |
I am still in play 2.7.x and the workaround works for me... |
Same problem, but some differences in the details. When I run project every first time, it will raise error normally in HTML page,
|
I am also on Play 2.7.x, and the workaround does not work for me. |
FWIW, the following steps resolved this issue for me, with Play 2.8.7 and SBT 1.4.6: Add this line to your config file (
Add a file named import play.api.http.DefaultHttpErrorHandler
class AppErrorHandler extends DefaultHttpErrorHandler(sourceMapper = None) Thanks @jtjeferreira and @godenji for pointing me in the right direction! |
Just to let you know I have a working patch which I will submit soon hopefully. |
I see this is merged, but when will it be released? |
@deekayman This week I will submit one more pull request which is needed to fully support sbt 1.4 in Play, afterwards I will ask the Play team at Lightbend to release 2.8.8. |
@mkurz Do you have any update on when Lightbend might release this? Doesn't look like there's a 2.8.8 yet |
@mcintyre94 Sorry not update yet. Stay tuned. |
👋 |
agreed. without proper error handling, using Play is not an option |
FWIW the workaround in #10486 (comment) is working fine for my team. |
Thanks. However it is always preferable to not have "magic" workarounds. Do we have any timeline for release? |
I am pretty sure the release will happen this week. |
Just a friendly ping. Do we have a release date for this bug fix? |
seems Play 2.8.8 fixes the issue. It was realeased yesterday. I've already updated it. |
Thank you |
In Play 2.8.8 I get this error when building, that I didn't have before. Did something change about Play's dependencies?
|
@jaykaysharewell Play 2.8.8 upgraded to jackson 2.11.4 (from 2.10.x in Play 2.8.7): Does you project depend explicit on a specific Jackson version? Did you run |
Hi guys, the 2.8.8 release fixed the issue for me, thanks ! I also encountered the Jackson exception myself after upgrading, but that's not linked to this original issue. The cause on my project was a version conflict due to a transitive dependency to jackson (coming from sendgrid-java). You might have to identify a similar version conflict on your project @jaykaysharewell |
With 2.8.8 and sbt 1.5.0 I get
What is this about? Edit: OK it seems an issue with old enhancer from ebean plugin: playframework/play-ebean#214 |
@almothafar That is because you are using play-enhancer which, as you can see in its README, has reached end of life and wont receive updates anymore. As a consequence it is not compatible with sbt 1.4+ anymore. So what you need to do is remove play-enhancer from your project(s). Which means, you need to write the setters/getters yourself, or generate them with an IDE. Or you can try to switch to lombok. |
@mkurz already did that, I mean doing setters and getters, I'll try to play around that, thank you. |
I'm using Play 2.8.8 with sbt 1.3.13 and I still have this issue (Scala 2.13.7):
plugins.sbt:
dependencies:
Any idea? |
A workaround, is to provide an alternative HttpErrorHandler, see https://www.playframework.com/documentation/2.8.x/JavaErrorHandling or https://www.playframework.com/documentation/2.8.x/ScalaErrorHandling. The default samples are working fine! That helps me a lot. |
@cyrilfr It looks like your problem is not related to this issue here. A null pointer exception can be caused by any code, so I guess it's a problem in your app code. |
Play Version
2.8.2
API
Scala
Operating System
macOS 10.14
JDK
java -version
gives me:But note that it's running under 14. I got the same result running under 8, though.
Library Dependencies
Expected Behavior
Actual Behavior
If an exception is thrown outside of my controllers (for example, bad configuration) the error is reported as expected.
Reproducible Test Case
The text was updated successfully, but these errors were encountered: