[2.0.2] Internal server error on static assets

1,018 views
Skip to first unread message

tlarhices

unread,
Jun 28, 2012, 10:15:58 PM6/28/12
to play-fr...@googlegroups.com
After migrating to 2.0.2 from 2.0.1 I often get those errors:

! @6aok6g274 - Internal server error, for request [GET /assets/stylesheets/jquery.contextMenu.css] ->

play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[ParseException: Unparseable date: "?, 05 6 2012 06:39:10 UTC"]]
        at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:134) [play_2.9.1.jar:2.0.2]
        at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:115) [play_2.9.1.jar:2.0.2]
        at akka.actor.Actor$class.apply(Actor.scala:318) [akka-actor.jar:2.0.2]
        at play.core.ActionInvoker.apply(Invoker.scala:113) [play_2.9.1.jar:2.0.2]
        at akka.actor.ActorCell.invoke(ActorCell.scala:626) [akka-actor.jar:2.0.2]
        at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:197) [akka-actor.jar:2.0.2]
Caused by: java.text.ParseException: Unparseable date: "?, 05 6 2012 06:39:10 UTC"
        at java.text.DateFormat.parse(Unknown Source) ~[na:1.7.0_03]
        at controllers.Assets$$anonfun$at$1$$anonfun$apply$6$$anonfun$apply$10$$
anonfun$apply$11$$anonfun$apply$12.apply(Assets.scala:80) ~[play_2.9.1.jar:2.0.2]
        at controllers.Assets$$anonfun$at$1$$anonfun$apply$6$$anonfun$apply$10$$
anonfun$apply$11$$anonfun$apply$12.apply(Assets.scala:80) ~[play_2.9.1.jar:2.0.2]
        at scala.Option.filterNot(Option.scala:162) ~[scala-library.jar:0.11.3]
        at controllers.Assets$$anonfun$at$1$$anonfun$apply$6$$anonfun$apply$10$$anonfun$apply$11.apply(Assets.scala:80) ~[play_2.9.1.jar:2.0.2]
        at controllers.Assets$$anonfun$at$1$$anonfun$apply$6$$anonfun$apply$10$$anonfun$apply$11.apply(Assets.scala:79) ~[play_2.9.1.jar:2.0.2]

It happens randomly on any static asset (javascript and css). Those errors usually freeze entirely play, all requests timeout, no reaction to CTRL+D / CTRL+C but some time just spam the console output.
Downgrading to 2.0.1 fixes the problem.

I am running on a Japanese windows Xp (in case it is a locale problem).

Mikael Selander

unread,
Jun 29, 2012, 4:42:22 AM6/29/12
to play-fr...@googlegroups.com
I have seen the same thing on my machine - running english OS X Lion.

I'm wondering if it might have something to do with getting the assets through an asset route by accessing the asset though a direct url, such as this:
<script src="assets/javascripts/lib/jquery-1.7.2.min.js" type="text/javascript"></script>

rather than using a @routes.Assets.at("/any/asset")-type url.

Eric Jain

unread,
Jun 29, 2012, 1:12:24 PM6/29/12
to play-fr...@googlegroups.com
On Thursday, June 28, 2012 7:15:58 PM UTC-7, tlarhices wrote:
After migrating to 2.0.2 from 2.0.1 I often get those errors:

[...] Unparseable date: "?, 05 6 2012 06:39:10 UTC"

Looks like the browser is sending an invalid If-Modified-Since header? What browser are you using? Can you post the full request headers?

jon hanson

unread,
Jul 1, 2012, 7:25:21 AM7/1/12
to play-fr...@googlegroups.com
I've posted the request headers for an example where the error occurs using Chrome below. I also explicitly checked for  IF_MODIFIED_SINCE but it isn't present. Note the date string that causes the parse exception varies, for example I've seen the following today:

"" (empty string)
".33E1.33E1"
"E.40122012"
".1314E.13142E2"

