deltachat-ios icon indicating copy to clipboard operation
deltachat-ios copied to clipboard

Device Update path

Open cyBerta opened this issue 2 years ago • 13 comments

When a user tries to transfer the device data from the one to another device (to setup the 2. device), Delta Chat fails to run on the second device after the transfer finished.

  • things to doublecheck:
  • [ ] keychain data
  • [ ] shared data between app and share extension
  • [ ] database
  • [ ] blobs

cyBerta avatar Dec 05 '22 15:12 cyBerta

I've been trying to reproduce that error. I updated from an iphone 7, ios 15, to an iPhone 8 running ios 16.0.3 (20A329). Whereas other apps have been transferred to the new phone, delta chat wasn't transferred at all. That's different to what other users experienced in the past, maybe on earlier iOS versions.

cyBerta avatar Dec 19 '22 17:12 cyBerta

Ok, after manually installing Delta Chat the app crashes as other users also reported.

the crash log:


Incident Identifier: 533A29AA-004B-459A-A335-DDA77AF4E7CC
CrashReporter Key:   3f931b6b0b6abdea801ed980919908fd3f1173be
Hardware Model:      iPhone10,1
Process:             deltachat-ios [1075]
Path:                /private/var/containers/Bundle/Application/78EC6E91-BD62-419B-A75F-DC3ECD60576C/deltachat-ios.app/deltachat-ios
Identifier:          chat.delta
Version:             1.34.1 (77)
AppStoreTools:       14A305
AppVariant:          1:iPhone10,1:15
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           chat.delta [1340]

Date/Time:           2022-12-19 19:14:35.6167 +0100
Launch Time:         2022-12-19 19:14:35.4395 +0100
OS Version:          iPhone OS 16.0.3 (20A392)
Release Type:        User
Baseband Version:    8.04.01
Report Version:      104

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001d9b40990
Termination Reason: SIGNAL 5 Trace/BPT trap: 5
Terminating Process: exc handler [1075]

Triggered by Thread:  0

Thread 0 name:   Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libswiftCore.dylib            	       0x1d9b40990 _assertionFailure(_:_:file:line:flags:) + 308
1   libswiftCore.dylib            	       0x1d9b40990 _assertionFailure(_:_:file:line:flags:) + 308
2   deltachat-ios                 	       0x1045499b0 0x10449c000 + 711088
3   deltachat-ios                 	       0x1045500e4 0x10449c000 + 737508
4   deltachat-ios                 	       0x1045489e4 0x10449c000 + 707044
5   UIKitCore                     	       0x1e1e51260 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 296
6   UIKitCore                     	       0x1e1e509a4 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 2776
7   UIKitCore                     	       0x1e1e4f9d8 -[UIApplication _runWithMainScene:transitionContext:completion:] + 852
8   UIKitCore                     	       0x1e1e4f638 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 128
9   UIKitCore                     	       0x1e1bb5fbc _UIScenePerformActionsWithLifecycleActionMask + 92
10  UIKitCore                     	       0x1e1ecfe40 __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 188
11  UIKitCore                     	       0x1e1d90878 -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 212
12  UIKitCore                     	       0x1e1d906a8 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 588
13  UIKitCore                     	       0x1e1d90278 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 248
14  UIKitCore                     	       0x1e1d90158 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 140
15  UIKitCore                     	       0x1e2402260 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:fromCurrentState:actions:completion:] + 656
16  UIKitCore                     	       0x1e248ff4c _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion + 196
17  UIKitCore                     	       0x1e1c4d3c8 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 288
18  UIKitCore                     	       0x1e2082ca0 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.190 + 552
19  UIKitCore                     	       0x1e1d15514 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 208
20  UIKitCore                     	       0x1e1d153a8 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 220
21  UIKitCore                     	       0x1e1d14914 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 496
22  UIKitCore                     	       0x1e1d146b8 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 260
23  FrontBoardServices            	       0x1f3f3eec0 -[FBSScene _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 316
24  FrontBoardServices            	       0x1f3f7898c __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke.59 + 92
25  FrontBoardServices            	       0x1f3f42864 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 160
26  FrontBoardServices            	       0x1f3f78614 __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke + 296
27  libdispatch.dylib             	       0x1e67d77c8 _dispatch_client_callout + 16
28  libdispatch.dylib             	       0x1e67af408 _dispatch_block_invoke_direct$VARIANT$armv81 + 212
29  FrontBoardServices            	       0x1f3f4c05c __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 44
30  FrontBoardServices            	       0x1f3f4bc98 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 176
31  FrontBoardServices            	       0x1f3f4e15c -[FBSSerialQueue _performNextFromRunLoopSource] + 24
32  CoreFoundation                	       0x1dad05500 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
33  CoreFoundation                	       0x1dad10e70 __CFRunLoopDoSource0 + 172
34  CoreFoundation                	       0x1dac9b224 __CFRunLoopDoSources0 + 232
35  CoreFoundation                	       0x1dacb0230 __CFRunLoopRun + 780
36  CoreFoundation                	       0x1dacb4dfc CFRunLoopRunSpecific + 584
37  GraphicsServices              	       0x214b66984 GSEventRunModal + 160
38  UIKitCore                     	       0x1e1e94e7c -[UIApplication _run] + 868
39  UIKitCore                     	       0x1e1e94af4 UIApplicationMain + 312
40  deltachat-ios                 	       0x1044a1a70 0x10449c000 + 23152
41  dyld                          	       0x1fc36ede0 start + 2080

Thread 1 name:  DBDebugToolkit stderr reading thread
Thread 1:
0   libsystem_kernel.dylib        	       0x21812a194 mach_msg2_trap + 8
1   libsystem_kernel.dylib        	       0x21813ba08 mach_msg2_internal + 76
2   libsystem_kernel.dylib        	       0x21813bc44 mach_msg_overwrite + 384
3   libsystem_kernel.dylib        	       0x21812a688 mach_msg + 20
4   CoreFoundation                	       0x1dacaf244 __CFRunLoopServiceMachPort + 156
5   CoreFoundation                	       0x1dacb03f4 __CFRunLoopRun + 1232
6   CoreFoundation                	       0x1dacb4dfc CFRunLoopRunSpecific + 584
7   Foundation                    	       0x1da0173fc -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 208
8   Foundation                    	       0x1da0172a8 -[NSRunLoop(NSRunLoop) run] + 60
9   DBDebugToolkit                	       0x104790960 +[DBConsoleOutputCaptor runStderrReadingThread] + 156
10  Foundation                    	       0x1da02ef44 __NSThread__start__ + 704
11  libsystem_pthread.dylib       	       0x226cf2060 _pthread_start + 116
12  libsystem_pthread.dylib       	       0x226cf0688 thread_start + 8

Thread 2 name:   Dispatch queue: AXCodeLoader
Thread 2:
0   libobjc.A.dylib               	       0x1d90bac68 objc_retain + 24
1   AccessibilityUtilities        	       0x1e86f8408 -[AXCodeLoader _accessibilityCodeItemMatchingName:type:path:] + 468
2   AccessibilityUtilities        	       0x1e86f86c8 -[AXCodeLoader _associateAccessibilityCodeItemWithLoadedCodeItem:] + 296
3   AccessibilityUtilities        	       0x1e86f669c __36-[AXCodeLoader _addTrackedCodeItem:]_block_invoke + 248
4   libdispatch.dylib             	       0x1e67d6850 _dispatch_call_block_and_release + 24
5   libdispatch.dylib             	       0x1e67d77c8 _dispatch_client_callout + 16
6   libdispatch.dylib             	       0x1e67b2854 _dispatch_lane_serial_drain$VARIANT$armv81 + 604
7   libdispatch.dylib             	       0x1e67b32e4 _dispatch_lane_invoke$VARIANT$armv81 + 380
8   libdispatch.dylib             	       0x1e67bd000 _dispatch_workloop_worker_thread + 612
9   libsystem_pthread.dylib       	       0x226cf0b50 _pthread_wqthread + 284
10  libsystem_pthread.dylib       	       0x226cf067c start_wqthread + 8

Thread 3 name:   Dispatch queue: com.apple.UIKit.KeyboardManagement
Thread 3:
0   libsystem_kernel.dylib        	       0x21812ac34 __ulock_wait + 8
1   libdispatch.dylib             	       0x1e67a728c _dlock_wait + 52
2   libdispatch.dylib             	       0x1e67a7074 _dispatch_thread_event_wait_slow$VARIANT$armv81 + 52
3   libdispatch.dylib             	       0x1e67b9e00 __DISPATCH_WAIT_FOR_QUEUE__ + 340
4   libdispatch.dylib             	       0x1e67b9a00 _dispatch_sync_f_slow + 136
5   UIKitCore                     	       0x1e1e950ec __37-[_UIRemoteKeyboards startConnection]_block_invoke_3 + 128
6   CoreFoundation                	       0x1daca9070 __invoking___ + 144
7   CoreFoundation                	       0x1dac58868 -[NSInvocation invoke] + 276
8   Foundation                    	       0x1da070e50 __NSXPCCONNECTION_IS_CALLING_OUT_TO_REPLY_BLOCK__ + 12
9   Foundation                    	       0x1da045140 -[NSXPCConnection _decodeAndInvokeReplyBlockWithEvent:sequence:replyInfo:] + 484
10  Foundation                    	       0x1da58a1a4 __88-[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:]_block_invoke_5 + 184
11  libxpc.dylib                  	       0x226d52188 _xpc_connection_reply_callout + 60
12  libxpc.dylib                  	       0x226d46094 _xpc_connection_call_reply_async + 76
13  libdispatch.dylib             	       0x1e67d7840 _dispatch_client_callout3 + 16
14  libdispatch.dylib             	       0x1e67abca0 _dispatch_mach_msg_async_reply_invoke$VARIANT$armv81 + 340
15  libdispatch.dylib             	       0x1e67b272c _dispatch_lane_serial_drain$VARIANT$armv81 + 308
16  libdispatch.dylib             	       0x1e67b3318 _dispatch_lane_invoke$VARIANT$armv81 + 432
17  libdispatch.dylib             	       0x1e67bd000 _dispatch_workloop_worker_thread + 612
18  libsystem_pthread.dylib       	       0x226cf0b50 _pthread_wqthread + 284
19  libsystem_pthread.dylib       	       0x226cf067c start_wqthread + 8

Thread 4:
0   libsystem_pthread.dylib       	       0x226cf0674 start_wqthread + 0

Thread 5 name:  com.apple.uikit.eventfetch-thread
Thread 5:
0   libsystem_kernel.dylib        	       0x21812a194 mach_msg2_trap + 8
1   libsystem_kernel.dylib        	       0x21813ba08 mach_msg2_internal + 76
2   libsystem_kernel.dylib        	       0x21813bc44 mach_msg_overwrite + 384
3   libsystem_kernel.dylib        	       0x21812a688 mach_msg + 20
4   CoreFoundation                	       0x1dacaf244 __CFRunLoopServiceMachPort + 156
5   CoreFoundation                	       0x1dacb03f4 __CFRunLoopRun + 1232
6   CoreFoundation                	       0x1dacb4dfc CFRunLoopRunSpecific + 584
7   Foundation                    	       0x1da0173fc -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 208
8   Foundation                    	       0x1da0172f8 -[NSRunLoop(NSRunLoop) runUntilDate:] + 60
9   UIKitCore                     	       0x1e1fb96d0 -[UIEventFetcher threadMain] + 424
10  Foundation                    	       0x1da02ef44 __NSThread__start__ + 704
11  libsystem_pthread.dylib       	       0x226cf2060 _pthread_start + 116
12  libsystem_pthread.dylib       	       0x226cf0688 thread_start + 8

Thread 6 name:   Dispatch queue: com.apple.root.default-qos
Thread 6:
0   libsystem_kernel.dylib        	       0x21812ac34 __ulock_wait + 8
1   libdispatch.dylib             	       0x1e67a728c _dlock_wait + 52
2   libdispatch.dylib             	       0x1e67a7074 _dispatch_thread_event_wait_slow$VARIANT$armv81 + 52
3   libdispatch.dylib             	       0x1e67b9e00 __DISPATCH_WAIT_FOR_QUEUE__ + 340
4   libdispatch.dylib             	       0x1e67b9a00 _dispatch_sync_f_slow + 136
5   AXCoreUtilities               	       0x1ea0343e4 AXPerformBlockSynchronouslyOnMainThread + 100
6   AccessibilityUtilities        	       0x1e870fed0 ___AXSharedDisplayManager_block_invoke_2 + 36
7   libdispatch.dylib             	       0x1e67d6850 _dispatch_call_block_and_release + 24
8   libdispatch.dylib             	       0x1e67d77c8 _dispatch_client_callout + 16
9   libdispatch.dylib             	       0x1e67aeb2c _dispatch_queue_override_invoke + 708
10  libdispatch.dylib             	       0x1e67bbd48 _dispatch_root_queue_drain + 328
11  libdispatch.dylib             	       0x1e67bc514 _dispatch_worker_thread2 + 160
12  libsystem_pthread.dylib       	       0x226cf0b14 _pthread_wqthread + 224
13  libsystem_pthread.dylib       	       0x226cf067c start_wqthread + 8

Thread 7:
0   libsystem_pthread.dylib       	       0x226cf0674 start_wqthread + 0

Thread 8:
0   libsystem_pthread.dylib       	       0x226cf0674 start_wqthread + 0

Thread 9:
0   libsystem_pthread.dylib       	       0x226cf0674 start_wqthread + 0

Thread 10:
0   libsystem_pthread.dylib       	       0x226cf0674 start_wqthread + 0

Thread 11 name:  tokio-runtime-worker
Thread 11:
0   libsystem_kernel.dylib        	       0x21812a9e0 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x226cf1584 _pthread_cond_wait$VARIANT$armv81 + 1220
2   DcCore                        	       0x10547aecc tokio::runtime::thread_pool::worker::Context::park_timeout::h7641a4d288e969df + 1044
3   DcCore                        	       0x10547a638 tokio::runtime::thread_pool::worker::run::h5d7bf38157851cf6 + 3284
4   DcCore                        	       0x1054833ec tokio::runtime::task::raw::poll::h65bd220eac13ee8a + 208
5   DcCore                        	       0x1054881bc std::sys_common::backtrace::__rust_begin_short_backtrace::h9d6041a79d18621e + 464
6   DcCore                        	       0x105488ca4 core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h93d8331d1c381f93 + 152
7   DcCore                        	       0x1054762d0 std::sys::unix::thread::Thread::new::thread_start::hf90dfc7059d4b06a + 36
8   libsystem_pthread.dylib       	       0x226cf2060 _pthread_start + 116
9   libsystem_pthread.dylib       	       0x226cf0688 thread_start + 8

Thread 12 name:  tokio-runtime-worker
Thread 12:
0   libsystem_kernel.dylib        	       0x21812b964 kevent + 8
1   DcCore                        	       0x105489530 tokio::io::driver::Driver::turn::h1ab3f0de059d74d7 + 648
2   DcCore                        	       0x105481364 tokio::time::driver::Driver$LT$P$GT$::park_internal::hafef5b6369af9df1 + 916
3   DcCore                        	       0x10547af60 tokio::runtime::thread_pool::worker::Context::park_timeout::h7641a4d288e969df + 1192
4   DcCore                        	       0x10547a638 tokio::runtime::thread_pool::worker::run::h5d7bf38157851cf6 + 3284
5   DcCore                        	       0x1054833ec tokio::runtime::task::raw::poll::h65bd220eac13ee8a + 208
6   DcCore                        	       0x1054881bc std::sys_common::backtrace::__rust_begin_short_backtrace::h9d6041a79d18621e + 464
7   DcCore                        	       0x105488ca4 core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h93d8331d1c381f93 + 152
8   DcCore                        	       0x1054762d0 std::sys::unix::thread::Thread::new::thread_start::hf90dfc7059d4b06a + 36
9   libsystem_pthread.dylib       	       0x226cf2060 _pthread_start + 116
10  libsystem_pthread.dylib       	       0x226cf0688 thread_start + 8

Thread 13 name:  tokio-runtime-worker
Thread 13:
0   libsystem_kernel.dylib        	       0x21812a9e0 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x226cf1584 _pthread_cond_wait$VARIANT$armv81 + 1220
2   DcCore                        	       0x10547aecc tokio::runtime::thread_pool::worker::Context::park_timeout::h7641a4d288e969df + 1044
3   DcCore                        	       0x10547a638 tokio::runtime::thread_pool::worker::run::h5d7bf38157851cf6 + 3284
4   DcCore                        	       0x1054833ec tokio::runtime::task::raw::poll::h65bd220eac13ee8a + 208
5   DcCore                        	       0x1054881bc std::sys_common::backtrace::__rust_begin_short_backtrace::h9d6041a79d18621e + 464
6   DcCore                        	       0x105488ca4 core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h93d8331d1c381f93 + 152
7   DcCore                        	       0x1054762d0 std::sys::unix::thread::Thread::new::thread_start::hf90dfc7059d4b06a + 36
8   libsystem_pthread.dylib       	       0x226cf2060 _pthread_start + 116
9   libsystem_pthread.dylib       	       0x226cf0688 thread_start + 8

Thread 14 name:  tokio-runtime-worker
Thread 14:
0   libsystem_kernel.dylib        	       0x21812a9e0 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x226cf1584 _pthread_cond_wait$VARIANT$armv81 + 1220
2   DcCore                        	       0x10547aecc tokio::runtime::thread_pool::worker::Context::park_timeout::h7641a4d288e969df + 1044
3   DcCore                        	       0x10547a638 tokio::runtime::thread_pool::worker::run::h5d7bf38157851cf6 + 3284
4   DcCore                        	       0x1054833ec tokio::runtime::task::raw::poll::h65bd220eac13ee8a + 208
5   DcCore                        	       0x1054881bc std::sys_common::backtrace::__rust_begin_short_backtrace::h9d6041a79d18621e + 464
6   DcCore                        	       0x105488ca4 core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h93d8331d1c381f93 + 152
7   DcCore                        	       0x1054762d0 std::sys::unix::thread::Thread::new::thread_start::hf90dfc7059d4b06a + 36
8   libsystem_pthread.dylib       	       0x226cf2060 _pthread_start + 116
9   libsystem_pthread.dylib       	       0x226cf0688 thread_start + 8

Thread 15 name:  tokio-runtime-worker
Thread 15:
0   libsystem_kernel.dylib        	       0x21812a9e0 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x226cf1584 _pthread_cond_wait$VARIANT$armv81 + 1220
2   DcCore                        	       0x10547aecc tokio::runtime::thread_pool::worker::Context::park_timeout::h7641a4d288e969df + 1044
3   DcCore                        	       0x10547a638 tokio::runtime::thread_pool::worker::run::h5d7bf38157851cf6 + 3284
4   DcCore                        	       0x1054833ec tokio::runtime::task::raw::poll::h65bd220eac13ee8a + 208
5   DcCore                        	       0x1054881bc std::sys_common::backtrace::__rust_begin_short_backtrace::h9d6041a79d18621e + 464
6   DcCore                        	       0x105488ca4 core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h93d8331d1c381f93 + 152
7   DcCore                        	       0x1054762d0 std::sys::unix::thread::Thread::new::thread_start::hf90dfc7059d4b06a + 36
8   libsystem_pthread.dylib       	       0x226cf2060 _pthread_start + 116
9   libsystem_pthread.dylib       	       0x226cf0688 thread_start + 8

Thread 16 name:  tokio-runtime-worker
Thread 16:
0   libsystem_kernel.dylib        	       0x21812a9e0 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x226cf1584 _pthread_cond_wait$VARIANT$armv81 + 1220
2   DcCore                        	       0x10547aecc tokio::runtime::thread_pool::worker::Context::park_timeout::h7641a4d288e969df + 1044
3   DcCore                        	       0x10547a638 tokio::runtime::thread_pool::worker::run::h5d7bf38157851cf6 + 3284
4   DcCore                        	       0x1054833ec tokio::runtime::task::raw::poll::h65bd220eac13ee8a + 208
5   DcCore                        	       0x1054881bc std::sys_common::backtrace::__rust_begin_short_backtrace::h9d6041a79d18621e + 464
6   DcCore                        	       0x105488ca4 core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h93d8331d1c381f93 + 152
7   DcCore                        	       0x1054762d0 std::sys::unix::thread::Thread::new::thread_start::hf90dfc7059d4b06a + 36
8   libsystem_pthread.dylib       	       0x226cf2060 _pthread_start + 116
9   libsystem_pthread.dylib       	       0x226cf0688 thread_start + 8

Thread 17 name:  tokio-runtime-worker
Thread 17:
0   libsystem_kernel.dylib        	       0x21812a9e0 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x226cf1584 _pthread_cond_wait$VARIANT$armv81 + 1220
2   DcCore                        	       0x10544ba98 std::sys::unix::locks::pthread_condvar::Condvar::wait_timeout::hc3bc092ab2e30ffd + 252
3   DcCore                        	       0x10548812c std::sys_common::backtrace::__rust_begin_short_backtrace::h9d6041a79d18621e + 320
4   DcCore                        	       0x105488ca4 core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h93d8331d1c381f93 + 152
5   DcCore                        	       0x1054762d0 std::sys::unix::thread::Thread::new::thread_start::hf90dfc7059d4b06a + 36
6   libsystem_pthread.dylib       	       0x226cf2060 _pthread_start + 116
7   libsystem_pthread.dylib       	       0x226cf0688 thread_start + 8


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x80000001045decb0   x1: 0x00000002800a63c0   x2: 0x0000000000000003   x3: 0x00000001ed02196c
    x4: 0x0000000000000000   x5: 0x000000016b961020   x6: 0x000000000000002e   x7: 0x0000000000000001
    x8: 0x0000000091e52092   x9: 0x00000000000000ff  x10: 0x0000000000000090  x11: 0x00000000000007fb
   x12: 0x00000000000007fd  x13: 0x0000000091e52092  x14: 0x0000000092052800  x15: 0x0000000000052800
   x16: 0x0000000012000000  x17: 0x020000010fa90cb8  x18: 0x0000000000000000  x19: 0x80000001045decb0
   x20: 0x0000000000000002  x21: 0x0000000000000000  x22: 0x000000000000001f  x23: 0x00000001045deb40
   x24: 0xd000000000000023  x25: 0x00000001045deb60  x26: 0x000000000000000b  x27: 0x0000000104624000
   x28: 0x0000000000000000   fp: 0x000000016b961170   lr: 0x00000001d9b40990
    sp: 0x000000016b9610f0   pc: 0x00000001d9b40990 cpsr: 0x60000000
   far: 0x0000000000000000  esr: 0xf2000001 (Breakpoint) brk 1

Binary Images:
       0x1d9b11000 -        0x1d9fa7fff libswiftCore.dylib arm64  <8dcb0a7edf943124bfdb5ce864e65783> /usr/lib/swift/libswiftCore.dylib
       0x10449c000 -        0x10460bfff deltachat-ios arm64  <646fee3043b63cd19fd82b161bf57f4a> /private/var/containers/Bundle/Application/78EC6E91-BD62-419B-A75F-DC3ECD60576C/deltachat-ios.app/deltachat-ios
       0x1e1b1e000 -        0x1e31d8fff UIKitCore arm64  <0a5f2ff1a67f3263bafc1224b1501a17> /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
       0x1f3f3c000 -        0x1f3fd5fff FrontBoardServices arm64  <1d4fcc48526633328d8bb80f7f904ab7> /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices
       0x1e6773000 -        0x1e67f6fff libdispatch.dylib arm64  <abe14ca70020314dbba65f92f0bbb1c4> /usr/lib/system/libdispatch.dylib
       0x1dac39000 -        0x1db004fff CoreFoundation arm64  <5f4831c9494934eab3733f45c312b753> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
       0x214b65000 -        0x214b6dfff GraphicsServices arm64  <df370b2c9baa33c8ba00b54d2f4538dc> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
       0x1fc35b000 -        0x1fc3d4dcb dyld arm64  <761f47f5a57031c3ac49af3ded335020> /usr/lib/dyld
       0x218129000 -        0x21815efef libsystem_kernel.dylib arm64  <146974c516ed354ab334ee8730c3b715> /usr/lib/system/libsystem_kernel.dylib
       0x1d9fd9000 -        0x1da885fff Foundation arm64  <0b0d93617efa31da95246f4a7412b618> /System/Library/Frameworks/Foundation.framework/Foundation
       0x104788000 -        0x1047d7fff DBDebugToolkit arm64  <ecb2689210e63793a959f8f8cb8a7684> /private/var/containers/Bundle/Application/78EC6E91-BD62-419B-A75F-DC3ECD60576C/deltachat-ios.app/Frameworks/DBDebugToolkit.framework/DBDebugToolkit
       0x226cef000 -        0x226cfffff libsystem_pthread.dylib arm64  <ad80420a2ce3395ebfe7386912138296> /usr/lib/system/libsystem_pthread.dylib
       0x1d90b8000 -        0x1d90f2c9f libobjc.A.dylib arm64  <661c3febed903377864fe35f30e1e644> /usr/lib/libobjc.A.dylib
       0x1e866b000 -        0x1e8819fff AccessibilityUtilities arm64  <d9d792fcdd6d350aa0e9fcc30650e3cc> /System/Library/PrivateFrameworks/AccessibilityUtilities.framework/AccessibilityUtilities
       0x226d37000 -        0x226d72fff libxpc.dylib arm64  <592d878ed8943072b53753df337ee47d> /usr/lib/system/libxpc.dylib
       0x1ea032000 -        0x1ea052fff AXCoreUtilities arm64  <cb4fa8b4e87d331782298ac2268d2d5b> /System/Library/PrivateFrameworks/AXCoreUtilities.framework/AXCoreUtilities
       0x104db0000 -        0x1059c3fff DcCore arm64  <cdcb443cccc5395f80d86c7f72f4cb55> /private/var/containers/Bundle/Application/78EC6E91-BD62-419B-A75F-DC3ECD60576C/deltachat-ios.app/Frameworks/DcCore.framework/DcCore

EOF

cyBerta avatar Dec 19 '22 18:12 cyBerta

that shows the logcat:

default	19:15:45.224905+0100	deltachat-ios	deltachat_ios/AppDelegate.swift:112: Fatal error: Could not initialize a new account.

cyBerta avatar Dec 19 '22 20:12 cyBerta

further debugging leads to the conclusion that openening the database fails. while obtaining the container url succeeds

if var sharedDbLocation = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: applicationGroupIdentifier) { ...

access to the container seems to be forbidden.

accountsPointer = dc_accounts_new("iOS\(version)", sharedDbLocation.path)

fails with

failed to create accounts: failed to load accounts: failed to create context from file "/private/var/mobile/Containers/Shared/AppGroup/6A117DDC-D16B-4F4F-BACB-8FB6F8A45EFD/accounts/db3adcee-7a4f-49a3-8739-1abbf4d35178/dc.db": Operation not permitted (os error 1)

cyBerta avatar Dec 19 '22 22:12 cyBerta

interestingly it is possible to create new files in exact that container. I've added the following snipped to DcAccounts.openDatabase() to prove that.

let str = "Hello World 123"
let filename = sharedDbLocation.appendingPathComponent("out.txt")
do {
    try str.write(to: filename, atomically: true, encoding: String.Encoding.utf8)
} catch {
    logger?.error("failed to create text file \(sharedDbLocation.appendingPathComponent("out.txt"))")
}

Also all files seem to be transferred to the new device. However the database seems to reside in the wrong container. I printed out all files with the following snippet:

if let enumerator = FileManager.default.enumerator(at: sharedDbLocation, includingPropertiesForKeys: [.isRegularFileKey], options: [.skipsHiddenFiles, .skipsPackageDescendants]) {
                for case let fileURL as URL in enumerator {
                    do {
                        let fileAttributes = try fileURL.resourceValues(forKeys: [.isRegularFileKey])
                        if fileAttributes.isRegularFile! {
                            logger?.debug(fileURL.relativeString)
                        }
                    } catch { logger?.error(error, fileURL) }
                }
            }
17:41:24:873 💚  file:///private/var/mobile/Containers/Shared/AppGroup/84AD5935-8968-456E-AB9F-641D131B336F/accounts/out.txt
...
file:///private/var/mobile/Containers/Shared/AppGroup/84AD5935-8968-456E-AB9F-641D131B336F/accounts/db3adcee-7a4f-49a3-8739-1abbf4d35178/dc.db-blobs/image_2022-02-19_21-33-08.jpg
17:41:31:573 💚  file:///private/var/mobile/Containers/Shared/AppGroup/84AD5935-8968-456E-AB9F-641D131B336F/accounts/db3adcee-7a4f-49a3-8739-1abbf4d35178/dc.db-shm

The database itself is not listed and the earlier mentioned error log gives a hint where the db can be found instead:

failed to create accounts: failed to load accounts: failed to create context from file "/private/var/mobile/Containers/Shared/AppGroup/6A117DDC-D16B-4F4F-BACB-8FB6F8A45EFD/accounts/db3adcee-7a4f-49a3-8739-1abbf4d35178/dc.db": Operation not permitted (os error 1)

so while almost all app data is in the container 84AD5935-8968-456E-AB9F-641D131B336F, the db is here6A117DDC-D16B-4F4F-BACB-8FB6F8A45EFD

I've been running these code snippets on the source phone and apparantly the container name 6A117DDC-D16B-4F4F-BACB-8FB6F8A45EFD originates from the old device!

What I did next is to compare the parameter put into core's dc_accounts_new and in fact we pass the correct container ID (in my case 84AD5935-8968-456E-AB9F-641D131B336F). That leads to the conclusion that core persists the database path and uses the cached one instead of the passed one.

cyBerta avatar Dec 20 '22 16:12 cyBerta

accounts.toml seems to be the candidate, that caches the path to the database:

selected_account = 6
next_id = 49

[[accounts]]
id = 6
dir = '/private/var/mobile/Containers/Shared/AppGroup/6A117DDC-D16B-4F4F-BACB-8FB6F8A45EFD/accounts/db3adcee-7a4f-49a3-8739-1abbf4d35178'
uuid = 'db3adcee-7a4f-49a3-8739-1abbf4d35178'
...

Instead of keeping the absolute path to the accounts directory, the toml should only keep the relative path, if possible.

cyBerta avatar Dec 20 '22 18:12 cyBerta

thanks a lot for diving so deep! 🤿

r10s avatar Dec 20 '22 18:12 r10s

how does apple restore the apps on the new device? if by downloading from app store, it is probably not easy to test before shipping a version which includes https://github.com/deltachat/deltachat-core-rust/pull/3838 - but maybe things are different and testing is easy?

r10s avatar Dec 20 '22 19:12 r10s

Most apps automatically got installed - except for Delta Chat (or maybe it just took very long until the app icon appeared, because of the big database I have). I went to the app store to get delta chat. But I can retry with a little bit more patience

cyBerta avatar Dec 21 '22 22:12 cyBerta

@r10s I've retested the device switch with 1.38.4 and the issue persists with current installations. Apparently a toml file migration is missing for existing installations?

cyBerta avatar Jan 09 '23 15:01 cyBerta

EDIT: ftr: this is the corresponding core issue: https://github.com/deltachat/deltachat-core-rust/issues/3936

r10s avatar Jan 09 '23 16:01 r10s

@cyBerta what is the current state of this issue, did you try over with recent core including the https://github.com/deltachat/deltachat-core-rust/issues/3936 fix?

r10s avatar Feb 07 '23 11:02 r10s

ping

r10s avatar May 18 '23 09:05 r10s

very probably fixed by https://github.com/deltachat/deltachat-core-rust/pull/5613 - it is a bit hard to reproduce, but that sounds like a real match and we did not got recent reports about failures here.

still i find it weird that apple assigns new UUID on transferring data to other devices, this is a call for troubles. i am pretty sure there are much more apps that have issues with that as somewhere absolute paths are used.

r10s avatar Oct 17 '24 10:10 r10s