{"record":{"id":"0ef509d65e363698","repo":"microg/GmsCore","slug":"internal-error","errorCode":"INTERNAL_ERROR","errorMessage":"Method <init2> realRecaptchaImpl is null","messagePattern":"Method <init2> realRecaptchaImpl is null","errorType":"error_code","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"play-services-recaptcha/core/src/main/kotlin/org/microg/gms/recaptcha/RecaptchaService.kt","lineNumber":125,"sourceCode":"    }\n\n    override fun init2(callback: IInitCallback, params: InitParams) {\n        lifecycleScope.launch {\n            Log.d(TAG, \"init($params)\")\n            try {\n                Log.d(TAG, \"imps size: ${imps.size}\")\n                for (recaptchaImpl in imps) {\n                    Log.d(TAG, \"recaptchaImpl:${recaptchaImpl}\")\n                    val recaptchaHandle = runCatching { recaptchaImpl.init(params) }.getOrNull() ?: continue\n                    realRecaptchaImpl = recaptchaImpl\n                    if (params.version == LEGACY_VERSION) {\n                        callback.onHandle(Status.SUCCESS, recaptchaHandle)\n                    } else {\n                        callback.onResults(Status.SUCCESS, InitResults().also { it.handle = recaptchaHandle })\n                    }\n                    Log.d(TAG, \"realRecaptchaImpl:${realRecaptchaImpl}\")\n                    return@launch\n                }\n                if (realRecaptchaImpl == null) {\n                    throw UnsupportedOperationException(\"Method <init2> realRecaptchaImpl is null\")\n                }\n            } catch (e: Exception) {\n                Log.w(TAG, e)\n                try {\n                    if (params.version == LEGACY_VERSION) {\n                        callback.onHandle(Status.INTERNAL_ERROR, null)\n                    } else {\n                        callback.onResults(Status.INTERNAL_ERROR, InitResults())\n                    }\n                } catch (e: Exception) {\n                    // Ignored\n                }\n            }\n        }\n    }\n","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-recaptcha/core/src/main/kotlin/org/microg/gms/recaptcha/RecaptchaService.kt#L107-L143","documentation":"RecaptchaService.init2() requires a real RecaptchaImpl backend. If realRecaptchaImpl is still null after initialization attempts, it throws UnsupportedOperationException(\"Method <init2> realRecaptchaImpl is null\"). The code=INTERNAL_ERROR indicates a server-side (service-side) internal failure: the service cannot serve init requests because its reCAPTCHA implementation was never created.","triggerScenarios":"Calling init()/init2() when the service failed to construct realRecaptchaImpl — e.g. the factory/dagger-like provider returned null, the underlying reCAPTCHA module failed to load, or initialization raced before the impl was set.","commonSituations":"microG service not fully started, broken installation missing the reCAPTCHA core, service restarted mid-request, or a bug in the impl-creation path (e.g. RecaptchaGuardImpl/RecaptchaWebImpl factory failure).","solutions":["Restart the microG/Play services process so the service can re-create realRecaptchaImpl","Check device logs (Log.w in the catch block) for the underlying exception that prevented impl creation","Reinstall/update microG to a version that includes the reCAPTCHA core module","Retry the init() call after the service has fully started"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { service.init(params) } catch (e: UnsupportedOperationException) { if (e.message?.contains(\"realRecaptchaImpl\") == true) restartServiceAndRetry() }","preventionTips":["Always call init() before other calls and retry on internal errors","Monitor logcat for backend creation failures","Keep microG installed with the reCAPTCHA module"],"tags":["kotlin","recaptcha","internal-error","service-init"],"backgroundTag":"internal-invariant-violation","analyzedSha":"157c9d86ac46c195a86c2f15ab55c84036223f95","analyzedAt":"2026-09-06T17:27:33.892Z","contentChangedAt":"2026-09-06T17:27:33.892Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}