The error is intermittent - for me it happens around 75% of the time. It doesn't seem to happen if I place a breakpoint in Assets.scala.

Here's how Chrome reports the headers:

GET /data/ HTTP/1.1
Host: localhost:9000
Connection: keep-alive
Cache-Control: max-age=0
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.151 Safari/535.19
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
DNT: 1

Here's the Play log output:

12:10:40.510 [play-akka.actor.actions-dispatcher-2] INFO  application - request.headers=
Map(
HOST -> Buffer(localhost:9000),
ACCEPT-ENCODING -> Buffer(gzip,deflate,sdch),
ACCEPT-LANGUAGE -> Buffer(en-US,en;q=0.8),
ACCEPT-CHARSET -> Buffer(ISO-8859-1,utf-8;q=0.7,*;q=0.3),
CONNECTION -> Buffer(keep-alive),
CACHE-CONTROL -> Buffer(max-age=0),
ACCEPT -> Buffer(text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8),
DNT -> Buffer(1),
USER-AGENT -> Buffer(Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.151 Safari/535.19)
)
12:10:40.512 [play-akka.actor.actions-dispatcher-2] INFO  application - request.headers(IF_MODIFIED_SINCE)=None
12:10:40.560 [play-akka.actor.actions-dispatcher-2] INFO  play - Starting application default Akka system.
12:10:40.710 [play-akka.actor.actions-dispatcher-3] ERROR application -

! @6apbf5pd8 - Internal server error, for request [GET /assets/bootstrap/css/bootstrap.css] ->

play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[NumberFormatException: empty String]]
        at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:134) [play_2.9.1.jar:2.0.2]
        at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:115) [play_2.9.1.jar:2.0.2]
        at akka.actor.Actor$class.apply(Actor.scala:318) [akka-actor.jar:2.0.2]
        at play.core.ActionInvoker.apply(Invoker.scala:113) [play_2.9.1.jar:2.0.2]
        at akka.actor.ActorCell.invoke(ActorCell.scala:626) [akka-actor.jar:2.0.2]
        at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:197) [akka-actor.jar:2.0.2]
        at akka.dispatch.Mailbox.run(Mailbox.scala:179) [akka-actor.jar:2.0.2]
        at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:516) [akka-actor.jar:2.0.2]
        at akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259) [akka-actor.jar:2.0.2]
        at akka.jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975) [akka-actor.jar:2.0.2]
        at akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1479) [akka-actor.jar:2.0.2]
        at akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) [akka-actor.jar:2.0.2]
Caused by: java.lang.NumberFormatException: empty String
        at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source) ~[na:1.6.0_33]
        at java.lang.Double.parseDouble(Unknown Source) ~[na:1.6.0_33]
        at java.text.DigitList.getDouble(Unknown Source) ~[na:1.6.0_33]
        at java.text.DecimalFormat.parse(Unknown Source) ~[na:1.6.0_33]
        at java.text.SimpleDateFormat.subParse(Unknown Source) ~[na:1.6.0_33]
        at java.text.SimpleDateFormat.parse(Unknown Source) ~[na:1.6.0_33]
        at java.text.DateFormat.parse(Unknown Source) ~[na:1.6.0_33]
        at controllers.Assets$$anonfun$at$1$$anonfun$apply$6$$anonfun$apply$10$$anonfun$apply$11$$anonfun$apply$12.apply(Assets.scala:80) ~[play_2.9.1.jar:2.0.2
]
        at controllers.Assets$$anonfun$at$1$$anonfun$apply$6$$anonfun$apply$10$$anonfun$apply$11$$anonfun$apply$12.apply(Assets.scala:80) ~[play_2.9.1.jar:2.0.2
]
        at scala.Option.filterNot(Option.scala:162) ~[scala-library.jar:0.11.3]

Mathias Clerc

unread,
Jul 1, 2012, 10:23:57 PM7/1/12
to play-fr...@googlegroups.com
It is also with chrome which I have trouble with.

2012/7/1 jon hanson <jon.h...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/play-framework/-/2sMnB4gOlGgJ.
>
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framewor...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/play-framework?hl=en.

Nilanjan

unread,
Jul 1, 2012, 11:34:32 PM7/1/12
to play-fr...@googlegroups.com
I think this should be considered a defect. Even if the if-modified-since header contains invalid value the proper response should be 200 OK. I wonder why chrome is doing that? Is this only happening in chrome?


Nilanjan
> To post to this group, send email to play-framework@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framework+unsubscribe@googlegroups.com.

jon hanson

unread,
Jul 2, 2012, 8:46:54 AM7/2/12
to play-fr...@googlegroups.com
It seems like there are two problems at play here:

1. Possibly due to some race condition Play intermittently thinks the if-modified-since header field is present and contains garbage, when it is in fact not present. This so far has only been confirmed to occur with Chrome.
2. Data in this field that isn't parseable as a date causes the entire GET operation for the asset to fail. This should be more robust - bogus dates should simply be ignored.

jon


On Monday, 2 July 2012 04:34:32 UTC+1, Nilanjan wrote:
I think this should be considered a defect. Even if the if-modified-since header contains invalid value the proper response should be 200 OK. I wonder why chrome is doing that? Is this only happening in chrome?


Nilanjan

On Sunday, July 1, 2012 7:23:57 PM UTC-7, tlarhices wrote:
It is also with chrome which I have trouble with.

2012/7/1 jon hanson <>:

Guillaume Bort

unread,
Jul 2, 2012, 9:33:13 AM7/2/12
to play-fr...@googlegroups.com
Ok I just found that the Assets controller was using a val instead of
a def to server the date parser. It was causing race conditions. It's
now fixed in the master.
>>> > To post to this group, send email to play-fr...@googlegroups.com.
>>> > To unsubscribe from this group, send email to
>>> > play-framewor...@googlegroups.com.
>>> > For more options, visit this group at
>>> > http://groups.google.com/group/play-framework?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/play-framework/-/pUm6BZtvvkMJ.
>
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framewor...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/play-framework?hl=en.



--
Guillaume Bort, http://guillaume.bort.fr

jon hanson

unread,
Jul 2, 2012, 9:38:28 AM7/2/12
to play-fr...@googlegroups.com
That's great! Thanks Guillaume.

rgds,
Jon


On Monday, 2 July 2012 14:33:13 UTC+1, Guillaume Bort wrote:
Ok I just found that the Assets controller was using a val instead of
a def to server the date parser. It was causing race conditions. It's
now fixed in the master.

>>> > To post to this group, send email to play-framework@googlegroups.com.
>>> > To unsubscribe from this group, send email to
>>> > For more options, visit this group at
>>> > http://groups.google.com/group/play-framework?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/play-framework/-/pUm6BZtvvkMJ.
>
> To post to this group, send email to play-framework@googlegroups.com.
> To unsubscribe from this group, send email to

Mathias Clerc

unread,
Jul 2, 2012, 7:58:37 PM7/2/12
to play-fr...@googlegroups.com
Thanks for the quick fix

2012/7/2 jon hanson <jon.h...@gmail.com>:
>> >>> > play-fr...@googlegroups.com.
>> >>> > To unsubscribe from this group, send email to
>> >>> > play-framewor...@googlegroups.com.
>> >>> > For more options, visit this group at
>> >>> > http://groups.google.com/group/play-framework?hl=en.
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "play-framework" group.
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msg/play-framework/-/pUm6BZtvvkMJ.
>> >
>> > To post to this group, send email to play-fr...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > play-framewor...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/play-framework?hl=en.
>>
>>
>>
>> --
>> Guillaume Bort, http://guillaume.bort.fr
>
> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/play-framework/-/0tYN9URT-TgJ.
>
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framewor...@googlegroups.com.

Eric Jain

