firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

ErrorCode 17999

Open jostster opened this issue 1 year ago • 12 comments

Description

iOS users randomly receive ErrorCode 17999

 Error Domain=FIRAuthErrorDomain Code=17999 \"An internal error has occurred, print and inspect the error details for more information.\" UserInfo={FIRAuthErrorUserInfoNameKey=ERROR_INTERNAL_ERROR, NSLocalizedDescription=An internal error has occurred, print and inspect the error details for more information., NSUnderlyingError=0x302e96790 {Error Domain=FIRAuthInternalErrorDomain Code=3 \"(null)\" UserInfo={NSUnderlyingError=0x302c5a8b0 {Error Domain=com.google.HTTPStatus Code=401 \"(null)\" UserInfo={data={length = 284, bytes = 0x7b0a20 ... }, data_content_type=application/json; charset=UTF-8}}, FIRAuthErrorUserInfoDeserializedResponseKey={\n    code = 401;\n    errors =     (\n                {\n            domain = global;\n            message = \"Firebase App Check token is invalid.\";\n            reason = unauthorized;\n        }\n    );\n    message = \"Firebase App Check token is invalid.\";\n    status = UNAUTHENTICATED;\n}}}}"

Could be a regression of https://github.com/firebase/firebase-ios-sdk/issues/11926 which was fixed. I am unable to replicate this locally but many users are saying they are encountering this with some saying a re-install isn't resolving it.

I feel that the AppCheck token isn't being re-generated when a 17999 error is received.

Reproducing the issue

Unable to repro locally, but users just attempt to login with username / password using signInWithEmailPassword with AppCheck enabled.

Firebase SDK Version

10.23.1

Xcode Version

15.3

Installation Method

Swift Package Manager

Firebase Product(s)

App Check, Authentication, Crashlytics, DynamicLinks

Targeted Platforms

iOS

Relevant Log Output

No response

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

Expand Package.resolved snippet

{
  "pins" : [
    {
      "identity" : "abseil-cpp-binary",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/abseil-cpp-binary.git",
      "state" : {
        "revision" : "7ce7be095bc3ed3c98b009532fe2d7698c132614",
        "version" : "1.2024011601.0"
      }
    },
    {
      "identity" : "alamofire",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/Alamofire/Alamofire.git",
      "state" : {
        "revision" : "bc268c28fb170f494de9e9927c371b8342979ece",
        "version" : "5.7.1"
      }
    },
    {
      "identity" : "alamofireimage",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/Alamofire/AlamofireImage.git",
      "state" : {
        "revision" : "98cbb00ce0ec5fc8e52a5b50a6bfc08d3e5aee10",
        "version" : "4.2.0"
      }
    },
    {
      "identity" : "amplitude-ios",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/amplitude/Amplitude-iOS",
      "state" : {
        "revision" : "94160a550835e6f0a1df9fa76ab3902ac4648a9c",
        "version" : "8.17.1"
      }
    },
    {
      "identity" : "analytics-connector-ios",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/amplitude/analytics-connector-ios.git",
      "state" : {
        "revision" : "d2f3ec4b022211a67d5d4509135d84359f7f8b8d",
        "version" : "1.0.2"
      }
    },
    {
      "identity" : "apollo-ios",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apollographql/apollo-ios.git",
      "state" : {
        "revision" : "97ad4f5b41f003f4f283c5f3386fb773af17aa67",
        "version" : "1.3.2"
      }
    },
    {
      "identity" : "app-check",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/app-check.git",
      "state" : {
        "revision" : "3e464dad87dad2d29bb29a97836789bf0f8f67d2",
        "version" : "10.18.1"
      }
    },
    {
      "identity" : "appsflyerframework",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/AppsFlyerSDK/AppsFlyerFramework",
      "state" : {
        "revision" : "d798f38fdc006621f5720579fdcba292c522a660",
        "version" : "6.12.1"
      }
    },
    {
      "identity" : "asn1swift",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/tikhop/ASN1Swift",
      "state" : {
        "revision" : "b53bee03a942623db25afc5bfb80227b2cb3b425",
        "version" : "1.2.4"
      }
    },
    {
      "identity" : "aws-signer-v4",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/adam-fowler/aws-signer-v4.git",
      "state" : {
        "revision" : "2e205327f842f808340e7e40eee3f9dec7e1f649",
        "version" : "2.1.1"
      }
    },
    {
      "identity" : "braze-swift-sdk",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/braze-inc/braze-swift-sdk",
      "state" : {
        "revision" : "e42292d5b782eabb9a8a40d839f04df6a62bebc7",
        "version" : "8.2.1"
      }
    },
    {
      "identity" : "chargebee-ios",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/tommyboytech/chargebee-ios",
      "state" : {
        "revision" : "479e2759a86b28a5653829e1ae97375dfa365c99"
      }
    },
    {
      "identity" : "cocoalumberjack",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/CocoaLumberjack/CocoaLumberjack.git",
      "state" : {
        "revision" : "af4973721172dd7850a42a58a9ffcec0ec82e5a9",
        "version" : "3.8.4"
      }
    },
    {
      "identity" : "confettiswiftui",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/simibac/ConfettiSwiftUI.git",
      "state" : {
        "revision" : "f45961f97bbae6fff6e2e64546fea0189425ad92",
        "version" : "1.1.0"
      }
    },
    {
      "identity" : "experiment-ios-client",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/amplitude/experiment-ios-client",
      "state" : {
        "revision" : "e2909462c1f4be3df5b3d27ca535f6500ef5f101",
        "version" : "1.11.0"
      }
    },
    {
      "identity" : "facebook-ios-sdk",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/facebook/facebook-ios-sdk",
      "state" : {
        "revision" : "c19607d535864533523d1f437c84035e5fb101cf",
        "version" : "14.1.0"
      }
    },
    {
      "identity" : "factory",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/hmlongco/Factory",
      "state" : {
        "revision" : "39ff6a675cd0272d833d184d35add0f8fddd63de",
        "version" : "1.3.7"
      }
    },
    {
      "identity" : "firebase-ios-sdk",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/firebase/firebase-ios-sdk.git",
      "state" : {
        "revision" : "888f0b6026e2441a69e3ee2ad5293c7a92031e62",
        "version" : "10.23.1"
      }
    },
    {
      "identity" : "googleappmeasurement",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/GoogleAppMeasurement.git",
      "state" : {
        "revision" : "c7a5917ebe48d69f421aadf154ef3969c8b7f12d",
        "version" : "10.23.1"
      }
    },
    {
      "identity" : "googledatatransport",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/GoogleDataTransport.git",
      "state" : {
        "revision" : "a637d318ae7ae246b02d7305121275bc75ed5565",
        "version" : "9.4.0"
      }
    },
    {
      "identity" : "googleutilities",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/GoogleUtilities.git",
      "state" : {
        "revision" : "26c898aed8bed13b8a63057ee26500abbbcb8d55",
        "version" : "7.13.1"
      }
    },
    {
      "identity" : "grpc-binary",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/grpc-binary.git",
      "state" : {
        "revision" : "67043f6389d0e28b38fa02d1c6952afeb04d807f",
        "version" : "1.62.1"
      }
    },
    {
      "identity" : "gtm-session-fetcher",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/gtm-session-fetcher.git",
      "state" : {
        "revision" : "d415594121c9e8a4f9d79cecee0965cf35e74dbd",
        "version" : "3.1.1"
      }
    },
    {
      "identity" : "gzipswift",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/1024jp/GzipSwift",
      "state" : {
        "revision" : "731037f6cc2be2ec01562f6597c1d0aa3fe6fd05",
        "version" : "6.0.1"
      }
    },
    {
      "identity" : "inflectorkit",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/mattt/InflectorKit",
      "state" : {
        "revision" : "d8cbcc04972690aaa5fc760a2b9ddb3e9f0decd7",
        "version" : "1.0.0"
      }
    },
    {
      "identity" : "interop-ios-for-google-sdks",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/interop-ios-for-google-sdks.git",
      "state" : {
        "revision" : "2d12673670417654f08f5f90fdd62926dc3a2648",
        "version" : "100.0.0"
      }
    },
    {
      "identity" : "ios-analytics-debugger-spm",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/avohq/ios-analytics-debugger-spm",
      "state" : {
        "revision" : "b866a2ac3bb7540d17478e8cdca55fbef94abaf8",
        "version" : "1.3.0"
      }
    },
    {
      "identity" : "ios-places-sdk",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/googlemaps/ios-places-sdk",
      "state" : {
        "revision" : "2a9c7305a0e5f83b9acdccfc74eb545ffeb476c3",
        "version" : "8.5.0"
      }
    },
    {
      "identity" : "leveldb",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/firebase/leveldb.git",
      "state" : {
        "revision" : "0706abcc6b0bd9cedfbb015ba840e4a780b5159b",
        "version" : "1.22.2"
      }
    },
    {
      "identity" : "lottie-spm",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/airbnb/lottie-spm.git",
      "state" : {
        "revision" : "60ea4f82fba8b4cb21a75665a889e86ed4d81c6e",
        "version" : "4.2.0"
      }
    },
    {
      "identity" : "markdownkit",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/bmoliveira/MarkdownKit.git",
      "state" : {
        "revision" : "5056f3305d3499f44d8815530d560b87082e0cf5",
        "version" : "1.7.1"
      }
    },
    {
      "identity" : "nanopb",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/firebase/nanopb.git",
      "state" : {
        "revision" : "819d0a2173aff699fb8c364b6fb906f7cdb1a692",
        "version" : "2.30909.0"
      }
    },
    {
      "identity" : "phonenumberkit",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/marmelroy/PhoneNumberKit.git",
      "state" : {
        "revision" : "9bc965a326df8d5115f0b7bb77f09c542b8ec417",
        "version" : "3.6.6"
      }
    },
    {
      "identity" : "promises",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/promises.git",
      "state" : {
        "revision" : "e70e889c0196c76d22759eb50d6a0270ca9f1d9e",
        "version" : "2.3.1"
      }
    },
    {
      "identity" : "rollbar-apple",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/rollbar/rollbar-apple",
      "state" : {
        "revision" : "8f22deced5e5c58cfcf923395a9ac8496b3bc371",
        "version" : "3.2.1"
      }
    },
    {
      "identity" : "sdwebimage",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/SDWebImage/SDWebImage.git",
      "state" : {
        "revision" : "f6afa0132961d593f07970d84e2d8b588c29ea04",
        "version" : "5.19.1"
      }
    },
    {
      "identity" : "sqlite.swift",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/stephencelis/SQLite.swift.git",
      "state" : {
        "revision" : "7a2e3cd27de56f6d396e84f63beefd0267b55ccb",
        "version" : "0.14.1"
      }
    },
    {
      "identity" : "stripe-ios",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/stripe/stripe-ios",
      "state" : {
        "revision" : "e242f59ce90914e93c8308e0c3ceba7368575b77",
        "version" : "22.8.4"
      }
    },
    {
      "identity" : "swift-argument-parser",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-argument-parser.git",
      "state" : {
        "revision" : "fee6933f37fde9a5e12a1e4aeaa93fe60116ff2a",
        "version" : "1.2.2"
      }
    },
    {
      "identity" : "swift-atomics",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-atomics.git",
      "state" : {
        "revision" : "cd142fd2f64be2100422d658e7411e39489da985",
        "version" : "1.2.0"
      }
    },
    {
      "identity" : "swift-collections",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-collections",
      "state" : {
        "revision" : "937e904258d22af6e447a0b72c0bc67583ef64a2",
        "version" : "1.0.4"
      }
    },
    {
      "identity" : "swift-log",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-log.git",
      "state" : {
        "revision" : "32e8d724467f8fe623624570367e3d50c5638e46",
        "version" : "1.5.2"
      }
    },
    {
      "identity" : "swift-nio",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-nio",
      "state" : {
        "revision" : "635b2589494c97e48c62514bc8b37ced762e0a62",
        "version" : "2.63.0"
      }
    },
    {
      "identity" : "swift-protobuf",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-protobuf.git",
      "state" : {
        "revision" : "f25867a208f459d3c5a06935dceb9083b11cd539",
        "version" : "1.22.0"
      }
    },
    {
      "identity" : "swift-system",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-system.git",
      "state" : {
        "revision" : "025bcb1165deab2e20d4eaba79967ce73013f496",
        "version" : "1.2.1"
      }
    },
    {
      "identity" : "swiftui-tooltip",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/quassum/SwiftUI-Tooltip.git",
      "state" : {
        "revision" : "3bef9a21e2bcf1d0f078ddf6731c3c8996f32c3e",
        "version" : "1.4.0"
      }
    },
    {
      "identity" : "swiftygif",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/kirualex/SwiftyGif.git",
      "state" : {
        "revision" : "d6d26061d6553a493781ad3df4a8e275c43fc373",
        "version" : "5.4.4"
      }
    },
    {
      "identity" : "tpinappreceipt",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/tikhop/TPInAppReceipt.git",
      "state" : {
        "revision" : "5b830d6ce6c34bb4bb976917576ab560e7945037",
        "version" : "3.3.4"
      }
    },
    {
      "identity" : "youtube-ios-player-helper",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/youtube/youtube-ios-player-helper.git",
      "state" : {
        "revision" : "f57129cd4380ec0a74dd3a59da3270a1d653d59b",
        "version" : "1.0.4"
      }
    }
  ],
  "version" : 2
}


If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet

Replace this line with the contents of your Podfile.lock!

jostster avatar Apr 17 '24 20:04 jostster

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Apr 17 '24 20:04 google-oss-bot

Hi @jostster, which App Check provider(s) are being used in the project?

ncooke3 avatar Apr 19 '24 14:04 ncooke3

Hi @jostster, which App Check provider(s) are being used in the project?

We are using AppAttestProvider(app: app)

jostster avatar Apr 23 '24 20:04 jostster

Looks like more users are seeing this according to our support team. Users have stated they haven't changed devices but maybe they have restored from backup or for some reason the system is holding on to an old token?

jostster avatar May 01 '24 16:05 jostster

Users have stated they haven't changed devices but maybe they have restored from backup or for some reason the system is holding on to an old token?

In the case where the backup is creating the invalid state, the proposed fix for https://github.com/firebase/firebase-ios-sdk/issues/12629 may address this.

ncooke3 avatar May 09 '24 16:05 ncooke3

Users have stated they haven't changed devices but maybe they have restored from backup or for some reason the system is holding on to an old token?

In the case where the backup is creating the invalid state, the proposed fix for #12629 may address this.

That is a possibility but I didn't see anything from that issue about 17999 error code. We have also asked users with this issue to delete and reinstall the application which they say isn't resolving their issue. I have added back code into our next release that will reset the attest key when a 17999 occurs. We will see if that resolves the issue.

