I'm using curl. This request works:

curl -X 'POST' -H 'Accept: */*' -H 'Accept-Encoding: gzip, deflate' -H
'Connection: keep-alive' -H 'Content-Length: 1031' -H 'Content-type:
application/json' -H 'User-Agent: python-requests/2.18.1' -d '{"*source*":
{"itemId": "webpage", "scope": "systemscope", "itemType": "page"},
"events": [{"eventType": "pageview", "target": {"itemId": "
http://g1.globo.com/sp/noticia/2018/12/27/aloysio-nunes-sera-o-7o-ministro-do-governo-temer-na-gestao-doria-em-sp.ghtml?utm_source=push&utm_medium=app&utm_campaign=pushg1";,
"scope": "systemscope", "itemType": "page", "properties": {"product":
"unknown", "referrer": null, "xforwardedfor": "177.79.24.245", "timestamp":
"1545912327068", "object": "
http://g1.globo.com/sp/noticia/2018/12/27/aloysio-nunes-sera-o-7o-ministro-do-governo-temer-na-gestao-doria-em-sp.ghtml?utm_source=push&utm_medium=app&utm_campaign=pushg1";,
"userid": "10043195148951281664", "host": "177.79.24.245", "abtestkey":
null, "user": "10043195148951281664", "provider": "anonymous", "useragent":
"Mobile App: com.globo.iG1 - iOS version: 12.0 - GloboIDSDK: 1.6.0",
"operation": "horizon-pageview", "documentid": null}}, "source": {"itemId":
"unknown", "scope": "systemscope", "itemType": "page"}, "scope":
"systemscope"}]}' '
http://localhost:8181/context.json?sessionId=88657c83-2ce7-4c87-a2bc-6dce88a63f5r'
-v

This not:

curl -X 'POST' -H 'Accept: */*' -H 'Accept-Encoding: gzip, deflate' -H
'Connection: keep-alive' -H 'Content-Length: 1031' -H 'Content-type:
application/json' -H 'User-Agent: python-requests/2.18.1' -d '{"*sourc*":
{"itemId": "webpage", "scope": "systemscope", "itemType": "page"},
"events": [{"eventType": "pageview", "target": {"itemId": "
http://g1.globo.com/sp/noticia/2018/12/27/aloysio-nunes-sera-o-7o-ministro-do-governo-temer-na-gestao-doria-em-sp.ghtml?utm_source=push&utm_medium=app&utm_campaign=pushg1";,
"scope": "systemscope", "itemType": "page", "properties": {"product":
"unknown", "referrer": null, "xforwardedfor": "177.79.24.245", "timestamp":
"1545912327068", "object": "
http://g1.globo.com/sp/noticia/2018/12/27/aloysio-nunes-sera-o-7o-ministro-do-governo-temer-na-gestao-doria-em-sp.ghtml?utm_source=push&utm_medium=app&utm_campaign=pushg1";,
"userid": "10043195148951281664", "host": "177.79.24.245", "abtestkey":
null, "user": "10043195148951281664", "provider": "anonymous", "useragent":
"Mobile App: com.globo.iG1 - iOS version: 12.0 - GloboIDSDK: 1.6.0",
"operation": "horizon-pageview", "documentid": null}}, "source": {"itemId":
"unknown", "scope": "systemscope", "itemType": "page"}, "scope":
"systemscope"}]}' '
http://localhost:8181/context.json?sessionId=88657c83-2ce7-4c87-a2bc-6dce88a63f5r'
-v

The strange thing is that:

curl -X 'POST' -H 'Accept: */*' -H 'Accept-Encoding: gzip, deflate' -H
'Connection: keep-alive' -H 'Content-Length: 1031' -H 'Content-type:
application/json' -H 'User-Agent: python-requests/2.18.1' -d '{"*sources*":
{"itemId": "webpage", "scope": "systemscope", "itemType": "page"},
"events": [{"eventType": "pageview", "target": {"itemId": "
http://g1.globo.com/sp/noticia/2018/12/27/aloysio-nunes-sera-o-7o-ministro-do-governo-temer-na-gestao-doria-em-sp.ghtml?utm_source=push&utm_medium=app&utm_campaign=pushg1";,
"scope": "systemscope", "itemType": "page", "properties": {"product":
"unknown", "referrer": null, "xforwardedfor": "177.79.24.245", "timestamp":
"1545912327068", "object": "
http://g1.globo.com/sp/noticia/2018/12/27/aloysio-nunes-sera-o-7o-ministro-do-governo-temer-na-gestao-doria-em-sp.ghtml?utm_source=push&utm_medium=app&utm_campaign=pushg1";,
"userid": "10043195148951281664", "host": "177.79.24.245", "abtestkey":
null, "user": "10043195148951281664", "provider": "anonymous", "useragent":
"Mobile App: com.globo.iG1 - iOS version: 12.0 - GloboIDSDK: 1.6.0",
"operation": "horizon-pageview", "documentid": null}}, "source": {"itemId":
"unknown", "scope": "systemscope", "itemType": "page"}, "scope":
"systemscope"}]}' '
http://localhost:8181/context.json?sessionId=88657c83-2ce7-4c87-a2bc-6dce88a63f5r'
-v

returns a fast 400 error code.

Em ter, 22 de jan de 2019 às 06:28, Serge Huber <shu...@apache.org>
escreveu:

