MobileFirst 7.1, iOS: Client device ID is unknown on the session. Token update request ignored
<p>We have added push notifications to our existing app using the following tutorial:
<a href="https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/7.1/notifications/push-notifications-overview/push-notifications-in-hybrid-applications/event-source-notifications-in-hybrid-applications/#serverSidenotificationAPI" rel="nofollow">https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/7.1/notifications/push-notifications-overview/push-notifications-in-hybrid-applications/event-source-notifications-in-hybrid-applications/#serverSidenotificationAPI</a></p>

<p>After adding the iOS push certificates, the app asks permission to send notifications. Approving this seems to work, I only had to approve once. But we are getting to following error in the MobileFirst server log (localhost):</p>

<pre><code>[ERROR   ] FWLSE0032W: Client device ID is unknown on the session. Token update request ignored. [project MAP]
The transaction has been rolled back.  See the nested exceptions for details on the errors that occurred.
[ERROR   ] FWLSE0020E: Ajax request exception: null [project MAP]
[ERROR   ] FWLSE0117E: Error code: 1, error description: INTERNAL_ERROR, error message: FWLSE0069E: An internal error occurred during gadget request  [project MAP]null, User Identity {wl_directUpdateRealm=(name:null, loginModule:WLDirectUpdateNullLoginModule), SubscribeServlet=null, wl_authenticityRealm=(name:evaluation, loginModule:wl_authenticityLoginModule), wl_remoteDisableRealm=(name:null, loginModule:WLRemoteDisableNullLoginModule), SampleAppRealm=null, MAPLoginRealm=(name:D5B818E0-B214-4304-897C-ECE05F14AF29, loginModule:MAPLoginModule), wl_antiXSRFRealm=(name:kg5pmlqtshvio5mtmj19fmbjk, loginModule:WLAntiXSRFLoginModule), wl_deviceAutoProvisioningRealm=null, wl_deviceNoProvisioningRealm=null, myserver=(name:D5B818E0-B214-4304-897C-ECE05F14AF29, loginModule:MAPLoginModule), wl_anonymousUserRealm=null}. [project MAP] 
    com.worklight.common.log.filters.ErrorFilter
</code></pre>

<p>In xCode I get the following error in the device logs:</p>

<pre><code>-[WLAFHTTPRequestOperationManagerWrapper requestFailed:error:] in WLAFHTTPRequestOperationManagerWrapper.m:354 :: Response Error : Request failed: internal server error (500)
2016-10-26 15:10:54.885202 map[1285:748710] [TRACE] [WLNativeXHR] callback {"statusText":"Request failed: internal server error (500)","status":500,"headers":{"Connection":"close","Content-Type":"application/json; charset=UTF-8","X-Powered-By":"Servlet/3.0","Content-Language":"en-US","Vary":"Accept-Encoding","P3P":"policyref=\"/w3c/p3p.xml\", CP=\"CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE\"","Date":"Wed, 26 Oct 2016 13:10:53 GMT","Content-Encoding":"gzip","Transfer-Encoding":"Identity"},"responseText":"{\"errorCode\":\"UNEXPECTED_ERROR\",\"errorMsg\":null}","wlFailureStatus":"","callbackId":"WLNativeXHRPlugin542847063"}
2016-10-26 15:10:54.887145 map[1285:748717] [ERROR] [NONE] [/apps/services/api/map/iphone/notifications] failure. state: 500, response: null
</code></pre>

<p>I tried installing it on our test environment (WAS) to make sure it has nothing to do with the local machine, which gave the following exception:</p>

<pre><code>[10/26/16 15:10:52:986 CEST] 000000d6 DataAccessSer E com.worklight.integration.services.impl.DataAccessServiceImpl updateDeviceToken FWLSE0032W: Client device ID is unknown on the session. Token update request ignored. [project mapruntime]
        &lt;openjpa-1.2.2-r422266:898935 fatal store error&gt; org.apache.openjpa.persistence.RollbackException: The transaction has been rolled back.  See the nested exceptions for details on the errors that occurred.
    at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:523)
    at com.ibm.pushworks.server.core.PushServiceDBStore.create(PushServiceDBStore.java:56)
    at com.ibm.pushworks.server.core.PushServiceImpl.registerDevice(PushServiceImpl.java:642)
    at com.worklight.integration.services.impl.DataAccessServiceImpl.updateDeviceToken(DataAccessServiceImpl.java:431)
    at com.worklight.gadgets.serving.handler.NotificationSubscriptionHandler.doPost(NotificationSubscriptionHandler.java:136)
    at com.worklight.gadgets.serving.GadgetAPIServlet.doGetOrPost(GadgetAPIServlet.java:150)
    at com.worklight.gadgets.serving.GadgetAPIServlet.doPost(GadgetAPIServlet.java:110)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1232)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:781)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:480)
    at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:97)
    at com.worklight.core.auth.impl.AuthenticationFilter$1.execute(AuthenticationFilter.java:223)
    at com.worklight.core.auth.impl.AuthenticationServiceBean.accessResource(AuthenticationServiceBean.java:82)
    at com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:228)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
    at com.worklight.analytics.AnalyticsFilter.doFilter(AnalyticsFilter.java:124)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:967)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1107)
    at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:940)
    at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:463)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316)
    at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:88)
    at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1818)
    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
    at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
    at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
    at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
    at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
    at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
    at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1881)
