Error in HealthKit: Error Domain=com.apple.healthkit Code=100 "Failed to open database" UserInfo= {NSLocalizedDescription=Failed to open database}
Asked Answered
E

2

4

We're getting an error on a certain few devices when trying to authorize with the HealthKit API. The call to [HKHealthStore requestAuthorizationToShareTypes:::] fails consistently with the following error and the system-generated "Allow access to Health App" modal never gets presented:

Error Domain=com.apple.healthkit Code=100 "Failed to open database" UserInfo= {NSLocalizedDescription=Failed to open database}

We have a device that is able to reproduce this consistently, even after force quitting apps and restarting the OS. The phone seems to be unable to connect to HealthKit from any and all 3rd-party apps so it seems like a bug in HealthKit, not on our side. This seems to happen only on certain devices, but there doesn't seem to be anything special about the devices (all iPhones 4s and higher running iOS 9, 9.0.1, 9.0.2, or 9.1)

My question is: Has anyone else seen this error and if so what did you do to fix or mitigate the problem?

Environment answered 25/11, 2015 at 18:7 Comment(8)
In case it's a bug in iOS itself I reported a bug (#23665462) in Apple bug radar.Environment
I have exactly the same issue as you. I also created a ticket in Apple bug Reporter #23674523.Alwyn
Does the problem go away if you reboot the devices?Ossa
Rebooting doesn't fix the problem.Environment
Apple has closed my bug as a duplicate so they aware of this issue.Alwyn
Apple has requested the HealthKit logs from the device and we just sent them. Waiting for them to look into the logs and get back to us. Will update.Environment
Any updates on this issue?Alwyn
Apple is still investigating the issue. We've gone back and forth with Apple a couple times, providing them with increasingly detailed logs from the affected device. We also tried updating the device to iOS 9.2 but there's still no solution at this time. Will update this thread when we hear back.Environment
A
3

I've got a response from Apple in my bug report ticket (for the case when device reboot fixes the problem):

The workaround is to reboot the device. A developer cannot directly work around the problem.

Alwyn answered 19/1, 2016 at 16:23 Comment(0)
E
3

This was an iOS bug and has been fixed in iOS 9.3 beta 2. Developers can download the beta build from https://developer.apple.com/ios/download/ or wait until the 9.3 update is released to everyone.

Environment answered 25/1, 2016 at 22:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.