Skip to content

System.ArgumentOutOfRangeException in ConfigInfo constructor (from EnsureInitializedAsync) #1481

Description

@playside-heath

Description

We've been having this error for a long time, it's affecting a small % of users.
294 in 12,390 unique users, so around 2% of unique users. Of those users, many have the issue more than once.

System.ArgumentOutOfRangeException: Value to add was out of range.
Parameter name: value
  at System.DateTime.Add (System.Double value, System.Int32 scale) [0x00000] in <00000000000000000000000000000000>:0 
  at System.DateTime.AddMilliseconds (System.Double value) [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.RemoteConfig.ConfigInfo..ctor (Firebase.RemoteConfig.ConfigInfoInternal configInfoInternal) [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.RemoteConfig.FirebaseRemoteConfig.EnsureInitializedAsync () [0x00000] in <00000000000000000000000000000000>:0 

Related to: #1058
but it has been closed.

Reproducing the issue

try
{
    await FirebaseRemoteConfig.DefaultInstance.EnsureInitializedAsync();
}
catch {} // Ignored

ConfigSettings cSet = new ConfigSettings();
cSet.MinimumFetchIntervalInMilliseconds = 12 * 60 * 60 * 1000; // or 0 in some cases
await FirebaseRemoteConfig.DefaultInstance.SetConfigSettingsAsync(cSet);

if (!await FirebaseRemoteConfig.DefaultInstance.FetchAndActivateAsync())
{
    ConfigInfo? configInfo = await FirebaseRemoteConfig.DefaultInstance.EnsureInitializedAsync();
    // ^^ Exception happens here (and possibly in the first EnsureInitializedAsync too, since we try/ catch it and ignore the exception the first time)
}

Firebase Unity SDK Version

13.3.0

Unity editor version

2022.3.62f2

Installation Method

Unity Package Manager

Problematic Firebase Component(s)

Remote Config

Other Firebase Component(s) in use

AB Testing, Analytics, Crashlytics, Installations, Messaging

Additional SDKs you are using

Facebook, Adjust, Qonversion, PlayFab

Targeted Platform(s)

Android, Apple Platforms

Unity editor platform

Windows, Linux

Scripting Runtime

IL2CPP

Release Distribution Type

Pre-built SDK from https://firebase.google.com/download/unity

Relevant Log Output

If using CocoaPods for Apple platforms, the project's Podfile.lock

Expand Podfile.lock snippet
I don't have access to the xcode project or the pods file, instead I'll show android dependencies:

    implementation 'com.google.firebase:firebase-analytics:23.0.0' // Packages/com.google.firebase.analytics/Firebase/Editor/AnalyticsDependencies.xml:13
    implementation 'com.google.firebase:firebase-analytics-unity:13.3.0' // Packages/com.google.firebase.analytics/Firebase/Editor/AnalyticsDependencies.xml:18
    implementation 'com.google.firebase:firebase-app-unity:13.3.0' // Packages/com.google.firebase.app/Firebase/Editor/AppDependencies.xml:22
    implementation 'com.google.firebase:firebase-common:22.0.0' // Packages/com.google.firebase.app/Firebase/Editor/AppDependencies.xml:13
    implementation 'com.google.firebase:firebase-config:23.0.0' // Packages/com.google.firebase.remote-config/Firebase/Editor/RemoteConfigDependencies.xml:13
    implementation 'com.google.firebase:firebase-config-unity:13.3.0' // Packages/com.google.firebase.remote-config/Firebase/Editor/RemoteConfigDependencies.xml:20
    implementation 'com.google.firebase:firebase-crashlytics-ndk:20.0.1' // Packages/com.google.firebase.crashlytics/Firebase/Editor/CrashlyticsDependencies.xml:13
    implementation 'com.google.firebase:firebase-crashlytics-unity:13.3.0' // Packages/com.google.firebase.crashlytics/Firebase/Editor/CrashlyticsDependencies.xml:20
    implementation 'com.google.firebase:firebase-iid:21.1.0' // Packages/com.google.firebase.messaging/Firebase/Editor/MessagingDependencies.xml:17
    implementation 'com.google.firebase:firebase-installations:19.0.0' // Packages/com.google.firebase.installations/Firebase/Editor/InstallationsDependencies.xml:13
    implementation 'com.google.firebase:firebase-installations-unity:13.3.0' // Packages/com.google.firebase.installations/Firebase/Editor/InstallationsDependencies.xml:20
    implementation 'com.google.firebase:firebase-messaging:25.0.0' // Packages/com.google.firebase.messaging/Firebase/Editor/MessagingDependencies.xml:13
    implementation 'com.google.firebase:firebase-messaging-unity:13.3.0' // Packages/com.google.firebase.messaging/Firebase/Editor/MessagingDependencies.xml:24

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