Skip to content

COCOA の UserData が壊れている件の補足

Tomoaki Masuda edited this page Jan 23, 2021 · 1 revision

報道ステーション COCOA 独自解析でわかった“不具合" の補足です。

継続期間がいきなり0日になったときに、COCOA 突如として初期化される問題(UserDataが壊れている) · Issue #16 · cocoa-mhlw/cocoa を参考にしてログを取得します。

このとき、「existsUserData:」でログを検索すると、

  • "existsUserData: False" が続いている。
  • 何かの拍子(OnClickAgreeなど)で、"existsUserData: True" になる
  • 以降 "existsUserData: True" で正常動作する

という結果が得られるときがあります。

"2021/01/04 11:47:18","Info","Deleted 'cocoa_log_20201221.csv'","Rotate","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/Logs/LogFileService.cs","139","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 11:47:18","Info","End","Rotate","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/Logs/LogFileService.cs","147","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 11:47:18","Info","Start","Get","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","67","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 11:47:18","Info","existsUserData: False","Get","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","70","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 11:47:18","Info","End","Get","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","77","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 11:47:18","Info","userData is null.",".ctor","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","46","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 11:47:18","Info","Start","FetchExposureKeyBatchFilesFromServerAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","153","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 11:47:18","Info","Start download files","FetchExposureKeyBatchFilesFromServerAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","163","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 11:47:18","Info","Start","DownloadBatchAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","204","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 11:47:18","Info","Start","GetTemporaryExposureKeyList","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/HttpDataService.cs","103","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 11:47:18","Info","Success to download","GetTemporaryExposureKeyList","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/HttpDataService.cs","110","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 11:47:18","Info","End","GetTemporaryExposureKeyList","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/HttpDataService.cs","111","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 11:47:19","Error","Fail to download files, Exception: System.NullReferenceException: Object reference not set to an instance of an object  at Covid19Radar.Services.ExposureNotificationHandler.DownloadBatchAsync (System.String region, System.Threading.CancellationToken cancellationToken) <0x1061b0430 + 0x00558> in <1abf079d7ff14e698144d8eed233764d#3d51fe5363cc0218d8b88183cd5fca9c>:0   at Covid19Radar.Services.ExposureNotificationHandler.FetchExposureKeyBatchFilesFromServerAsync (System.Func`2[T,TResult] submitBatches, System.Threading.CancellationToken cancellationToken) <0x1061af960 + 0x0039b> in <1abf079d7ff14e698144d8eed233764d#3d51fe5363cc0218d8b88183cd5fca9c>:0 ","FetchExposureKeyBatchFilesFromServerAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","197","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 11:47:19","Info","End","FetchExposureKeyBatchFilesFromServerAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","199","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 12:17:18","Info","Start","FetchExposureKeyBatchFilesFromServerAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","153","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 12:17:18","Info","Start download files","FetchExposureKeyBatchFilesFromServerAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","163","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 12:17:18","Info","Start","DownloadBatchAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","204","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 12:17:18","Info","Start","GetTemporaryExposureKeyList","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/HttpDataService.cs","103","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 12:17:18","Info","Success to download","GetTemporaryExposureKeyList","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/HttpDataService.cs","110","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 12:17:18","Info","End","GetTemporaryExposureKeyList","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/HttpDataService.cs","111","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 12:17:18","Error","Fail to download files, Exception: System.NullReferenceException: Object reference not set to an instance of an object  at Covid19Radar.Services.ExposureNotificationHandler.DownloadBatchAsync (System.String region, System.Threading.CancellationToken cancellationToken) <0x1061b0430 + 0x00558> in <1abf079d7ff14e698144d8eed233764d#3d51fe5363cc0218d8b88183cd5fca9c>:0   at Covid19Radar.Services.ExposureNotificationHandler.FetchExposureKeyBatchFilesFromServerAsync (System.Func`2[T,TResult] submitBatches, System.Threading.CancellationToken cancellationToken) <0x1061af960 + 0x0039b> in <1abf079d7ff14e698144d8eed233764d#3d51fe5363cc0218d8b88183cd5fca9c>:0 ","FetchExposureKeyBatchFilesFromServerAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","197","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 12:17:18","Info","End","FetchExposureKeyBatchFilesFromServerAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","199","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 16:17:24","Info","Start","FetchExposureKeyBatchFilesFromServerAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","153","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 16:17:24","Info","Start download files","FetchExposureKeyBatchFilesFromServerAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","163","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 16:17:24","Info","Start","DownloadBatchAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","204","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 16:17:24","Info","Start","GetTemporaryExposureKeyList","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/HttpDataService.cs","103","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 16:17:24","Info","Success to download","GetTemporaryExposureKeyList","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/HttpDataService.cs","110","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 16:17:24","Info","End","GetTemporaryExposureKeyList","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/HttpDataService.cs","111","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 16:17:24","Error","Fail to download files, Exception: System.NullReferenceException: Object reference not set to an instance of an object  at Covid19Radar.Services.ExposureNotificationHandler.DownloadBatchAsync (System.String region, System.Threading.CancellationToken cancellationToken) <0x1061b0430 + 0x00558> in <1abf079d7ff14e698144d8eed233764d#3d51fe5363cc0218d8b88183cd5fca9c>:0   at Covid19Radar.Services.ExposureNotificationHandler.FetchExposureKeyBatchFilesFromServerAsync (System.Func`2[T,TResult] submitBatches, System.Threading.CancellationToken cancellationToken) <0x1061af960 + 0x0039b> in <1abf079d7ff14e698144d8eed233764d#3d51fe5363cc0218d8b88183cd5fca9c>:0 ","FetchExposureKeyBatchFilesFromServerAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","197","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 16:17:24","Info","End","FetchExposureKeyBatchFilesFromServerAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","199","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 20:17:58","Info","Start","FetchExposureKeyBatchFilesFromServerAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","153","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 20:17:58","Info","Start download files","FetchExposureKeyBatchFilesFromServerAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","163","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 20:17:58","Info","Start","DownloadBatchAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","204","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 20:17:58","Info","Start","GetTemporaryExposureKeyList","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/HttpDataService.cs","103","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 20:17:58","Info","Success to download","GetTemporaryExposureKeyList","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/HttpDataService.cs","110","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 20:17:58","Info","End","GetTemporaryExposureKeyList","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/HttpDataService.cs","111","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 20:17:58","Error","Fail to download files, Exception: System.NullReferenceException: Object reference not set to an instance of an object  at Covid19Radar.Services.ExposureNotificationHandler.DownloadBatchAsync (System.String region, System.Threading.CancellationToken cancellationToken) <0x1061b0430 + 0x00558> in <1abf079d7ff14e698144d8eed233764d#3d51fe5363cc0218d8b88183cd5fca9c>:0   at Covid19Radar.Services.ExposureNotificationHandler.FetchExposureKeyBatchFilesFromServerAsync (System.Func`2[T,TResult] submitBatches, System.Threading.CancellationToken cancellationToken) <0x1061af960 + 0x0039b> in <1abf079d7ff14e698144d8eed233764d#3d51fe5363cc0218d8b88183cd5fca9c>:0 ","FetchExposureKeyBatchFilesFromServerAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","197","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 20:17:58","Info","End","FetchExposureKeyBatchFilesFromServerAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","199","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:48","Info","Start","OnInitialized","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/App.xaml.cs","42","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:48","Info","Start","Get","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","67","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:48","Info","existsUserData: False","Get","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","70","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:48","Info","End","Get","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","77","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:48","Info","No user data exists","OnInitialized","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/App.xaml.cs","80","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:48","Info","Transition to TutorialPage1","OnInitialized","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/App.xaml.cs","81","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:48","Info","End","OnInitialized","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/App.xaml.cs","99","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:49","Info","Start","Init","/Users/runner/work/1/s/Covid19Radar/Covid19Radar.iOS/Services/Logs/LogPeriodicDeleteServiceIos.cs","40","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:49","Info","Start","ScheduleAppRefresh","/Users/runner/work/1/s/Covid19Radar/Covid19Radar.iOS/Services/Logs/LogPeriodicDeleteServiceIos.cs","92","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:49","Info","request.EarliestBeginDate: 2021-01-05 14:39:49 +0000","ScheduleAppRefresh","/Users/runner/work/1/s/Covid19Radar/Covid19Radar.iOS/Services/Logs/LogPeriodicDeleteServiceIos.cs","98","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:49","Info","End","ScheduleAppRefresh","/Users/runner/work/1/s/Covid19Radar/Covid19Radar.iOS/Services/Logs/LogPeriodicDeleteServiceIos.cs","107","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:49","Info","End","Init","/Users/runner/work/1/s/Covid19Radar/Covid19Radar.iOS/Services/Logs/LogPeriodicDeleteServiceIos.cs","49","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:49","Info","Start","Rotate","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/Logs/LogFileService.cs","128","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:49","Info","End","Rotate","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/Logs/LogFileService.cs","147","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:52","Info","Start","Get","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","67","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:52","Info","existsUserData: False","Get","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","70","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:52","Info","End","Get","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","77","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"

"2021/01/04 23:39:57","Info","Start","OnClickAgree","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/ViewModels/Tutorial/TutorialPage3ViewModel.cs","35","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"

"2021/01/04 23:39:57","Info","No user data exists","OnClickAgree","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/ViewModels/Tutorial/TutorialPage3ViewModel.cs","40","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:57","Info","Start","RegisterUserAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","44","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:57","Info","Start","PostRegisterUserAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/HttpDataService.cs","62","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:57","Info","End","PostRegisterUserAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/HttpDataService.cs","81","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:57","Info","userData is not null","RegisterUserAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","52","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:57","Info","Start","SetAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","83","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:57","Info","currentdata don't equals newdata","SetAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","93","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:57","Info","Start","Get","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","67","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:57","Info","existsUserData: True","Get","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","70","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:57","Info","End","Get","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","73","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:57","Info","End","SetAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","100","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:57","Info","End","RegisterUserAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","61","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:57","Info","userData is not null","OnClickAgree","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/ViewModels/Tutorial/TutorialPage3ViewModel.cs","50","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:57","Info","Start","SetAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","83","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:57","Info","currentdata don't equals newdata","SetAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","93","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:57","Info","Start","Get","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","67","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:57","Info","existsUserData: True","Get","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","70","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:57","Info","End","Get","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","73","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:57","Info","End","SetAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","100","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:57","Info","IsOptined set to True","OnClickAgree","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/ViewModels/Tutorial/TutorialPage3ViewModel.cs","59","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:57","Info","Start","SaveLastUpdateDateAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/TermsUpdateService.cs","106","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:57","Info","End","SaveLastUpdateDateAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/TermsUpdateService.cs","111","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/04 23:39:57","Info","Start","Get","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","67","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"

このとき、"existsUserData: False" となっている期間は、計算値とのマッチングがうまく動いていないので「接触通知」がでなくなります。

"existsUserData: False" のログ出力は以下の箇所で、UserDataService::Get メソッド内で発生します。

in UserDataService.cs

        public UserDataModel Get()
        {
            loggerService.StartMethod();

            var existsUserData = Application.Current.Properties.ContainsKey("UserData");
            loggerService.Info($"existsUserData: {existsUserData}");
            if (existsUserData)
            {
                loggerService.EndMethod();
                return Utils.DeserializeFromJson<UserDataModel>(Application.Current.Properties["UserData"].ToString());
            }

            loggerService.EndMethod();
            return null;
        }

本来ならば、アプリケーションのデータファイルとして「UserData」の形で保存されています。UserData の内容は JSON 形式で、内部のデータは UserDataModel クラスのプロパティです。 UserDataModel クラスの中味はアプリケーションを起動したとき作成され、その後、夜間のTEKのダウンロードなどで更新されるデータです。

UserData が壊れている状態

これは、ログを "existsUserData: False" で検索すればよいのですが、もう少し調査してみました。

  1. ログが 1/4 までずっと "existsUserData: False" となる
  2. 自動的にリセットされて、たぶん同意 OnClickAgree をした後は、"existsUserData: Ture" になる
  3. 1/6 に陽性登録が行われる
  4. 1/7 の夜中に TEK がダウンロードされて MatchedKeyCount: 6 となるが、EN API で HighestRiskScore = 0 と返されるため陽性通知がでない。

調べると 1/4 までは GetTemporaryExposureKeyList で例外が頻発しています。

"2021/01/03 02:47:52","Info","Start","FetchExposureKeyBatchFilesFromServerAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","153","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/03 02:47:52","Info","Start download files","FetchExposureKeyBatchFilesFromServerAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","163","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/03 02:47:52","Info","Start","DownloadBatchAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","204","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/03 02:47:52","Info","Start","GetTemporaryExposureKeyList","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/HttpDataService.cs","103","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/03 02:47:52","Info","Success to download","GetTemporaryExposureKeyList","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/HttpDataService.cs","110","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/03 02:47:52","Info","End","GetTemporaryExposureKeyList","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/HttpDataService.cs","111","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/03 02:47:53","Error","Fail to download files, Exception: System.NullReferenceException: Object reference not set to an instance of an object  at Covid19Radar.Services.ExposureNotificationHandler.DownloadBatchAsync (System.String region, System.Threading.CancellationToken cancellationToken) <0x101eac430 + 0x00558> in <1abf079d7ff14e698144d8eed233764d#3d51fe5363cc0218d8b88183cd5fca9c>:0   at Covid19Radar.Services.ExposureNotificationHandler.FetchExposureKeyBatchFilesFromServerAsync (System.Func`2[T,TResult] submitBatches, System.Threading.CancellationToken cancellationToken) <0x101eab960 + 0x0039b> in <1abf079d7ff14e698144d8eed233764d#3d51fe5363cc0218d8b88183cd5fca9c>:0 ","FetchExposureKeyBatchFilesFromServerAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","197","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/03 02:47:53","Info","End","FetchExposureKeyBatchFilesFromServerAsync","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","199","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/03 06:48:19","Info","Start","OnInitialized","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/App.xaml.cs","42","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/03 06:48:19","Info","Start","Get","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","67","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/03 06:48:19","Info","existsUserData: False","Get","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","70","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"
"2021/01/03 06:48:19","Info","End","Get","/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/UserDataService.cs","77","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"

GetTemporaryExposureKeyList メソッドは、TEK の url リストを JSON 形式で受け取る関数です。これが例外を吐くのは、JSON 形式がおかしい場合ですが、同時期の他の端末ではうまくうごいているので、この呼び出しの前後でおかしくなっています。

        public async Task<List<TemporaryExposureKeyExportFileModel>> GetTemporaryExposureKeyList(string region, CancellationToken cancellationToken)
        {
            loggerService.StartMethod();

            string container = AppSettings.Instance.BlobStorageContainerName;
            string url = AppSettings.Instance.CdnUrlBase + $"{container}/{region}/list.json";
            var result = await GetCdnAsync(url, cancellationToken);
            if (result != null)
            {
                loggerService.Info("Success to download");
                loggerService.EndMethod();
                return Utils.DeserializeFromJson<List<TemporaryExposureKeyExportFileModel>>(result);
            }
            else
            {
                loggerService.Error("Fail to download");
                loggerService.EndMethod();
                return new List<TemporaryExposureKeyExportFileModel>();
            }
        }

具体的に例外を catch していところは以下です。

"/Users/runner/work/1/s/Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs","197","iOS","14.2","iPhone11,8","Physical","1.2.1","1607653212"

        public async Task FetchExposureKeyBatchFilesFromServerAsync(Func<IEnumerable<string>, Task> submitBatches, CancellationToken cancellationToken)
        {
            loggerService.StartMethod();
            // This is "default" by default
            var rightNow = DateTimeOffset.UtcNow;

            try
            {
                foreach (var serverRegion in AppSettings.Instance.SupportedRegions)
                {
                    cancellationToken.ThrowIfCancellationRequested();

                    loggerService.Info("Start download files");
                    var (batchNumber, downloadedFiles) = await DownloadBatchAsync(serverRegion, cancellationToken);
                    loggerService.Info("End to download files");
                    loggerService.Info($"Batch number: {batchNumber}, Downloaded files: {downloadedFiles.Count}");

                    if (batchNumber == 0)
                    {
                        continue;
                    }

                    if (downloadedFiles.Count > 0)
                    {
                        loggerService.Info("C19R Submit Batches");
                        await submitBatches(downloadedFiles);

                        // delete all temporary files
                        foreach (var file in downloadedFiles)
                        {
                            try
                            {
                                File.Delete(file);
                            }
                            catch (Exception ex)
                            {
                                // no-op
                                loggerService.Exception("Fail to delete downloaded files", ex);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                // any expections, bail out and wait for the next time
                loggerService.Exception("Fail to download files", ex);      // ★
            }
            loggerService.EndMethod();
        }
Clone this wiki locally