Skip to content
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

getPCalendarSchedule failed with 500 status code. #41

Closed
tochi-y opened this issue Oct 28, 2019 · 4 comments · Fixed by #46
Closed

getPCalendarSchedule failed with 500 status code. #41

tochi-y opened this issue Oct 28, 2019 · 4 comments · Fixed by #46
Assignees
Labels
bug Something isn't working

Comments

@tochi-y
Copy link
Member

tochi-y commented Oct 28, 2019

Summary

getPCalendarSchedule.js failed with 500 status code.

personium-core: v1.7.20-SNAPSHOT
personium-engine: v1.5.25

Request

POST https://app-timefiller.appdev.personium.io/__/html/Engine/getPCalendarSchedule
Authorization: Bearer AR~xJZJ******DXNw

Response

Status Code: 500
Body:

An error occurred. Cause: [org.apache.http.client.ClientProtocolException: null]

Detailed log

Error: engine.log in v1.5.25

2019-10-28 16:23:18.982 [catalina-exec-55] [DEBUG] JSGIRequest          -jsgi-request-object-dump-start-
2019-10-28 16:23:18.982 [catalina-exec-55] [DEBUG] JSGIRequest          [method]-[POST]
2019-10-28 16:23:18.982 [catalina-exec-55] [DEBUG] JSGIRequest          [pathInfo]-[/app-timefiller/__/service/getPCalendarSchedule]
2019-10-28 16:23:18.982 [catalina-exec-55] [DEBUG] JSGIRequest          [queryString]-[]
2019-10-28 16:23:18.982 [catalina-exec-55] [DEBUG] JSGIRequest          [host]-[appdev.personium.io]
2019-10-28 16:23:18.982 [catalina-exec-55] [DEBUG] JSGIRequest          [port]-[443]
2019-10-28 16:23:18.982 [catalina-exec-55] [DEBUG] JSGIRequest          [scheme]-[https]
2019-10-28 16:23:18.982 [catalina-exec-55] [DEBUG] JSGIRequest          [object Object]
2019-10-28 16:23:18.982 [catalina-exec-55] [DEBUG] JSGIRequest          [object Object]
2019-10-28 16:23:18.982 [catalina-exec-55] [DEBUG] JSGIRequest          [object Object]
2019-10-28 16:23:18.982 [catalina-exec-55] [DEBUG] JSGIRequest          -jsgi-request-object-dump-finish-
2019-10-28 16:23:19.394 [catalina-exec-55] [DEBUG] Ext_HttpClient       Content-Type: application/x-www-form-urlencoded
2019-10-28 16:23:19.395 [catalina-exec-55] [DEBUG] Ext_HttpClient       Accept: application/json
2019-10-28 16:23:19.504 [catalina-exec-55] [DEBUG] Ext_HttpClient       status:401
2019-10-28 16:23:19.505 [catalina-exec-55] [DEBUG] Ext_HttpClient       Accept: application/json
2019-10-28 16:23:19.505 [catalina-exec-55] [DEBUG] Ext_HttpClient       Authorization: Bearer undefined
2019-10-28 16:23:19.593 [catalina-exec-55] [DEBUG] Ext_HttpClient       status:401
2019-10-28 16:23:19.613 [catalina-exec-55] [DEBUG] Ext_HttpClient       Accept: application/json
2019-10-28 16:23:19.613 [catalina-exec-55] [DEBUG] Ext_HttpClient       Authorization: Bearer undefined
2019-10-28 16:23:19.620 [catalina-exec-55] [WARN ] Ext_HttpClient       An error occurred.
org.apache.http.client.ClientProtocolException: null
        at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:187)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
        at io.personium.engine.extension.httpclient.Ext_HttpClient.get(Ext_HttpClient.java:155)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138)
        at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:454)
        at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1670)
        at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1010)
        at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
        at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:409)
        at io.personium.engine.PersoniumJsContextFactory.doTopCall(PersoniumJsContextFactory.java:59)
        at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3566)
        at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:107)
        at io.personium.engine.PersoniumEngineContext.evalUserScript(PersoniumEngineContext.java:372)
        at io.personium.engine.PersoniumEngineContext.runJsgi(PersoniumEngineContext.java:296)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
        at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
        at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
        at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
        at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:708)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388)
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.http.ProtocolException: Target host is not specified
        at org.apache.http.impl.conn.DefaultRoutePlanner.determineRoute(DefaultRoutePlanner.java:71)
        at org.apache.http.impl.client.InternalHttpClient.determineRoute(InternalHttpClient.java:125)
        at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
        ... 61 common frames omitted
2019-10-28 16:23:19.630 [catalina-exec-55] [INFO ] PersoniumEngineContext [1.5.25] <<< Request Ended

Normal: engine.log in v1.5.23

