Skip to content

SendVerificationCode method is returning Error Code: 16 in production for some users #12109

@minlite

Description

@minlite

Description

I'm using Firebase Auth in production. I have Firebase AppCheck enabled and enforced for Authentication.

A small percentage of my users on iOS are seeing the sdk error out with An internal error has occurred, print and inspect the error details for more information. when trying to request a verification code.

I went through our logs in Google Cloud and noticed that the google.cloud.identitytoolkit.v1.AuthenticationService.SendVerificationCode method is failing with error code 16 and message Error code: 16 for them. The logs don't provide any other indication of what error code 16 might be and my search of this error online plus in the firebase emulation tools has not resulted in any answers. Please see the full log with number, ip address, and project details redacted below:

{
  "insertId": "kjdxlhdp2nu",
  "jsonPayload": {
    "status": {
      "code": 16,
      "message": "Error code: 16"
    },
    "request": {
      "phoneNumber": "xxxxxxxxxxxxx",
      "@type": "type.googleapis.com/google.cloud.identitytoolkit.v1.SendVerificationCodeRequest"
    },
    "requestMetadata": {
      "callerIp": "xxxxxxxxxxxx",
      "callerSuppliedUserAgent": "FirebaseAuth.iOS/10.17.0 xxxxxxxxxxxx/7.27 iPhone/16.5.1 hw/iPhone12_3,gzip(gfe),gzip(gfe)"
    },
    "methodName": "google.cloud.identitytoolkit.v1.AuthenticationService.SendVerificationCode",
    "@type": "type.googleapis.com/google.cloud.identitytoolkit.logging.RequestLog",
    "serviceName": "identitytoolkit.googleapis.com"
  },
  "resource": {
    "type": "identitytoolkit_project",
    "labels": {
      "project_id": "xxxxxxxxxxx"
    }
  },
  "timestamp": "2023-11-15T23:25:18.518Z",
  "severity": "ERROR",
  "logName": "projects/xxxxxxxxxxxx/logs/identitytoolkit.googleapis.com%2Frequests",
  "receiveTimestamp": "2023-11-15T23:25:18.876791432Z"
}

As you can see, I am using the latest Firebase iOS SDK (10.17.0) and the user has the latest version of my app.

I doubt this is a clear cut misconfiguration on our side since the majority of users are able to sign in with no issue. I would like if Firebase team can decipher what error code 16 might mean and why the SDK is not providing a more useful error message.

Reproducing the issue

No response

Firebase SDK Version

10.17.0

Xcode Version

15.0

Installation Method

CocoaPods

Firebase Product(s)

App Check, Authentication

Targeted Platforms

iOS

Relevant Log Output

{
  "insertId": "kjdxlhdp2nu",
  "jsonPayload": {
    "status": {
      "code": 16,
      "message": "Error code: 16"
    },
    "request": {
      "phoneNumber": "xxxxxxxxxxxxx",
      "@type": "type.googleapis.com/google.cloud.identitytoolkit.v1.SendVerificationCodeRequest"
    },
    "requestMetadata": {
      "callerIp": "xxxxxxxxxxxx",
      "callerSuppliedUserAgent": "FirebaseAuth.iOS/10.17.0 xxxxxxxxxxxx/7.27 iPhone/16.5.1 hw/iPhone12_3,gzip(gfe),gzip(gfe)"
    },
    "methodName": "google.cloud.identitytoolkit.v1.AuthenticationService.SendVerificationCode",
    "@type": "type.googleapis.com/google.cloud.identitytoolkit.logging.RequestLog",
    "serviceName": "identitytoolkit.googleapis.com"
  },
  "resource": {
    "type": "identitytoolkit_project",
    "labels": {
      "project_id": "xxxxxxxxxxx"
    }
  },
  "timestamp": "2023-11-15T23:25:18.518Z",
  "severity": "ERROR",
  "logName": "projects/xxxxxxxxxxxx/logs/identitytoolkit.googleapis.com%2Frequests",
  "receiveTimestamp": "2023-11-15T23:25:18.876791432Z"
}

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet
Replace this line with the contents of your Package.resolved.

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# Uncomment this line if you're using Swift
use_frameworks!

platform :ios, '13.0'

target 'XXXXXXXXX' do
    project 'XXXXXXXXX', 'Debug' => :debug, 'Debug.Staging' => :debug, 'Release' => :release, 'Release.Staging' => :release
    pod 'FirebaseMessaging'
    pod 'FirebaseAuth'
    pod 'FirebaseAnalytics'
    pod 'FirebaseAppCheck'
    pod 'FirebaseCrashlytics'
    pod 'FirebaseRemoteConfig'

end

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions