Unable to register Kepler/Vega Epg Sync Scheduler

Device : Kepler Fire TV stick (Vega OS)

We implemented TIF guide, to serve the data into TIF when app is not launched or in background for log hours, as per guidance we are trying to implement Epg-sync-scheduler : Ref-Link.

We have created a headless service to invoke EpgSyncScheduler() β†’ when we try to register the scheduler we are receiving status code -8

Logs for your reference

Dec 10 21:58:24.844851 INFO com.amazon.keplerscript: [KeplerScript-JavaScript] πŸ”₯πŸ”₯πŸ”₯ SERVICE.JS IS LOADING - BEFORE IMPORTS πŸ”₯πŸ”₯πŸ”₯
Dec 10 21:58:24.844978 INFO com.amazon.keplerscript: [KeplerScript-JavaScript] πŸ”₯πŸ”₯πŸ”₯ SERVICE.JS IMPORTS SUCCESSFUL πŸ”₯πŸ”₯πŸ”₯
Dec 10 21:58:24.845227 INFO com.amazon.keplerscript: [KeplerScript-JavaScript] SERVICE.JS: REGISTERING TIF HEADLESS ENTRY POINTS
Dec 10 21:58:24.845503 INFO com.amazon.keplerscript: [KeplerScript-JavaScript] service.js: TIF functions imported
Dec 10 21:58:24.845630 INFO com.amazon.keplerscript: [KeplerScript-JavaScript] βœ… service.js: onStartService registered
Dec 10 21:58:24.845756 INFO com.amazon.keplerscript: [KeplerScript-JavaScript] βœ… service.js: onStopService registered
Dec 10 21:58:27.505548 INFO com.amazon.keplerscript: [KeplerScript-JavaScript] service.js: Triggering TIF service in background
Dec 10 21:58:27.507461 INFO com.amazon.keplerscript: [KeplerScript-JavaScript] service.js: TIF service trigger initiated, continuing...
Dec 10 21:58:27.599298 INFO com.amazon.keplerscript: [KeplerScript-JavaScript] [INFO] 2025-12-10T21:58:27.597Z - Calling EpgSyncTaskScheduler.scheduleTask()...
Dec 10 21:58:27.615594 ERROR ktf.tm.nests: Error thrown when triggering task for component Id: onStartService, error: []: Error when submitting task, status: -8
Dec 10 21:58:27.637679 ERROR com.amazon.keplerscript: [KeplerScript-JavaScript] '[ERROR] 2025-12-10T21:58:27.636Z - Failed to schedule with interval:', [Error: Schedule task failed due to internal error]
Dec 10 21:58:27.638678 WARNING Volta:console.error: [ERROR] 2025-12-10T21:58:27.636Z - Failed to schedule with interval: Error: Schedule task failed due to internal error
Dec 10 21:58:27.639577 ERROR com.amazon.keplerscript: [KeplerScript-JavaScript] '[ERROR] 2025-12-10T21:58:27.638Z - Error details:', { message: 'Schedule task failed due to internal error',
Dec 10 21:58:27.647322 WARNING Volta:console.error: [ERROR] 2025-12-10T21:58:27.638Z - Error details: {"message":"Schedule task failed due to internal error","type":"InternalError"}
Dec 10 21:58:27.652954 ERROR com.amazon.keplerscript: [KeplerScript-JavaScript] '[ERROR] 2025-12-10T21:58:27.650Z - Error:', [Error: Schedule task failed due to internal error]
Dec 10 21:58:27.653262 WARNING Volta:console.error: [ERROR] 2025-12-10T21:58:27.650Z - Error: Error: Schedule task failed due to internal error
Dec 10 21:58:27.656568 ERROR com.amazon.keplerscript: [KeplerScript-JavaScript] '[ERROR] 2025-12-10T21:58:27.655Z - Error Message:', 'Schedule task failed due to internal error'
Dec 10 21:58:27.657614 WARNING Volta:console.error: [ERROR] 2025-12-10T21:58:27.655Z - Error Message: Schedule task failed due to internal error
Dec 10 21:58:27.658409 ERROR com.amazon.keplerscript: [KeplerScript-JavaScript] '[ERROR] 2025-12-10T21:58:27.657Z - Error Stack:', 'Error: Schedule task failed due to internal error\n    at construct (native)\n    at apply (native)\n    at _construct (bundle:7055:106)\n    at Wrapper (bundle:7029:64)\n    at construct (native)\n    at _callSuper (bundle:132741:254)\n    at InternalError (bundle:132753:24)\n    at anonymous (bundle:132997:81)\n    at tryCallOne (InternalBytecode.js:53:16)\n    at anonymous (InternalBytecode.js:139:27)'
Dec 10 21:58:27.674344 ERROR com.amazon.keplerscript: [KeplerScript-JavaScript] '[ERROR] 2025-12-10T21:58:27.673Z - Error message:', 'Schedule task failed due to internal error'
Dec 10 21:58:27.676616 WARNING Volta:console.error: [ERROR] 2025-12-10T21:58:27.673Z - Error message: Schedule task failed due to internal error
Dec 10 21:58:27.678860 ERROR com.amazon.keplerscript: [KeplerScript-JavaScript] '[ERROR] 2025-12-10T21:58:27.676Z - Error stack:', 'Error: Schedule task failed due to internal error\n    at construct (native)\n    at apply (native)\n    at _construct (bundle:7055:106)\n    at Wrapper (bundle:7029:64)\n    at construct (native)\n    at _callSuper (bundle:132741:254)\n    at InternalError (bundle:132753:24)\n    at anonymous (bundle:132997:81)\n    at tryCallOne (InternalBytecode.js:53:16)\n    at anonymous (InternalBytecode.js:139:27)'

I have also registered the scheduler entry point in manifest.toml

#
# HEADLESS ENTRY POINTS - Required for background task execution
#
[[offers.headless-entry-point]]
id = "onStartService"
uses-component = "TIFHeadlessService"

[[offers.headless-entry-point]]
id = "onStopService"
uses-component = "TIFHeadlessService"

Let me know If I have missed any configurations? also if u need more logs for understanding guide me on accessing them for our debugging.

Hi @manoj_d_b

I’m looking into this issue you are facing.
I’ll update you as soon as I have some clarity on this.

Warm regards,
Ivy

Hi @manoj_d_b

Wanted to check and confirm if you are using Amazon EPG component or is this related to LiveTV?

Warm regards,
Ivy

Hi @Ivy_Mahajan

We are feeding data to Amazon Live TV

Please find the screenshot for your reference.

We are trying to maintain 7 days of EPG data, for the same we are using EPG Sync Service to run the Headless Service written in our app to fetch data and insert to TIF.

Best Regards,

Manoj

Hi @Ivy_Mahajan any update on above question?

Hi @manoj_d_b

I’m working on this with internal teams. Please allow us some more time, we will help configure the required pool/weblab for seamlessly onboarding XUMO PLAY to Live TV on Vega soon.

Warm regards,
Ivy

Hi @manoj_d_b

Are you using Amazon EPG component to develop UI or did you create your own JS version?

Also, please share the code snippet about how you are calling EpgSyncTaskScheduler.scheduleTask() API, what arguments you are passing to this method.

And I am curious why you need to use a headless service to schedule EPG sync task and not a headless task?

Warm regards,
Ivy

Hi @Ivy_Mahajan

Thank you for looking into this. Here are the answers to your questions:

1. EPG Component Implementation

We are using our own JavaScript implementation for the EPG UI and data management, not the Amazon EPG component. Our implementation:

  • Fetches EPG data from our backend API (Xumo content services)

  • Processes and formats the data according to our requirements

  • Uses Amazon’s Kepler EPG Provider APIs (ChannelLineupProvider, ProgramLineupProvider2) to push the data into the system

  • Manages a 7-day rolling window of EPG data

2. EpgSyncTaskScheduler.scheduleTask() Usage

Here’s our implementation:

import { EpgSyncTaskScheduler } from '@amazon-devices/kepler-epg-sync-scheduler';

const BACKGROUND_TASK_COMPONENT_ID = 'com.xumo.xumo.tv::onStartService';
const INTERVAL_MINUTES = 1440; // 24 hours

// Called during app initialization after first sync completes
const setupVegaOSScheduler = async (): Promise<void> => {
  try {
    // Cancel any existing scheduled tasks first
    await EpgSyncTaskScheduler.cancelScheduledTask();
    
    // Schedule recurring task with 24-hour interval
    await EpgSyncTaskScheduler.scheduleTask(
      BACKGROUND_TASK_COMPONENT_ID,  // Component ID registered with HeadlessEntryPointRegistry
      INTERVAL_MINUTES                 // 1440 minutes = 24 hours
    );
    
    logger.info('Scheduled EPG sync every 24 hours');
  } catch (error) {
    logger.error('Failed to schedule EPG sync task:', error);
    throw error;
  }
};

Arguments we’re passing:

  • componentId: "com.xumo.xumo.tv::onStartService" - This matches our headless entry point registration

  • intervalMinutes: 1440 (24 hours) - Our EPG data refresh requirement

3. Why Headless Service vs Headless Task?

Entry Point Registration: We’re using HeadlessEntryPointRegistry from @amzn/headless-task-manager to register our entry points:

import { HeadlessEntryPointRegistry } from '@amzn/headless-task-manager';
import { onStartTIFService } from './src/services/TIFHeadlessService';

HeadlessEntryPointRegistry.registerHeadlessEntryPoint(
  'com.xumo.xumo.tv::onStartService',
  () => {
    console.log('Entry point invoked by VegaOS scheduler');
    return onStartTIFService(); // Returns Promise
  }
);

Service Component Declaration: Our manifest.toml declares it as a service component:

[[components.service]]
id = "com.xumo.xumo.tv.TIFHeadlessService"
runtime-module = "/com.amazon.kepler.headless.runtime.loader_2@IKeplerScript_2_0"
launch-type = "singleton"

However, we also have a task component declared:

[[components.task]]
id = "com.xumo.xumo.tv.main.EpgSyncTask"
runtime-module = "/com.amazon.kepler.headless.runtime.loader_2@IKeplerScript_2_0"

My Dev Testing OutPut :

  1. :white_check_mark: Entry points are registered successfully in JavaScript
  2. :white_check_mark: The scheduler native module loads correctly
  3. :white_check_mark: Manual EPG sync works perfectly (called from app launch)
  4. :cross_mark: VegaOS Task Manager rejects the scheduled task with status -8

Let me know if you need additional details.

Best Regards,

Manoj

1 Like

Hi @manoj_d_b

We found few issues in the implementation:

  1. The component id const BACKGROUND_TASK_COMPONENT_ID = 'com.xumo.xumo.tv::onStartService'; used in the EpgSyncTaskScheduler.scheduleTask() usage is not correct, it should be the id that is defined in the mainifest file for the EPG sync task com.xumo.xumo.tv.main.EpgSyncTask

  2. Please follow Step 8: Register your Task with the System | Design and Develop Vega Apps to register the entry point for the task component com.xumo.xumo.tv.main.EpgSyncTask

  3. If you are okay to not use a headless service, you can follow step 5 - 7 (from the document link above) to choose the proper solution to schedule EPG sync task.

Please give it a try and let me know if this works for you or if you have any concerns.

Warm regards,
Ivy