jostster avatar May 09 '24 16:05 jostster

@jostster, from the reports you've seen, does this seem like an issue that won't go away once it starts happening?

ncooke3 avatar May 10 '24 15:05 ncooke3

@ncooke3 it seems hit or miss. Some are saying that reinstalling the app does not resolve the issue while others that specifically stated, they bought a new phone and restored from cloud said that deleting and reinstalling did fix the issue.

jostster avatar May 10 '24 15:05 jostster

Got it. Thanks, @jostster. I'll release the fix for https://github.com/firebase/firebase-ios-sdk/issues/12629 early next week and we can then see if it addresses this issue. I have a feeling they are somewhat related.

ncooke3 avatar May 10 '24 17:05 ncooke3

Hi @jostster, I just released an update for a core dependency of Firebase App Check. See https://github.com/firebase/firebase-ios-sdk/issues/12629#issuecomment-2108139867

ncooke3 avatar May 13 '24 16:05 ncooke3

Hi @jostster, are you still facing this issue with the AppCheckCore dependency bumped to 10.19.1? https://github.com/firebase/firebase-ios-sdk/issues/12629#issuecomment-2110215864

ncooke3 avatar May 29 '24 21:05 ncooke3

@ncooke3 I haven't had a chance to implement it as it wasn't available in the latest release version at the time. I am on PTO but will add it into our June release

jostster avatar May 29 '24 21:05 jostster

Hey @jostster. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Aug 12 '24 01:08 google-oss-bot

I also getting this error, I didn't change any code, and it worked in the morning.

[log] e.message Error Domain=FIRAuthErrorDomain Code=17999 "An internal error has occurred, print and inspect the error details for more information." UserInfo={FIRAuthErrorUserInfoNameKey=ERROR_INTERNAL_ERROR, NSLocalizedDescription=An internal error has occurred, print and inspect the error details for more information., NSUnderlyingError=0x3029a9fe0 {Error Domain=FIRAuthInternalErrorDomain Code=3 "(null)" UserInfo={FIRAuthErrorUserInfoDataKey={length = 1628, bytes = 0x3c21444f 43545950 45206874 6d6c3e0a ... 2e3c2f69 6e733e0a }, NSUnderlyingError=0x3029a2610 {Error Domain=com.google.HTTPStatus Code=403 "(null)" UserInfo={data={length = 1628, bytes = 0x3c21444f 43545950 45206874 6d6c3e0a ... 2e3c2f69 6e733e0a }, data_content_type=text/html; charset=UTF-8}}}}}


     String? token =
          await FirebaseAuth.instance.currentUser!.getIdToken(force);

@jostster

ShehanRashmika avatar Aug 14 '24 15:08 ShehanRashmika

UPDATE

This error comes when device connect to VPN. If VPN is off its working. What is the issue?

ShehanRashmika avatar Aug 14 '24 16:08 ShehanRashmika

Hey @jostster. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Aug 21 '24 01:08 google-oss-bot

Since there haven't been any recent updates here, I am going to close this issue.

@jostster if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

google-oss-bot avatar Aug 28 '24 01:08 google-oss-bot

Reopening as this is still an issue.

ncooke3 avatar Sep 16 '24 11:09 ncooke3

Hi everyone, I have these token failures to Apple (FB13812838) and am still awaiting a response. I will follow-up and report back as I learn more.

ncooke3 avatar Sep 16 '24 11:09 ncooke3

For confirmation we had one user that updated their iOS version and was locked out because of the AppCheck. We asked them to uninstall our app, then reinstall it from the AppStore and they got back to us saying that reinstalling allowed them to get back in.

jostster avatar Sep 16 '24 17:09 jostster