1

I’m currently developing an app and came across a few errors with healhkit. The current problem is that I get the following message

WatchKit Extension[89109:8693231] [workouts] Failed to restart task server after connection invalidation:Error Domain=com.apple.healthkit Code=3 "Task server endpoint for '304EBEF3-3D84-4E80-BDE8-BF2D7971F608' already exists" UserInfo={NSLocalizedDescription=Task server endpoint for '304EBEF3-3D84-4E80-BDE8-BF2D7971F608' already exists}

I don’t know if there are just multiple errors stemming from the same location in code or where to even find it. Can anyone shed light as to how to go upon solving this?

  • I also see this. Please let me know if you get anywhere. I believe it happens more on the simulator than on a real device. Also, I am seeing the issue when I'm _ending_ a session. My instinct is that this error message is wrong, or at best misleading. But like you I am not sure how to proceed with fixing it. I do not see it when I run the Speedy Sloth sample code, although that code doesn't include things like a route builder. – lewis Jun 09 '20 at 12:37
  • So I’ve gone through numerous forums and it seems like it’s an issue on the simulator. Idk what to do at this point since it works just fine on the actual device. – Ruben Zapata Jun 10 '20 at 02:39
  • Fingers crossed for improvements with watchOS 7 I guess... – lewis Jun 10 '20 at 08:19

1 Answers1

0

What is your code doing at the moment this error occurs. For me, i was tryin to save a Data object into a HKWorkoutEvent's metadata. turns out there are size limits to what you can store, after i minimized it this issue went away. I realize this is an old post, but thought it might help someone else debug.

Mark Perkins
  • 215
  • 1
  • 8
  • this is interesting. what size takes you over the limit? – lewis Feb 10 '23 at 15:41
  • It gave me an error of size 40 (Data), the encoded structs only stored 2 Int's in it. I was only alerted of the actual error when attempting to save it as Metadata to the workout. I got the actual 'restart task server ' error when attempting to save it to the metadata of a HKWorkoutEvent (.segment). Both errors were error code 3. ``` struct WorkoutMetadata: Codable { let maximalHeartRate: Int? let restingHeartRate: Int? } ``` – Mark Perkins Feb 11 '23 at 16:06
  • is it me, or can you not code format in comments. :/ – Mark Perkins Feb 11 '23 at 16:08