{"record":{"id":"3aec2e62f6503c55","repo":"microg/GmsCore","slug":"error-service-not-available","errorCode":"ERROR_SERVICE_NOT_AVAILABLE","errorMessage":"ERROR_SERVICE_NOT_AVAILABLE","messagePattern":"ERROR_SERVICE_NOT_AVAILABLE","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"play-services-gcm/src/main/java/org/microg/gms/gcm/CloudMessagingRpc.java","lineNumber":134,"sourceCode":"    private PendingIntent getSelfAuthIntent() {\n        if (selfAuthIntent == null) {\n            Intent intent = new Intent();\n            intent.setPackage(\"com.google.example.invalidpackage\");\n            selfAuthIntent = PendingIntent.getBroadcast(context, 0, intent, 0);\n        }\n        return selfAuthIntent;\n    }\n\n    public Intent sendRegisterMessageBlocking(Bundle extras) throws IOException {\n        sendRegisterMessage(extras);\n        Intent resultIntent;\n        try {\n            resultIntent = messengerResponseQueue.poll(30, TimeUnit.SECONDS);\n        } catch (InterruptedException e) {\n            throw new IOException(e.getMessage());\n        }\n        if (resultIntent == null) {\n            throw new IOException(ERROR_SERVICE_NOT_AVAILABLE);\n        }\n        return resultIntent;\n    }\n\n    private void sendRegisterMessage(Bundle extras) {\n        Intent intent = new Intent(ACTION_C2DM_REGISTER);\n        intent.setPackage(getGcmPackageName(context));\n        extras.putString(EXTRA_MESSAGE_ID, \"google.rpc\" + messageIdCounter.getAndIncrement());\n        intent.putExtras(extras);\n        intent.putExtra(EXTRA_MESSENGER, messenger);\n        intent.putExtra(EXTRA_APP, getSelfAuthIntent());\n        context.startService(intent);\n    }\n\n    public void sendGcmMessage(Bundle extras) {\n        Intent intent = new Intent(ACTION_GCM_SEND);\n        intent.setPackage(GMS_PACKAGE_NAME);\n        intent.putExtras(extras);","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-gcm/src/main/java/org/microg/gms/gcm/CloudMessagingRpc.java#L116-L152","documentation":"GCM availability error in CloudMessagingRpc.sendRegisterMessageBlocking: the response Intent carried ERROR_SERVICE_NOT_AVAILABLE (or the wait failed), meaning the GCM service could not handle the register request at this time.","triggerScenarios":"Thrown at play-services-gcm/src/main/java/org/microg/gms/gcm/CloudMessagingRpc.java:134 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry registration with backoff — the service is often temporarily unavailable","Ensure GCM is enabled and the device has network","Wait before retrying instead of hammering the service"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"157c9d86ac46c195a86c2f15ab55c84036223f95","analyzedAt":"2026-09-06T17:27:33.892Z","contentChangedAt":"2026-09-06T17:27:33.892Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}