Openbravo Issue Tracking System - Retail Modules
View Issue Details
0033935Retail ModulesStoreServerpublic2016-09-09 08:532016-11-22 09:12
mtaal 
mtaal 
normalmajorhave not tried
closedfixed 
5
 
 
migueldejuana
No
0033935: Get token call from webpos uses expired token and then continuously repeats itself, filling the log
Somehow the server state background process uses an expired token. This is shown by the repeated stacktrace [1] in the central server when the server status background process is being run periodically.

[1]
cdb72c84 2016-09-09 06:00:30,058 [TP-Processor6] INFO org.openbravo.mobile.core.authenticate.MobileKeyAuthenticationManager - Authentication login failed, continueing with standard login approach
org.openbravo.authentication.AuthenticationException: Invalid token xB1RC9zjd9ILljfcODBzkQ==__;__JhKN1J+EV1pVLV51QsqwT4NV0O0LHsyByiHtVFH0aKB3mZR8EPDNwbpz+xNElPdHHI6P7KhLuXp8+IkqPsIR3GsnfYULUXHJKU3rCx78wTI6Df6eMycoWmEAbFpyjZSh/P27QzIW51LhCneIwYgQ95hqZuMc1qryJXOlWJDnNfT1GUooEJsufKCgHQmf+ySj0A8QBa1H7V8U/V2ATos49w==
        at org.openbravo.mobile.core.authenticate.MobileAuthenticationKeyUtils.decrypt(MobileAuthenticationKeyUtils.java:194)
        at org.openbravo.mobile.core.authenticate.MobileKeyAuthenticationManager.doAuthenticate(MobileKeyAuthenticationManager.java:58)
        at org.openbravo.authentication.AuthenticationManager.authenticate(AuthenticationManager.java:143)
        at org.openbravo.base.secureApp.HttpSecureAppServlet.service(HttpSecureAppServlet.java:196)
        at org.openbravo.client.kernel.BaseKernelServlet.callServiceInSuper(BaseKernelServlet.java:87)
        at org.openbravo.mobile.core.process.WebServiceAuthenticatedServlet.service(WebServiceAuthenticatedServlet.java:60)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.openbravo.replication.symmetricds.ServletDisablerDuringTableReloadFilter.doFilter(ServletDisablerDuringTableReloadFilter.java:64)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
Install multi-server
Set short token expiry interval by when logging in set breakpoint here:
      OB.UTIL.localStorage.setItem('tokenRefreshInterval', getPreference('OBMOBC_RequestRouterTokenRefreshInterval', 10 * 60000, OB.UTIL.localStorage.getItem('tokenRefreshInterval') || 30 * 60000));
and then stepover and execute this in the console:
OB.UTIL.localStorage.setItem('tokenRefreshInterval', 10000);

Login with webpos
stop store server
wait for token to expire
start store server
next get token will throw exception in log
No tags attached.
causes defect 0034474 closed mtaal [STORE SERVER 2065] 
Issue History
2016-09-09 08:53mtaalNew Issue
2016-09-09 08:53mtaalAssigned To => mtaal
2016-09-09 08:53mtaalTriggers an Emergency Pack => No
2016-10-10 09:38mtaalNote Added: 0090510
2016-10-10 09:39mtaalSummaryServer state background process uses expired token => Get token call from webpos uses expired token and then continuously repeats itself, filling the log
2016-10-10 09:39mtaalSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=13337#r13337
2016-10-10 11:09mtaalSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=13342#r13342
2016-10-18 08:31hgbotCheckin
2016-10-18 08:31hgbotNote Added: 0090654
2016-10-18 08:31hgbotStatusnew => resolved
2016-10-18 08:31hgbotResolutionopen => fixed
2016-10-18 08:31hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/fb756d8610aa5ed84f1736814fb3244f1be5a7ad [^]
2016-10-22 15:56mtaalReview Assigned To => migueldejuana
2016-11-13 23:21mtaalRelationship addedcauses 0034474
2016-11-22 09:03migueldejuanaNote Added: 0091727
2016-11-22 09:12migueldejuanaNote Added: 0091729
2016-11-22 09:12migueldejuanaStatusresolved => closed

Notes
(0090510)
mtaal   
2016-10-10 09:38   
2016-10-10 07:36:23,427 [TP-Processor8] INFO org.openbravo.mobile.core.authenticate.MobileKeyAuthenticationManager - 88.26.229.145
2016-10-10 07:36:23,427 [TP-Processor8] INFO org.openbravo.mobile.core.authenticate.MobileKeyAuthenticationManager - /openbravo/org.openbravo.mobile.core.service.jsonrest/org.openbravo.mobile.core.authenticate.GetToken/%7B%22parameters%22:%7B%22ignoreForConnectionStatus%22:%7B%22value%22:true,%22type%22:%22boolean%22%7D%7D,%22client%22:%229404134F8B374DEE92E79CD87B834E19%22,%22organization%22:%22EFDB6F7452204D69856CE64B57B06960%22,%22pos%22:%22C16BB8D7DEFC4406814E1A970DFDF092%22,%22terminalName%22:%2221404%22,%22appName%22:%22WebPOS%22%7D
2016-10-10 07:36:23,427 [TP-Processor8] INFO org.openbravo.mobile.core.authenticate.MobileKeyAuthenticationManager - http://52.31.227.242/openbravo/org.openbravo.mobile.core.service.jsonrest/org.openbravo.mobile.core.authenticate.GetToken/%7B%22parameters%22:%7B%22ignoreForConnectionStatus%22:%7B%22value%22:true,%22type%22:%22boolean%22%7D%7D,%22client%22:%229404134F8B374DEE92E79CD87B834E19%22,%22organization%22:%22EFDB6F7452204D69856CE64B57B06960%22,%22pos%22:%22C16BB8D7DEFC4406814E1A970DFDF092%22,%22terminalName%22:%2221404%22,%22appName%22:%22WebPOS%22%7D [^]
2016-10-10 07:36:23,427 [TP-Processor8] INFO org.openbravo.mobile.core.authenticate.MobileKeyAuthenticationManager - authenticationClient=9404134F8B374DEE92E79CD87B834E19&authenticationToken=pw2vP%2FSjQZlIz80ep403ww%3D%3D__%3B__%2FFFh%2Fprveiw7TPNRGouys%2BZpEY%2F43tSUwPD7%2B9ojA9BTeUEvPF6h4k9f4jV5oMA6kYSQmvahM3ONdqCOPHSZdZZpuL%2FvbIB%2FnRG8E5Pla2Gi4H1q0zIVwjFuYDH4yfrbALnXBK7%2FSR5OGdfeGsVggd5LDK3GVGx1fdpQO13iRfI539XCPHYzRKMUBDkBWNGW7qsViEF6iEuwhGbkngwZBw%3D%3D
2016-10-10 07:36:45,420 [TP-Processor7] INFO org.openbravo.mobile.core.authenticate.MobileAuthenticationKeyUtils - Token Timestamp Fri Sep 30 17:35:50 UTC 2016
2016-10-10 07:36:45,423 [TP-Processor7] INFO org.openbravo.mobile.core.authenticate.MobileAuthenticationKeyUtils - Token Date Mon Oct 10 07:36:45 UTC 2016
2016-10-10 07:36:45,423 [TP-Processor7] INFO org.openbravo.mobile.core.authenticate.MobileAuthenticationKeyUtils - 9404134F8B374DEE92E79CD87B834E19
2016-10-10 07:36:45,423 [TP-Processor7] INFO org.openbravo.mobile.core.authenticate.MobileAuthenticationKeyUtils - EFDB6F7452204D69856CE64B57B06960
2016-10-10 07:36:45,423 [TP-Processor7] INFO org.openbravo.mobile.core.authenticate.MobileAuthenticationKeyUtils - 008F4C0F7532485ABD55E399EAB230F2
2016-10-10 07:36:45,423 [TP-Processor7] INFO org.openbravo.mobile.core.authenticate.MobileAuthenticationKeyUtils - 100
2016-10-10 07:36:45,423 [TP-Processor7] ERROR org.openbravo.authentication.AuthenticationException - Invalid token pw2vP/SjQZlIz80ep403ww==__;__/FFh/prveiw7TPNRGouys+ZpEY/43tSUwPD7+9ojA9BTeUEvPF6h4k9f4jV5oMA6kYSQmvahM3ONdqCOPHSZdZZpuL/vbIB/nRG8E5Pla2Gi4H1q0zIVwjFuYDH4yfrbALnXBK7/SR5OGdfeGsVggd5LDK3GVGx1fdpQO13iRfI539XCPHYzRKMUBDkBWNGW7qsViEF6iEuwhGbkngwZBw==
org.openbravo.authentication.AuthenticationException: Invalid token pw2vP/SjQZlIz80ep403ww==__;__/FFh/prveiw7TPNRGouys+ZpEY/43tSUwPD7+9ojA9BTeUEvPF6h4k9f4jV5oMA6kYSQmvahM3ONdqCOPHSZdZZpuL/vbIB/nRG8E5Pla2Gi4H1q0zIVwjFuYDH4yfrbALnXBK7/SR5OGdfeGsVggd5LDK3GVGx1fdpQO13iRfI539XCPHYzRKMUBDkBWNGW7qsViEF6iEuwhGbkngwZBw==
        at org.openbravo.mobile.core.authenticate.MobileAuthenticationKeyUtils.decrypt(MobileAuthenticationKeyUtils.java:210)
        at org.openbravo.mobile.core.authenticate.MobileKeyAuthenticationManager.doInternalAuthenticate(MobileKeyAuthenticationManager.java:74)
        at org.openbravo.mobile.core.authenticate.MobileKeyAuthenticationManager.doAuthenticate(MobileKeyAuthenticationManager.java:60)
        at org.openbravo.authentication.AuthenticationManager.authenticate(AuthenticationManager.java:143)
        at org.openbravo.base.secureApp.HttpSecureAppServlet.service(HttpSecureAppServlet.java:196)
        at org.openbravo.client.kernel.BaseKernelServlet.callServiceInSuper(BaseKernelServlet.java:87)
(0090654)
hgbot   
2016-10-18 08:31   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: fb756d8610aa5ed84f1736814fb3244f1be5a7ad
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Oct 18 08:31:19 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/fb756d8610aa5ed84f1736814fb3244f1be5a7ad [^]

Fixes issue 33935: Get token call from webpos uses expired token and then continuously repeats itself, filling the log
Make ping service handle 401, if more than soo many pings fail then stop

---
M web/org.openbravo.mobile.core/source/data/ob-requestrouter.js
---
(0091727)
migueldejuana   
2016-11-22 09:03   
OB.MobileApp.model.lock(); lines are removed accidentally
(0091729)
migueldejuana   
2016-11-22 09:12   
Tested and reviewed