Skip to content

gms checkin expires #23

Closed
Closed

Description

@dajoe

Im on a fake-signature patched CM 12.1 klte (791c7f0e42). So far, gcm works very well, testing it with textsecure, that uses gcm for a wakeup event. After a few days, the device no longer notifyed and received messages only after manual wakeup. After dialing *#*#CHECKIN#*#*, everything went back to normal.

Found this in the logcat:

07-27 06:21:30.274 D/GmsAuthManager(1088): token present, but expired

Enable device checkin in the ug settings app is checked.

Activity

  1. bonanza123 commented on Jul 27, 2015

    @bonanza123

    I noticed something similar: To get the first connection working I have to dial ##CHECKIN*#*# and then use the Threema-internal Push-fixer to keep it alive (Log unfortunately not available as phone not at hand). What would be nice is to have some log regarding the connection status in the microg settings app.

  2. mar-v-in commented on Jul 27, 2015

    @mar-v-in
    Member

    GmsAuthManager(1088): token present, but expired

    This message is not directly related to cloud messaging or checkin. Can you provide more logs when the problem occurs next time? Especially check for log messages where the tag contains "Mcs". Thanks.

    What would be nice is to have some log regarding the connection status in the microg settings app.

    agree, will work on this.

  3. dajoe commented on Jul 29, 2015

    @dajoe
    Author

    It is difficult to reproduce, I reinstalled the microg gmscore apk and the behavior has changed.

    Still, I lose connection to mtalk.google.com. A reboot will issue a reconnect, after a while, an error occurs and the connection is lost again. Today the device managed to reconnect once. The error occured again since then, no more gcm.

    build.board: MSM8974 build.bootloader: G900FXXU1ANG2
    build.brand: samsung
    build.cpu_abi: armeabi-v7a
    build.cpu_abi2: armeabi
    build.device: kltexx
    build.display: cm_klte-userdebug 5.1.1 LMY48B 791c7f0e42 test-keys
    build.fingerprint: samsung/kltexx/klte:4.4.2/KOT49H/G900FXXU1ANG2:user/release-keys
    build.hardware: qcom
    build.host: lore
    build.id: LMY48B
    build.manufacturer: samsung
    build.model: SM-G900F
    build.product: cm_klte
    build.radio: unknown
    build.serial: d1a7b7d0
    build.tags: test-keys
    build.time: 1433546761000
    build.type: userdebug
    build.user: johannes
    version.codename: REL
    version.incremental: 791c7f0e42
    version.release: 5.1.1
    version.sdk_int: 22
    
    07-29 06:55:23.400 D/GmsGcmMcsSvc(1110): Starting MCS connection...
    07-29 06:55:23.608 D/GmsGcmMcsSvc(1110): Connected to mtalk.google.com:5228
    07-29 06:55:23.616 D/GmsGcmMcsSvc(1110): Activated SSL with mtalk.google.com:5228
    07-29 06:55:24.011 D/GmsGcmMcsSvc(1110): Sending login request...
    07-29 06:55:24.012 D/GmsGcmMcsOutput(1110): Write MCS version code: 41
    07-29 06:55:24.027 D/GmsGcmMcsOutput(1110): Write to MCS: LoginRequest{id=android-22, domain=mcs.android.com, user=4040461150508979731, resource=4040461150508979731, auth_token=8049565713385164235, device_id=android-38129a0254da9613, setting=[Setting{name=new_vc, value=1}], received_persistent_id=[0:1438098844346796%c5da679ff9fd7ecd, 0:1438091028379812%e3016397f9fd7ecd], adaptive_heartbeat=false, use_rmq2=true, auth_service=ANDROID_ID, network_type=1}
    07-29 06:55:24.180 D/GmsGcmMcsInput(1110): Reading from MCS version=41
    07-29 06:55:24.331 D/GmsGcmMcsInput(1110): Reading from MCS tag=3 size=78
    07-29 06:55:24.340 D/GmsGcmMcsInput(1110): Read from MCS: LoginResponse{id=android-22, [email protected]/4040461150508979731, setting=[], last_stream_id_received=1, server_timestamp=1438145724223}
    07-29 06:55:24.341 D/GmsGcmMcsSvc(1110): Logged in
    07-29 06:55:24.344 D/GmsGcmMcsInput(1110): Reading from MCS tag=7 size=103
    07-29 06:55:24.349 D/GmsGcmMcsSvc(1110): Waiting for 59993ms
    07-29 06:55:24.356 D/GmsGcmMcsInput(1110): Read from MCS: IqStanza{type=SET, id=D79BF223, from=mcs.android.com, [email protected]/4040461150508979731, extension=Extension{id=12, data=ByteString[size=0]}, account_id=-1}
    07-29 06:56:24.349 D/GmsGcmMcsOutput(1110): Write to MCS: HeartbeatPing{last_stream_id_received=2}
    07-29 06:56:24.354 D/GmsGcmMcsSvc(1110): Waiting for 60000ms
    07-29 06:56:24.473 D/GmsGcmMcsInput(1110): Reading from MCS tag=1 size=2
    07-29 06:56:24.476 D/GmsGcmMcsInput(1110): Read from MCS: HeartbeatAck{last_stream_id_received=2}
    07-29 07:25:25.397 D/GmsGcmMcsOutput(1110): Write to MCS: HeartbeatPing{last_stream_id_received=3}
    07-29 07:25:25.407 D/GmsGcmMcsSvc(1110): Waiting for 60000ms
    07-29 07:25:25.522 D/GmsGcmMcsInput(1110): Reading from MCS tag=1 size=2
    07-29 07:25:25.523 D/GmsGcmMcsInput(1110): Read from MCS: HeartbeatAck{last_stream_id_received=3}
    07-29 07:31:55.863 D/GmsGcmMcsOutput(1110): Write to MCS: HeartbeatPing{last_stream_id_received=4}
    07-29 07:31:55.865 D/GmsGcmMcsSvc(1110): Waiting for 60000ms
    07-29 07:31:55.990 D/GmsGcmMcsInput(1110): Reading from MCS tag=1 size=2
    07-29 07:31:55.991 D/GmsGcmMcsInput(1110): Read from MCS: HeartbeatAck{last_stream_id_received=4}
    07-29 07:41:35.294 W/GmsGcmMcsSvc(1110): javax.net.ssl.SSLException: Read error: ssl=0xae837800: I/O error during system call, Connection timed out
    07-29 07:41:35.294 W/GmsGcmMcsSvc(1110):    at com.android.org.conscrypt.NativeCrypto.SSL_read(Native Method)
    07-29 07:41:35.294 W/GmsGcmMcsSvc(1110):    at com.android.org.conscrypt.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:699)
    07-29 07:41:35.294 W/GmsGcmMcsSvc(1110):    at com.android.org.conscrypt.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:672)
    07-29 07:41:35.294 W/GmsGcmMcsSvc(1110):    at org.microg.gms.gcm.McsInputStream.read(McsInputStream.java:89)
    07-29 07:41:35.294 W/GmsGcmMcsSvc(1110):    at org.microg.gms.gcm.McsService.connect(McsService.java:148)
    07-29 07:41:35.294 W/GmsGcmMcsSvc(1110):    at org.microg.gms.gcm.McsService.access$000(McsService.java:48)
    07-29 07:41:35.294 W/GmsGcmMcsSvc(1110):    at org.microg.gms.gcm.McsService$1.run(McsService.java:87)
    07-29 07:41:35.294 W/GmsGcmMcsSvc(1110):    at java.lang.Thread.run(Thread.java:818)
    07-29 07:41:35.294 D/GmsGcmMcsSvc(1110): Connection closed
    07-29 07:41:35.295 W/GmsGcmMcsSvc(1110): java.lang.InterruptedException
    07-29 07:41:35.295 W/GmsGcmMcsSvc(1110):    at java.lang.Object.wait(Native Method)
    07-29 07:41:35.295 W/GmsGcmMcsSvc(1110):    at java.lang.Object.wait(Object.java:422)
    07-29 07:41:35.295 W/GmsGcmMcsSvc(1110):    at org.microg.gms.gcm.McsService.heartbeatLoop(McsService.java:109)
    07-29 07:41:35.295 W/GmsGcmMcsSvc(1110):    at org.microg.gms.gcm.McsService.access$100(McsService.java:48)
    07-29 07:41:35.295 W/GmsGcmMcsSvc(1110):    at org.microg.gms.gcm.McsService$2.run(McsService.java:191)
    07-29 07:41:35.295 W/GmsGcmMcsSvc(1110):    at java.lang.Thread.run(Thread.java:818)
    07-29 07:41:37.423 D/GmsGcmMcsSvc(1110): Starting MCS connection...
    07-29 07:41:37.519 D/GmsGcmMcsSvc(1110): Connected to mtalk.google.com:5228
    07-29 07:41:37.519 D/GmsGcmMcsSvc(1110): Activated SSL with mtalk.google.com:5228
    07-29 07:41:37.656 D/GmsGcmMcsSvc(1110): Sending login request...
    07-29 07:41:37.656 D/GmsGcmMcsOutput(1110): Write MCS version code: 41
    07-29 07:41:37.657 D/GmsGcmMcsOutput(1110): Write to MCS: LoginRequest{id=android-22, domain=mcs.android.com, user=4040461150508979731, resource=4040461150508979731, auth_token=8049565713385164235, device_id=android-38129a0254da9613, setting=[Setting{name=new_vc, value=1}], received_persistent_id=[], adaptive_heartbeat=false, use_rmq2=true, auth_service=ANDROID_ID, network_type=1}
    07-29 07:41:37.702 D/GmsGcmMcsInput(1110): Reading from MCS version=41
    07-29 07:41:37.762 D/GmsGcmMcsInput(1110): Reading from MCS tag=3 size=78
    07-29 07:41:37.765 D/GmsGcmMcsInput(1110): Read from MCS: LoginResponse{id=android-22, [email protected]/4040461150508979731, setting=[], last_stream_id_received=1, server_timestamp=1438148497231}
    07-29 07:41:37.765 D/GmsGcmMcsSvc(1110): Logged in
    07-29 07:41:37.765 D/GmsGcmMcsInput(1110): Reading from MCS tag=7 size=103
    07-29 07:41:37.768 D/GmsGcmMcsSvc(1110): Waiting for 59997ms
    07-29 07:41:37.771 D/GmsGcmMcsInput(1110): Read from MCS: IqStanza{type=SET, id=D76DA4CE, from=mcs.android.com, [email protected]/4040461150508979731, extension=Extension{id=12, data=ByteString[size=0]}, account_id=-1}
    07-29 08:23:34.387 D/GmsGcmMcsOutput(1110): Write to MCS: HeartbeatPing{last_stream_id_received=2}
    07-29 08:23:34.393 D/GmsGcmMcsSvc(1110): Waiting for 60000ms
    07-29 08:24:34.393 D/GmsGcmMcsOutput(1110): Write to MCS: HeartbeatPing{}
    07-29 08:24:34.394 D/GmsGcmMcsSvc(1110): Waiting for 60000ms
    07-29 08:37:37.571 D/GmsGcmMcsOutput(1110): Write to MCS: HeartbeatPing{}
    07-29 08:37:37.571 D/GmsGcmMcsSvc(1110): Waiting for 60000ms
    07-29 08:52:29.597 D/GmsGcmMcsOutput(1110): Write to MCS: HeartbeatPing{}
    07-29 08:52:29.597 D/GmsGcmMcsSvc(1110): Waiting for 60000ms
    07-29 08:53:29.598 D/GmsGcmMcsOutput(1110): Write to MCS: HeartbeatPing{}
    07-29 08:53:29.598 D/GmsGcmMcsSvc(1110): Waiting for 60000ms
    07-29 08:54:29.598 D/GmsGcmMcsOutput(1110): Write to MCS: HeartbeatPing{}
    07-29 08:54:29.598 D/GmsGcmMcsSvc(1110): Waiting for 60000ms
    07-29 08:55:29.599 D/GmsGcmMcsOutput(1110): Write to MCS: HeartbeatPing{}
    07-29 08:55:29.599 D/GmsGcmMcsSvc(1110): Waiting for 60000ms
    07-29 08:56:29.599 D/GmsGcmMcsOutput(1110): Write to MCS: HeartbeatPing{}
    07-29 08:56:29.599 D/GmsGcmMcsSvc(1110): Waiting for 60000ms
    07-29 09:00:12.281 D/GmsGcmMcsOutput(1110): Write to MCS: HeartbeatPing{}
    07-29 09:00:12.283 D/GmsGcmMcsSvc(1110): Waiting for 60000ms
    07-29 09:21:03.573 D/GmsGcmMcsOutput(1110): Write to MCS: HeartbeatPing{}
    07-29 09:21:03.574 D/GmsGcmMcsSvc(1110): Waiting for 60000ms
    07-29 09:36:27.836 D/GmsGcmMcsOutput(1110): Write to MCS: HeartbeatPing{}
    07-29 09:36:27.837 W/GmsGcmMcsSvc(1110): javax.net.ssl.SSLException: Write error: ssl=0xae837800: I/O error during system call, Broken pipe
    07-29 09:36:27.837 W/GmsGcmMcsSvc(1110):    at com.android.org.conscrypt.NativeCrypto.SSL_write(Native Method)
    07-29 09:36:27.837 W/GmsGcmMcsSvc(1110):    at com.android.org.conscrypt.OpenSSLSocketImpl$SSLOutputStream.write(OpenSSLSocketImpl.java:765)
    07-29 09:36:27.837 W/GmsGcmMcsSvc(1110):    at java.io.OutputStream.write(OutputStream.java:82)
    07-29 09:36:27.837 W/GmsGcmMcsSvc(1110):    at com.android.org.conscrypt.OpenSSLSocketImpl$SSLOutputStream.write(OpenSSLSocketImpl.java:740)
    07-29 09:36:27.837 W/GmsGcmMcsSvc(1110):    at org.microg.gms.gcm.McsOutputStream.write(McsOutputStream.java:77)
    07-29 09:36:27.837 W/GmsGcmMcsSvc(1110):    at org.microg.gms.gcm.McsOutputStream.write(McsOutputStream.java:67)
    07-29 09:36:27.837 W/GmsGcmMcsSvc(1110):    at org.microg.gms.gcm.McsService.heartbeatLoop(McsService.java:116)
    07-29 09:36:27.837 W/GmsGcmMcsSvc(1110):    at org.microg.gms.gcm.McsService.access$100(McsService.java:48)
    07-29 09:36:27.837 W/GmsGcmMcsSvc(1110):    at org.microg.gms.gcm.McsService$2.run(McsService.java:191)
    07-29 09:36:27.837 W/GmsGcmMcsSvc(1110):    at java.lang.Thread.run(Thread.java:818)
    07-29 09:36:27.837 D/GmsGcmMcsSvc(1110): Heartbeating stopped
    

    On another cm12.1 device (s3 mini I8190 using the xposed module) gcm has been working for days now without issues.

  4. mar-v-in commented on Jul 29, 2015

    @mar-v-in
    Member

    For some reason the heartbeat is not sent every minute on your device, resulting in connection hangup. Not sure what could cause this, are you using any energy saving utilities or alike?

  5. dajoe commented on Jul 29, 2015

    @dajoe
    Author

    I might have messed with some apps that change the heartbeat Intervall. I'll set it to 60 seconds and see what happens.

  6. dajoe commented on Aug 3, 2015

    @dajoe
    Author

    It sees that when on standby, there are longer intervals between the heartbeats. There are various fixer apps that all don't seem to change anything

    After a while, the

    javax.net.ssl.SSLException: Write error: ssl=0xae837800: I/O error during system call, Broken pipe

    occurs and heartbeating stopps.

    A reboot fixes that for a while. Switching to flight mode and back doesn't

  7. Tentos commented on Aug 3, 2015

    @Tentos

    First of all: a big thank you to the developers of microg. The push service works as it should, I am able to use Threema with GCM enabled.
    Unfortunately, the heartbeat behaviour is even more unexpected on my smartphone than in dajoe's case: GMS core stops sending heartbeats when my smartphone is in standby as NetworkLog has shown. The push fixer feature in Threema does not influence this.
    Another observation (not that serious at the moment): If the GMS Core service is closed because of lack of system resources, it is restarted, but the service does not reconnect to CGM automatically. This behaviour can be reproduced (somehow) when the GMS Core process is reset manually e.g. by OS Monitor.

    I am on Android 4.2.2 (close to stock), but I am not aware of any energy saving apps or something similar. If necessary, I can try to provide a logcat.

  8. bonanza123 commented on Aug 3, 2015

    @bonanza123

    I'm definitely not an android expert...but I guess the app does not acquire a PARTIAL_WAKE_LOCK which prevents android from suspending the service which is supposed to reconnect. Is this possible?

    cf. https://stackoverflow.com/questions/8713361/keep-a-service-running-even-when-phone-is-asleep

  9. added a commit that references this issue on Aug 4, 2015
  10. dajoe commented on Aug 5, 2015

    @dajoe
    Author

    Since 331813c, heartbeat occurs regularly (every 1 minute) and gcm is working fine for 10 hours now without issues. This is big.

  11. dajoe commented on Aug 7, 2015

    @dajoe
    Author

    Heartbeat still breaks sporadically

    08-07 09:01:58.393 D/GmsGcmMcsSvc(1129): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
    08-07 09:01:58.393 D/GmsGcmMcsSvc(1129): Outgoing message: HeartbeatPing{}
    08-07 09:01:58.397 D/GmsGcmMcsSvc(1129): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
    08-07 09:01:58.397 D/GmsGcmMcsSvc(1129): Outgoing message: HeartbeatPing{}
    08-07 09:01:58.398 D/GmsGcmMcsSvc(1129): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
    08-07 09:01:58.398 D/GmsGcmMcsSvc(1129): Outgoing message: HeartbeatPing{}
    08-07 09:01:58.401 D/GmsGcmMcsSvc(1129): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
    08-07 09:01:58.401 D/GmsGcmMcsSvc(1129): Outgoing message: HeartbeatPing{}
    08-07 09:01:58.402 D/GmsGcmMcsSvc(1129): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
    08-07 09:01:58.402 D/GmsGcmMcsSvc(1129): Outgoing message: HeartbeatPing{}
    08-07 09:01:59.887 F/PowerManager(1129): WakeLock finalized while still held: mcs
    08-07 09:03:12.856 D/GmsGcmMcsSvc(1129): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
    08-07 09:03:12.857 D/GmsGcmMcsSvc(1129): Outgoing message: HeartbeatPing{}
    08-07 09:03:15.335 F/PowerManager(1129): WakeLock finalized while still held: mcs
    08-07 09:09:12.887 D/GmsGcmMcsSvc(1129): Heartbeat initiated, reason: Intent { act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
    08-07 09:09:12.887 D/GmsGcmMcsSvc(1129): Outgoing message: HeartbeatPing{}
    08-07 09:09:12.887 D/GmsGcmMcsSvc(1129): I/O error: javax.net.ssl.SSLException: Write error: ssl=0xaec37800: I/O error during system call, Connection timed out
    08-07 09:09:12.887 D/GmsGcmMcsSvc(1129): Teardown initiated, reason: javax.net.ssl.SSLException: Write error: ssl=0xaec37800: I/O error during system call, Connection timed out
    08-07 09:09:12.899 D/GmsGcmMcsSvc(1129): I/O error: java.net.SocketException: socket is closed
    08-07 09:09:12.899 D/GmsGcmMcsSvc(1129): Teardown initiated, reason: java.net.SocketException: socket is closed
    08-07 09:09:16.731 F/PowerManager(1129): WakeLock finalized while still held: mcs

  12. dajoe commented on Aug 19, 2015

    @dajoe
    Author

    Since 1a83f82 and a reboot, everything seems to be fine. Will report back, if anything happens. If not, we might be ready to close this one.

  13. dajoe commented on Aug 20, 2015

    @dajoe
    Author

    Now it happened again:

    08-20 12:03:11.159 D/GmsGcmMcsSvc(1121): Heartbeat initiated, reason: Intent {act=org.microg.gms.gcm.mcs.HEARTBEAT flg=0x4 cmp=com.google.android.gms/org.microg.gms.gcm.McsService (has extras) }
    08-20 12:03:11.159 D/GmsGcmMcsSvc(1121): Outgoing message: HeartbeatPing{last_stream_id_received=79}
    08-20 12:03:11.223 D/GmsGcmMcsSvc(1121): I/O error: javax.net.ssl.SSLException: Read error: ssl=0xa0ccf200: I/O error during system call, Connection reset by peer
    08-20 12:03:11.223 D/GmsGcmMcsSvc(1121): I/O error: javax.net.ssl.SSLException: Write error: ssl=0xa0ccf200: I/O error during system call, Broken pipe
    08-20 12:03:11.223 D/GmsGcmMcsSvc(1121): Teardown initiated, reason: javax.net.ssl.SSLException: Write error: ssl=0xa0ccf200: I/O error during system call, Broken pipe
    08-20 12:03:11.223 D/GmsGcmMcsSvc(1121): Teardown initiated, reason: javax.net.ssl.SSLException: Read error: ssl=0xa0ccf200: I/O error during system call, Connection reset by peer
    

    Since then, heartbeat stopped. Killing microg services and then toggling airplane mode on and off again resulted in a reconnect and heartbeat works again

  14. bonanza123 commented on Aug 20, 2015

    @bonanza123

    I also have some of them, but I guess they mainly occur when connectivity drops / changes. Also, for me, heartbeating continues as expected.

  15. dajoe commented on Aug 20, 2015

    @dajoe
    Author

    Yes, most of the time, reconnection works. This time, it didn't. Since 1a83f82, everything is way more stabile. But still, from time to time, the connection is lost and not reconnected

  16. pejakm commented on Oct 6, 2015

    @pejakm
    Contributor

    I'm using v0.01, on Euphoria OS (patched), and sometimes I need to restart my phone in order for gcm messages to arrive.

  17. added a commit that references this issue on Oct 11, 2015
  18. mar-v-in commented on Oct 15, 2015

    @mar-v-in
    Member

    The checkin itself is now done automatically, problems with push messaging after 766a6a1 (upcoming release v0.02) should be reported to #31

  19. added a commit that references this issue on Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions