See this question for the same error. The answer there is:
This means that EVERY background task created with beginBackgroundTaskWithExpirationHandler: call MUST be ended withendBackgroundTask:. Double check that endBackgroundTask: is invoked with the correct task id.