microsoft / appcenter-sdk-dotnet

Development repository for the App Center SDK for .NET platforms, including Xamarin
Other
310 stars 141 forks source link

AppCenter.Start causes error : "database is locked" #1740

Closed RTonnesen closed 8 months ago

RTonnesen commented 1 year ago

Description

AppCenter.Start causes error : "database is locked"

This may be a duplicate of https://github.com/microsoft/appcenter-sdk-apple/issues/2468. I've created this issue, as I have example code showing the error.

Repro Steps

Example code causing the error can be found in: https://github.com/RTonnesen/appcenter-repro

Build and deploy+debug the project on a physical iPhone. Observe debug output.

Details

  1. Which SDK version are you using? 5.0.1

  2. Which OS version did you experience the issue on? iOS 14.3.1 iOS 14.4.1

  3. Which Xcode version did you build the app with? Xcode 14.2 Xcode 14.3

  4. Which Cocoapods version are you using (run pod --version)? NA

  5. What device version did you see this error on? Were you using an emulator or a physical device? iPhone 11 physical device, iPhone 14 physical device

  6. What language are you using?

    • [ ] Objective C
    • [ ] Swift
    • [x] C#
  7. What third party libraries are you using? Xamarin

  8. Please enable verbose logging for your app using MSAppCenter.setLogLevel(.verbose) before your call to MSAppCenter.start(...) for Swift, or [MSAppCenter setLogLevel:MSLogLevelVerbose] before [MSAppCenter start: ...] for Objective C and include the logs here:

Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/Mono.Security.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/System.Core.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/System.Numerics.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/System.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/System.Net.Http.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/System.Drawing.Common.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/Xamarin.iOS.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/System.Xml.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/Xamarin.Forms.Platform.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/Xamarin.Forms.Core.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/System.ServiceModel.Internals.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/System.Runtime.Serialization.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/Xamarin.Forms.Platform.iOS.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/Microsoft.AppCenter.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/Microsoft.AppCenter.Analytics.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/Microsoft.AppCenter.Crashes.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/Xamarin.Forms.Xaml.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/appcenter_start_repro.dll Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/appcenter_start_repro.iOS.exe Thread started: microsoft/appcenter-sdk-apple#2 Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/netstandard.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/System.Transactions.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/System.Data.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/System.Data.DataSetExtensions.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/System.IO.Compression.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/System.IO.Compression.FileSystem.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/System.ComponentModel.Composition.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/System.Web.Services.dll [External] Loaded assembly: /private/var/containers/Bundle/Application/A8B615E6-54C3-48F1-B196-8D0C27C2B878/appcenter_start_repro.iOS.app/System.Xml.Linq.dll [External] Resolved pending breakpoint for 'appcenter_start_repro.iOS.Application.Main(System.String[])' to D:\github\appcenter-repro\src\appcenter_start_repro\appcenter_start_repro.iOS\Main.cs:14 [0x00000]. Loaded assembly: data-0x111a98000 [External] 2023-05-01 12:09:00.244 appcenter_start_repro.iOS[2562:2636828] warning: Symbol file LoadedFromMemory is not a mono symbol file

Loaded assembly: data-0x111aac000 [External] Loaded assembly: data-0x111ac0000 [External] Loaded assembly: data-0x111b10000 [External] Loaded assembly: data-0x111b20000 [External] Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointSendToIde(System.String)' to D:\a_work\1\s\HotReload\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:423 [0x00000]. Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointCheckpoint()' to D:\a_work\1\s\HotReload\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:418 [0x00000]. 2023-05-01 12:09:01.003 appcenter_start_repro.iOS[2562:2636828] 1 ##############

2023-05-01 12:09:01.034 appcenter_start_repro.iOS[2562:2636828] [AppCenterCrashes] WARNING: +[MSACErrorLogFormatter formatStackFrame:report:]/576 Cannot find image for 0x1c853cdec

2023-05-01 12:09:01.047 appcenter_start_repro.iOS[2562:2636828] [AppCenterCrashes] ERROR: +[MSACWrapperExceptionManager loadWrapperExceptionWithBaseFilename:]/139 Exception data report doesn't exist on disk. File name: 1ECCBFE5-0F19-463F-A8E7-382478A3757C 2023-05-01 12:09:01.047 appcenter_start_repro.iOS[2562:2636828] [AppCenterCrashes] ERROR: +[MSACWrapperExceptionManager loadWrapperExceptionWithBaseFilename:]/139 Exception data report doesn't exist on disk. File name: last_saved_wrapper_exception

2023-05-01 12:09:01.052 appcenter_start_repro.iOS[2562:2636828] [AppCenter] ERROR: +[MSACDBStorage executeSelectionQuery:inOpenedDatabase:result:withValues:]_block_invoke/409 Query failed with error: 5 database is locked 2023-05-01 12:09:01.052 appcenter_start_repro.iOS[2562:2636828] [AppCenter] ERROR: +[MSACDBStorage executeQuery:inOpenedDatabase:withValues:usingBlock:]/362 Failed to finalize SQLite statement, result=5 database is locked

2023-05-01 12:09:01.053 appcenter_start_repro.iOS[2562:2636889] [AppCenter] ERROR: +[MSACDBStorage executeNonSelectionQuery:inOpenedDatabase:withValues:]_block_invoke/338 Could not execute the statement, result=5 database is locked 2023-05-01 12:09:01.053 appcenter_start_repro.iOS[2562:2636889] [AppCenter] ERROR: +[MSACDBStorage executeQuery:inOpenedDatabase:withValues:usingBlock:]/362 Failed to finalize SQLite statement, result=5 database is locked 2023-05-01 12:09:01.053 appcenter_start_repro.iOS[2562:2636828] 2 ##############

Thread started: microsoft/appcenter-sdk-apple#3 Thread started: microsoft/appcenter-sdk-apple#4 Thread started: microsoft/appcenter-sdk-apple#5 Thread started: microsoft/appcenter-sdk-apple#6 2023-05-01 12:09:02.069 appcenter_start_repro.iOS[2562:2636892] [AppCenterCrashes] WARNING: +[MSACErrorLogFormatter formatStackFrame:report:]/576 Cannot find image for 0x1c853cdec

2023-05-01 12:09:02.110 appcenter_start_repro.iOS[2562:2636892] [AppCenterCrashes] ERROR: +[MSACWrapperExceptionManager loadWrapperExceptionWithBaseFilename:]/139 Exception data report doesn't exist on disk. File name: 1ECCBFE5-0F19-463F-A8E7-382478A3757C 2023-05-01 12:09:02.111 appcenter_start_repro.iOS[2562:2636892] [AppCenterCrashes] ERROR: +[MSACWrapperExceptionManager loadWrapperExceptionWithBaseFilename:]/139 Exception data report doesn't exist on disk. File name: last_saved_wrapper_exception

2023-05-01 12:09:02.111 appcenter_start_repro.iOS[2562:2636892] [AppCenterCrashes] WARNING: +[MSACErrorLogFormatter formatStackFrame:report:]/576 Cannot find image for 0x1c853cdec

2023-05-01 12:09:02.133 appcenter_start_repro.iOS[2562:2636892] [AppCenterCrashes] ERROR: +[MSACWrapperExceptionManager loadWrapperExceptionWithBaseFilename:]/139 Exception data report doesn't exist on disk. File name: 1ECCBFE5-0F19-463F-A8E7-382478A3757C

Thread started: microsoft/appcenter-sdk-apple#7 Thread started: microsoft/appcenter-sdk-apple#8 Thread started: microsoft/appcenter-sdk-apple#9 Thread started: microsoft/appcenter-sdk-apple#10 Thread started: microsoft/appcenter-sdk-apple#11 Thread started: microsoft/appcenter-sdk-apple#12 Thread started: microsoft/appcenter-sdk-apple#13 Thread started: microsoft/appcenter-sdk-apple#14 Thread started: microsoft/appcenter-sdk-apple#15 Thread started: microsoft/appcenter-sdk-apple#16 Thread started: microsoft/appcenter-sdk-apple#17

DmitriyKirakosyan commented 1 year ago

Hi @RTonnesen , thank you for reaching out and apologize for delayed reply. Also, thank you so much for providing a demo app.

It looks similar to https://github.com/microsoft/appcenter-sdk-dotnet/issues/1530 and probably to https://github.com/microsoft/appcenter-sdk-dotnet/issues/1703. We will check your demo app and update you on result.

Since it is related to the appcenter-sdk-dotnet, I'll transfer it to the proper repo.

DmitriyKirakosyan commented 1 year ago

@RTonnesen , I was not able to reproduce the issue on your demo application.

I would like to ask some additional questions:

RTonnesen commented 1 year ago

Building on Windows. Visual Studio 2022 Enterprise It's not reproducing on simulator (iPhone 14 iOS 16.2) Tried to target iOS 15. Still fails Tried AppCenter sdk 4.5.3. Also fails Haven't tried to deploy a release using AppCenter nor TestFlight

DmitriyKirakosyan commented 1 year ago

Thank you for the answers. I believe it can be happening only for windows build and debug. Should be good in release. Can you try to upload an iOS archive to App Center or TestFlight and try to download and check if the app is running without this error? Another question, if you can try to reproduce it on Mac? Do you have an access to Mac machine for building and checking the app on it?

DmitriyKirakosyan commented 1 year ago

I would also ask you to try to disable hot reload and hot restart if you are using such, and check if it helps.

WilliamWatterson86 commented 1 year ago

Experiencing this one too building iOS MAUI app with Windows machine paried to MAC.

I have hot reload and restart switched off and errors still appear.

Mittchel commented 1 year ago

Actually experiencing this running iOS MAUI App. Developing on mac.

DmitriyKirakosyan commented 1 year ago

@Mittchel , may I ask you to create a minimal demo app reproducing the issue? I'm surprised your face this building on mac.

DmitriyKirakosyan commented 8 months ago

As we do not have plans to fix this bug in the next year, I'm closing the issue. However, contributions are still welcome.