Caused by: &lt;openjpa-1.2.2-r422266:898935 fatal general error&gt; org.apache.openjpa.persistence.PersistenceException: The transaction has been rolled back.  See the nested exceptions for details on the errors that occurred.
    at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2187)
    at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2029)
    at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1927)
    at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1845)
    at org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81)
    at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1369)
    at org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:877)
    at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:512)
    ... 41 more
Caused by: &lt;openjpa-1.2.2-r422266:898935 nonfatal general error&gt; org.apache.openjpa.persistence.PersistenceException: The value of a host variable in the EXECUTE or OPEN statement is out of range for its corresponding use.. SQLCODE=-302, SQLSTATE=22001, DRIVER=4.19.49
FailedObject: prepstmnt 1862045639 INSERT INTO "MAP".PUSH_DEVICES (ID, CREATED_MODE, CREATED_TIME, LAST_UPDATED_TIME, APPLICATION_ID, DEVICE_ID, ENVIRONMENT_ID, PUSH_KEY, LATITUDE, LOCALE, LONGITUDE, PLATFORM, STATUS, TOKEN, USER_AGENT, USER_ID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement]
    at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4246)
    at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4211)
    at org.apache.openjpa.jdbc.sql.DB2Dictionary.newStoreException(DB2Dictionary.java:504)
    at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
    at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:72)
    at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushBatch(BatchingPreparedStatementManagerImpl.java:195)
    at org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:63)
    at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:89)
    at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
    at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:721)
    at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
    ... 48 more
Caused by: com.ibm.db2.jcc.am.SqlDataException: The value of a host variable in the EXECUTE or OPEN statement is out of range for its corresponding use.. SQLCODE=-302, SQLSTATE=22001, DRIVER=4.19.49
    at com.ibm.db2.jcc.am.kd.a(Unknown Source)
    at com.ibm.db2.jcc.am.kd.a(Unknown Source)
    at com.ibm.db2.jcc.am.kd.a(Unknown Source)
    at com.ibm.db2.jcc.am.fp.b(Unknown Source)
    at com.ibm.db2.jcc.am.fp.c(Unknown Source)
    at com.ibm.db2.jcc.t4.bb.l(Unknown Source)
    at com.ibm.db2.jcc.t4.bb.a(Unknown Source)
    at com.ibm.db2.jcc.t4.p.a(Unknown Source)
    at com.ibm.db2.jcc.t4.wb.b(Unknown Source)
    at com.ibm.db2.jcc.am.gp.tc(Unknown Source)
    at com.ibm.db2.jcc.am.gp.b(Unknown Source)
    at com.ibm.db2.jcc.am.gp.b(Unknown Source)
    at com.ibm.db2.jcc.am.gp.lc(Unknown Source)
    at com.ibm.db2.jcc.am.gp.executeUpdate(Unknown Source)
    at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.pmiExecuteUpdate(WSJdbcPreparedStatement.java:1187)
    at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.executeUpdate(WSJdbcPreparedStatement.java:804)
    at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:269)
    at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:864)
    at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:269)
    at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1590)
    at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.executeUpdate(PreparedStatementManagerImpl.java:151)
    at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushSingleRow(BatchingPreparedStatementManagerImpl.java:217)
    at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushBatch(BatchingPreparedStatementManagerImpl.java:156)
    ... 53 more
</code></pre>

<p>The code in my application-descriptor.xml:</p>

<pre><code>&lt;iphone bundleId="com.myBundle" version="1.0.10" securityTest="MAPCertLogin" applicationId="map"&gt;
    &lt;worklightSettings include="false"/&gt;
    &lt;pushSender password="******" /&gt;
    &lt;security&gt;
        &lt;encryptWebResources enabled="false"/&gt;
        &lt;testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3"/&gt;
    &lt;/security&gt;
&lt;/iphone&gt;
</code></pre>

<p>I am not sure what to do next to solve this issue, please let me know which other specific information you need to assist me with this issue.</p>