Product: TIBCO Spotfire®
Errors related to Scheduled Updates and Automation Services jobs after upgrade to TIBCO Spotfire Server 10.10.0 or higher - "Cannot convert 7 to JobTaskStatus by ordinal value"
After upgrading from a previous version to TIBCO Spotfire Server 10.10.0 or higher, you may encounter issues related to Scheduled Updates and Automation Services jobs.
Examples of issues:
- Attempting to reload a rule in the Scheduling & Routing > Overview tab, the reload fails with an "Internal Server Error"
- Looking at past jobs in the Scheduling and Routing > Activity tab, you don't see any jobs from before the upgrade and may also get an "Internal Server Error"
In the server logs, you'll see errors like the following:
ERROR 2020-11-27T11:04:52,641+0100 [email@example.com, #C-1096, #342924] spotfire.rs.RestExceptionHandler: Intercepted exception in request to /rest/jobs/listAllInstancesDetail
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column 'STATUS' from result set. Cause: java.lang.IllegalArgumentException: Cannot convert 7 to JobTaskStatus by ordinal value.
This issue can occur if, before the old Spotfire servers were shut down for the upgrade, there were Scheduled Updates or Automation Services jobs still in the job queue that had not yet been executed. It's the existence of these items in the Spotfire database (to be exact, entries in the JOB_TASKS table where the JobTaskStatus is 7) that causes the issue. The issue should go away automatically when the old job entries have been purged from the database. By default, job entries older than three days are purged (this is configured by the scheduled-jobs.purge-history-older-than configuration property).
The solve the issue immediately, you'll need to update the Spotfire database in the following way:
- Shut down all Spotfire Servers (services).
- It is strongly recommended to make a backup of the Spotfire database before making any changes to the database. In general, modification of any internal application content is not recommended and can lead to an unsupported configuration.
- Now connect to the Spotfire database using your database tool of choice, and execute the following:
update JOB_TASKS set STATUS = 6 where STATUS = 7; commit;