2019-10-28 15:36:59.790 [catalina-exec-15] [DEBUG] JSGIRequest          -jsgi-request-object-dump-start-
2019-10-28 15:36:59.790 [catalina-exec-15] [DEBUG] JSGIRequest          [method]-[POST]
2019-10-28 15:36:59.790 [catalina-exec-15] [DEBUG] JSGIRequest          [scriptName]-[https://app-timefiller.demo-jp.personium.io/__/html/Engine/getPCalendarSchedule]
2019-10-28 15:36:59.790 [catalina-exec-15] [DEBUG] JSGIRequest          [pathInfo]-[/app-timefiller/__/service/getPCalendarSchedule]
2019-10-28 15:36:59.790 [catalina-exec-15] [DEBUG] JSGIRequest          [queryString]-[]
2019-10-28 15:36:59.790 [catalina-exec-15] [DEBUG] JSGIRequest          [host]-[demo-jp.personium.io]
2019-10-28 15:36:59.790 [catalina-exec-15] [DEBUG] JSGIRequest          [port]-[443]
2019-10-28 15:36:59.790 [catalina-exec-15] [DEBUG] JSGIRequest          [scheme]-[https]
2019-10-28 15:36:59.790 [catalina-exec-15] [DEBUG] JSGIRequest          [object Object]
2019-10-28 15:36:59.790 [catalina-exec-15] [DEBUG] JSGIRequest          [object Object]
2019-10-28 15:36:59.790 [catalina-exec-15] [DEBUG] JSGIRequest          [object Object]
2019-10-28 15:36:59.790 [catalina-exec-15] [DEBUG] JSGIRequest          -jsgi-request-object-dump-finish-
2019-10-28 15:36:59.913 [catalina-exec-15] [DEBUG] Ext_HttpClient       Content-Type: application/x-www-form-urlencoded
2019-10-28 15:36:59.913 [catalina-exec-15] [DEBUG] Ext_HttpClient       Accept: application/json
2019-10-28 15:36:59.935 [catalina-exec-15] [DEBUG] Ext_HttpClient       status:200
2019-10-28 15:36:59.935 [catalina-exec-15] [DEBUG] Ext_HttpClient       Accept: application/json
2019-10-28 15:36:59.935 [catalina-exec-15] [DEBUG] Ext_HttpClient       Authorization: Bearer AA~YncMPGeb__dSn********FJBQds
2019-10-28 15:36:59.960 [catalina-exec-15] [DEBUG] Ext_HttpClient       status:200
2019-10-28 15:36:59.964 [catalina-exec-15] [DEBUG] Ext_HttpClient       Accept: application/json
2019-10-28 15:36:59.964 [catalina-exec-15] [DEBUG] Ext_HttpClient       Authorization: Bearer AA~YncMPGeb__dSn********FJBQds
2019-10-28 15:37:00.030 [catalina-exec-15] [DEBUG] Ext_HttpClient       status:200
2019-10-28 15:37:00.030 [catalina-exec-15] [DEBUG] Ext_HttpClient       Accept: application/json
2019-10-28 15:37:00.077 [catalina-exec-15] [DEBUG] Ext_HttpClient       status:200
2019-10-28 15:37:00.078 [catalina-exec-15] [INFO ] PersoniumEngineContext [1.5.23] <<< Request Ended
@tochi-y tochi-y added the bug Something isn't working label Oct 28, 2019
@tochi-y
Copy link
Member Author

tochi-y commented Oct 28, 2019

var body = "grant_type=refresh_token&refresh_token=" + params.refToken + "&client_id=" + accInfo.COOP_APP_CELL_URL + "&client_secret=" + aaat;
var httpClient = new _p.extension.HttpClient();
var pcalRes = httpClient.post(url, headers, contentType, body);

This http call responsed as following.

status: 401
body:

{
  error: "invalid_client"
  error_description: "[PR401-AN-0020] - Client mismatch for refresh token. [https://app-personium-calendar.appdev.personium.io/]"
}

@tochi-y
Copy link
Member Author

tochi-y commented Oct 28, 2019

This error response happned in the next line.

var pcalDataRes = httpClient.get(url, headers);

The host url became "undefinedOData/vevent" and it was invalid.

@tochi-y
Copy link
Member Author

tochi-y commented Oct 29, 2019

This issue occurs by specification changes of core v1.7.18. grant_type=refresh_token with cross-domain became prohibited. To run this app with v1.7.18 update is necessary.

@dixonsiu
Copy link
Member

Related to #44

@dixonsiu dixonsiu self-assigned this Oct 31, 2019
dixonsiu pushed a commit to dixonsiu/app-timefiller that referenced this issue Nov 18, 2019
Cross cells refresh_token grand type is no longer allowed. Therefore, app-timefiller has to get the token properly.
()

Fix personium#41.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants