Confluence SDK scheduled task

We developed a plugin using the confluence sdk, and have implemented our own custom scheduled task, and occaisonally we run into an error where the scheduled task returns the following error:

Error: `No content to map due to end-of-input
 at [Source: (String)""; line: 1, column: 0]`
com.fasterxml.jackson.databind.exc.MismatchedInputException: No content to map due to end-of-input
 at [Source: (String)""; line: 1, column: 0]
    at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59)
    at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:4765)
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4667)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3629)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3612)
    at agents.plugin.confluence.usercleanup.impl.UserCollectionKt.getUsersFromUserCollection(UserCollection.kt:40)
    at agents.plugin.confluence.usercleanup.impl.JobRunner.runJob(JobRunner.kt:45)
    at com.atlassian.confluence.impl.schedule.caesium.JobRunnerWrapper.doRunJob(JobRunnerWrapper.java:117)
    at com.atlassian.confluence.impl.schedule.caesium.JobRunnerWrapper.lambda$runJob$0(JobRunnerWrapper.java:87)
    at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContextInternal(VCacheRequestContextManager.java:84)
    at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContext(VCacheRequestContextManager.java:68)
    at com.atlassian.confluence.impl.schedule.caesium.JobRunnerWrapper.runJob(JobRunnerWrapper.java:87)
    at com.atlassian.scheduler.core.JobLauncher.runJob(JobLauncher.java:134)
    at com.atlassian.scheduler.core.JobLauncher.launchAndBuildResponse(JobLauncher.java:106)
    at com.atlassian.scheduler.core.JobLauncher.launch(JobLauncher.java:90)
    at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.launchJob(CaesiumSchedulerService.java:464)
    at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeLocalJob(CaesiumSchedulerService.java:431)
    at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeQueuedJob(CaesiumSchedulerService.java:409)
    at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.executeJob(SchedulerQueueWorker.java:66)
    at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.executeNextJob(SchedulerQueueWorker.java:60)
    at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.run(SchedulerQueueWorker.java:35)
    at java.base/java.lang.Thread.run(Thread.java:829)

if we manually trigger the custom scheduled job from the Configuration >> Scheduled Jobs screen and click the “run” button our custom plugin works and executes fine without that error, it only returns that error when the scheduler is trying to execute it.

we are running confluence 7.19.1, and we have an experiment with a datacenter instance running the same version and we see the same result between server and datacenter.

Our Job Runner code is as follows:

package agents.plugin.confluence.usercleanup.impl

import agents.plugin.confluence.usercleanup.servlet.ConfigResource
import agents.plugin.confluence.usercleanup.utils.sendWebhook
import com.atlassian.confluence.security.login.LoginManager
import com.atlassian.confluence.user.UserAccessor
import com.atlassian.plugin.spring.scanner.annotation.export.ExportAsService
import com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport
import com.atlassian.sal.api.pluginsettings.PluginSettings
import com.atlassian.sal.api.pluginsettings.PluginSettingsFactory
import com.atlassian.scheduler.JobRunnerRequest
import com.atlassian.scheduler.JobRunnerResponse
import org.slf4j.LoggerFactory
import java.util.*
import javax.inject.Inject
import javax.inject.Named


@ExportAsService(JobRunner::class)
@Named("myJobRunner")
class JobRunner @Inject constructor(
    @ComponentImport val userAccessor: UserAccessor,
    @ComponentImport val loginManager: LoginManager,
    @ComponentImport private val pluginSettingsFactory: PluginSettingsFactory) : com.atlassian.scheduler.JobRunner {



    override fun runJob(var1: JobRunnerRequest?): JobRunnerResponse {
        // Get config values
        val settings: PluginSettings = pluginSettingsFactory.createGlobalSettings()
        val webhookUrl = settings.get(ConfigResource::class.java.toString() + ".webhook") as? String
        val entitlements = settings.get(ConfigResource::class.java.toString() + ".entitlements") as? String ?: "entitlement-name"
        val daysToStale = settings.get(ConfigResource::class.java.toString() + ".staledays") as? String ?: "180"
        val adminUsername = settings.get(ConfigResource::class.java.toString() + ".username") as? String ?: "admin-name"
        val userCountThreshold = settings.get(ConfigResource::class.java.toString() + ".usercount") as? String ?: "500"

        if (webhookUrl == null || webhookUrl.isBlank()) {
            return JobRunnerResponse.failed("There was no webhook specified. Please contact the administrators to resolve this issue.")
        }

        sendWebhook("User Cleanup job started at ${Date()}", webhookUrl=webhookUrl)

        try {
            // get users with the entitlement
            val userCollectionUsers = getUsersFromUserCollection(entitlements = entitlements)
            if (userCollectionUsers.count() > userCountThreshold.toInt())
                ConfluenceCleanup(
                    authorizedUsers = userCollectionUsers,
                    userAccessor = userAccessor,
                    loginManager = loginManager,
                    daysToStale = daysToStale,
                    adminUsername = adminUsername,
                    webhookUrl = webhookUrl
                ).run()
            else
                sendWebhook("Action Required - User API didn't return enough users", webhookUrl=webhookUrl)

            return JobRunnerResponse.success()
        } catch (e: Throwable) {
            LOG.error("Error: ", e)
            sendWebhook("Error: `${e.message}`\n\n${e.stackTraceToString()}", webhookUrl)
            throw e
        }
    }

    companion object {
        private val LOG = LoggerFactory.getLogger(JobRunner::class.java)
    }
}

I was curious if anyone else has run into this issue before when developing a custom plugin using the job runner pieces. We have tried to add additional logging, but since it happens when its scheduled vs manually triggering the task, its hard to locate and find those log messages in all of the logs.