unread,
Jul 10, 2012, 4:16:25 PM7/10/12
to play-fr...@googlegroups.com
On Monday, July 2, 2012 6:33:13 AM UTC-7, Guillaume Bort wrote:
Ok I just found that the Assets controller was using a val instead of
a def to server the date parser. It was causing race conditions. It's
now fixed in the master.

Great! Will there be a bugfix release?

Jxtps

unread,
Jul 10, 2012, 7:13:59 PM7/10/12
to play-fr...@googlegroups.com

Guillaume Bort

unread,
Jul 11, 2012, 5:45:06 AM7/11/12
to play-fr...@googlegroups.com
Yes we wil have a bug fix release for that.

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/AIqmyb8t2iAJ.

To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

Thiago Miranda de Oliveira

unread,
Jul 25, 2012, 2:33:36 PM7/25/12
to play-fr...@googlegroups.com
Guillaume does the fix for the "500 internal error" on static files is on the play.zip that we download on the Play Framework page? Currently I have a app on production that uses plays and detected this error. How can I update the framework from the github code?

Thanks



On Wednesday, July 11, 2012 6:45:06 AM UTC-3, Guillaume Bort wrote:
Yes we wil have a bug fix release for that.

On Wed, Jul 11, 2012 at 1:13 AM, Jxtps <jxtp...@gmail.com> wrote:
Does it also fix the seemingly non-date-related issues? See:
 
 
Thanks!
 

On Monday, July 2, 2012 6:33:13 AM UTC-7, Guillaume Bort wrote:
Ok I just found that the Assets controller was using a val instead of
a def to server the date parser. It was causing race conditions. It's
now fixed in the master.

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/AIqmyb8t2iAJ.

To post to this group, send email to play-framework@googlegroups.com.
To unsubscribe from this group, send email to play-framework+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

Guillaume Bort

unread,
Jul 25, 2012, 4:16:31 PM7/25/12
to play-fr...@googlegroups.com
The 2.0.3-RC2 contains the fix.

http://download.playframework.org/releases/play-2.0.3-RC2.zip

We are still waiting to integrate more fixes to this 2.0.3 release but
we there was no major problems with this release candidate.

On Wed, Jul 25, 2012 at 11:33 AM, Thiago Miranda de Oliveira
<thia...@gmail.com> wrote:
> Guillaume does the fix for the "500 internal error" on static files is on
> the play.zip that we download on the Play Framework page? Currently I have a
> app on production that uses plays and detected this error. How can I update
> the framework from the github code?
>
> Thanks
>
>
>
> On Wednesday, July 11, 2012 6:45:06 AM UTC-3, Guillaume Bort wrote:
>>
>> Yes we wil have a bug fix release for that.
>>
>> On Wed, Jul 11, 2012 at 1:13 AM, Jxtps <jxtp...@gmail.com> wrote:
>>>
>>> Does it also fix the seemingly non-date-related issues? See:
>>>
>>>
>>> https://play.lighthouseapp.com/projects/82401-play-20/tickets/561-assets-controller-doesnt-specify-english-locale-when-settingparsing-dateif-modified-since-headers#ticket-561-2
>>>
>>> https://groups.google.com/d/msg/play-framework/E365fsEdQyw/XBL53qOmfjwJ
>>>
>>> Thanks!
>>>
>>>
>>> On Monday, July 2, 2012 6:33:13 AM UTC-7, Guillaume Bort wrote:
>>>>
>>>> Ok I just found that the Assets controller was using a val instead of
>>>> a def to server the date parser. It was causing race conditions. It's
>>>> now fixed in the master.
>>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "play-framework" group.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msg/play-framework/-/AIqmyb8t2iAJ.
>>>
>>> To post to this group, send email to play-fr...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> play-framewor...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/play-framework?hl=en.
>>
>>
>>
>>
>> --
>> Guillaume Bort, http://guillaume.bort.fr
>
> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/play-framework/-/ZjohnDhITRAJ.
>
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framewor...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages