BGContinuedProcessingTask not started after submission

hello, i have an issue spawning continued background processing tasks: they are never started, even after restarting the device, regardless of which app spawns a task. deleting and reinstalling an app, or installing a new app that didn't exist before also does not work.

it can be reproduced by setting your device local time to one year in advance and then trying to spawn the task. the task will not start and even after returning to the proper date, all apps on the device are still unable to spawn any. i also believe there are other things that trigger this issue (or something related), as many of my users have complained about tasks not starting. prior to my changing the date of my device, they worked perfectly for me. one user changed their date to test at the same time as me and the only fix they found was erasing their device and restoring a backup.

on ios 26 tasks fail silently, but on ios 27 with the new api to submit a task, an error is caught:

Error Domain=BGTaskSchedulerErrorDomain Code=1 "connection to service with pid 94 named com.apple.duetactivityscheduler" UserInfo={NSDebugDescription=connection to service with pid 94 named com.apple.duetactivityscheduler}

in addition, a more detailed error with a stack trace is logged at the same time:

<NSXPCConnection: 0x10c60c0a0> connection to service with pid 94 named com.apple.duetactivityscheduler: Exception caught during decoding of reply to message 'submitTaskRequest:withHandler:', dropping incoming message and calling failure block.

 Ignored Exception: Exception while decoding argument 0 (#1 of invocation):
 <NSInvocation: 0x10c6d72c0>
 return value: {v} void
 target: {@?} 0x0 (block)
 argument 1: {@} 0x0

 Exception: value for key 'NS.objects' was of unexpected class 'NSSet' (0x20620c358) [/System/Library/Frameworks/CoreFoundation.framework].
 Allowed classes are:
  {(
     "'NSDate' (0x20620c268) [/System/Library/Frameworks/CoreFoundation.framework]",
     "'NSError' (0x2061fd3b0) [/System/Library/Frameworks/Foundation.framework]",
     "'NSNumber' (0x2061fd478) [/System/Library/Frameworks/Foundation.framework]",
     "'NSData' (0x20620c650) [/System/Library/Frameworks/CoreFoundation.framework]",
     "'NSArray' (0x20620c6c8) [/System/Library/Frameworks/CoreFoundation.framework]",
     "'NSString' (0x2061fd428) [/System/Library/Frameworks/Foundation.framework]",
     "'NSDictionary' (0x20620c538) [/System/Library/Frameworks/CoreFoundation.framework]",
     "'NSURL' (0x20620c678) [/System/Library/Frameworks/CoreFoundation.framework]"
 )}
 (
     0   CoreFoundation                      0x000000019fbc2e0c 43092235-E272-3CAF-B9AE-76669EC5AE46 + 622092
     1   libobjc.A.dylib                     0x000000019f940298 objc_exception_throw + 88
     2   Foundation                          0x00000001a002beac E642F95D-61DA-3E8C-A2D2-CFEB7F7B688B + 126636
     3   Foundation                          0x00000001a0035090 E642F95D-61DA-3E8C-A2D2-CFEB7F7B688B + 163984
     ...

it can be reproduced by setting your device local time to one year in advance and then trying to spawn the task. the task will not start and even after returning to the proper date, all apps on the device are still unable to spawn any.

Have you filed a bug on this and, if so, what's the bug number?

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

i just filed FB23894499

Please reproduce the issue (the job failing to start) "a few times", wait a few minutes, then trigger a sysdiagnose and upload it to your bug, then let me know once it's uploaded.

Also, I'd recommend avoiding comment and just posting any reply as a standard reply post. Frankly, comments just don't work very well.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

BGContinuedProcessingTask not started after submission
 
 
Q