> Hello Diogo,
>
> From the exception, it seems more like there is a timeout while
> waiting for the body of the request. Are you sure the client is
> properly committing the request ? What kind of client are you using ?
>
> Regards,
>   Serge...
>
>
>
> On Mon, Jan 21, 2019 at 10:15 PM Diogo Munaro Vieira
> <diogo.mun...@corp.globo.com.invalid> wrote:
> >
> > Hi friends!
> >
> > When we send an event with wrong body it takes about 2 seconds to respond
> > timeout as error instead of right error message. Do you know about it?
> >
> >
> > <body><h2>HTTP ERROR 500</h2>
> > > <p>Problem accessing /context.json. Reason:
> > > <pre>    Server Error</pre></p><h3>Caused
> > > by:</h3><pre>java.io.IOException:
> java.util.concurrent.TimeoutException:
> > > Idle timeout expired: 30005/30000 ms
> > > at
> > >
> org.eclipse.jetty.server.HttpInput$ErrorState.noContent(HttpInput.java:852)
> > > at org.eclipse.jetty.server.HttpInput.read(HttpInput.java:191)
> > > at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
> > > at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
> > > at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
> > > at java.io.InputStreamReader.read(InputStreamReader.java:184)
> > > at java.io.BufferedReader.fill(BufferedReader.java:161)
> > > at java.io.BufferedReader.readLine(BufferedReader.java:324)
> > > at java.io.BufferedReader.readLine(BufferedReader.java:389)
> > > at org.apache.unomi.web.HttpUtils.getPayload(HttpUtils.java:154)
> > > at org.apache.unomi.web.ContextServlet.service(ContextServlet.java:112)
> > > at
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:840)
> > > at
> > >
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:584)
> > > at
> > >
> org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)
> > > at
> > >
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
> > > at
> > >
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
> > > at
> > >
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
> > > at
> > >
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
> > > at
> > >
> org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:296)
> > > at
> > >
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
> > > at
> > >
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
> > > at
> > >
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
> > > at
> > >
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> > > at
> > >
> org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)
> > > at
> > >
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
> > > at org.eclipse.jetty.server.Server.handle(Server.java:539)
> > > at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333)
> > > at
> > >
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
> > > at
> > > org.eclipse.jetty.io
> .AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283)
> > > at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108)
> > > at
> > > org.eclipse.jetty.io
> .SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
> > > at
> > >
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
> > > at
> > >
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
> > > at
> > >
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
> > > at
> > >
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
> > > at
> > >
> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
> > > at java.lang.Thread.run(Thread.java:748)
> > > Caused by: java.util.concurrent.TimeoutException: Idle timeout expired:
> > > 30005/30000 ms
> > > at org.eclipse.jetty.io
> .IdleTimeout.checkIdleTimeout(IdleTimeout.java:166)
> > > at org.eclipse.jetty.io.IdleTimeout$1.run(IdleTimeout.java:50)
> > > at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> > > at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> > > at
> > >
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
> > > at
> > >
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
> > > at
> > >
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> > > at
> > >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> > > ... 1 more
> > > Suppressed: java.lang.Throwable: HttpInput failure
> > > at org.eclipse.jetty.server.HttpInput.failed(HttpInput.java:648)
> > > at
> > >
> org.eclipse.jetty.server.HttpConnection$BlockingReadCallback.failed(HttpConnection.java:606)
> > > at org.eclipse.jetty.io.FillInterest.onFail(FillInterest.java:138)
> > > at
> > > org.eclipse.jetty.io
> .AbstractEndPoint.onIdleExpired(AbstractEndPoint.java:173)
> > > ... 9 more
> > > </pre>
> > > <h3>Caused by:</h3><pre>java.util.concurrent.TimeoutException: Idle
> > > timeout expired: 30005/30000 ms
> > > at org.eclipse.jetty.io
> .IdleTimeout.checkIdleTimeout(IdleTimeout.java:166)
> > > at org.eclipse.jetty.io.IdleTimeout$1.run(IdleTimeout.java:50)
> > > at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> > > at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> > > at
> > >
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
> > > at
> > >
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
> > > at
> > >
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> > > at
> > >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> > > at java.lang.Thread.run(Thread.java:748)
> > > Suppressed: java.lang.Throwable: HttpInput failure
> > > at org.eclipse.jetty.server.HttpInput.failed(HttpInput.java:648)
> > > at
> > >
> org.eclipse.jetty.server.HttpConnection$BlockingReadCallback.failed(HttpConnection.java:606)
> > > at org.eclipse.jetty.io.FillInterest.onFail(FillInterest.java:138)
> > > at
> > > org.eclipse.jetty.io
> .AbstractEndPoint.onIdleExpired(AbstractEndPoint.java:173)
> > > ... 9 more
> > > </pre>
> > > <hr><a href="http://eclipse.org/jetty";>Powered by Jetty://
> > > 9.3.24.v20180605</a><hr/>
> > > </body>
> > > </html>
> >
> >
> > --
> > Diogo Munaro Vieira
> >
> > -------
> > Big Data
> > Ramal: 6866
> >
> > http://diogomunaro.com
> > (21) 98656-0745
>


-- 
Diogo Munaro Vieira

-------
Big Data
Ramal: 6866

http://diogomunaro.com
(21) 98656-0745

Reply via email to