Issue Summary
Adding a blank space in front of the CRON expression in one Assets Report will make the entire Assets Reports page fail to load with the following error message:
Failed to fetch reports list
Something went wrong. Please try again later. If the error persists, contact our support team.

Steps to Reproduce
- Access the Assets Reports page: Assets > Report
- Create a Report
- Synchronize: Advanced
- For the Cron Schedule field add a CRON expression with a blank space in front, e.g:
- Save and Refresh the page
- When refreshing the page, the entire Reports page will be blank with the "Failed to fetch reports list" error message.
Video Reproducing the issue: JSDSERVER-15459 - Reproducing the issue.mov
Expected Results
When entering an invalid CRON expression (with a blank space), the "Expression is not valid" will be presented not allowing the report to be saved.
Actual Results
The report CRON Expression will be updated and the below exception will be thrown in the atlassian-jira.log file:
2024-07-19 11:49:04,196-0300 http-nio-44226-exec-17 ERROR admin 709x1831x4 1xytyos 0:0:0:0:0:0:0:1 /rest/insight-widgets/1/widgets [i.r.core.rest.ExceptionErrorMapper] Oops
java.lang.NumberFormatException: For input string: "?"
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.base/java.lang.Integer.parseInt(Integer.java:652)
at java.base/java.lang.Integer.parseInt(Integer.java:770)
at net.redhogs.cronparser.builder.YearDescriptionBuilder.getSingleItemDescription(YearDescriptionBuilder.java:22)
at net.redhogs.cronparser.builder.AbstractDescriptionBuilder.getSegmentDescription(AbstractDescriptionBuilder.java:25)
at net.redhogs.cronparser.CronExpressionDescriptor.getYearDescription(CronExpressionDescriptor.java:109)
at net.redhogs.cronparser.CronExpressionDescriptor.getFullDescription(CronExpressionDescriptor.java:245)
at net.redhogs.cronparser.CronExpressionDescriptor.getDescription(CronExpressionDescriptor.java:62)
at net.redhogs.cronparser.CronExpressionDescriptor.getDescription(CronExpressionDescriptor.java:39)
at io.riada.jira.plugins.insight.widget.model.Cron$Companion.descriptionOf(Cron.kt:80)
at io.riada.jira.plugins.insight.widget.model.Cron.translate(Cron.kt:27)

Workaround
We could manually fix the issue, we will need to identify the affected report CRON expression and update it or temporarily change the report synchronization to once:
Always back up your data before performing any modification to the database. If possible, try your modifications on a test server.
- Run the following SQL query to list all the reports using the CRON expression:
SELECT "ID", "NAME", "SYNC_PERIOD", "SYNC_PERIOD_CRON" FROM "AO_8542F1_IFJ_WIDGET" WHERE "SYNC_PERIOD" = 'ADVANCED'
- Verify the SYNC_PERIOD_CRON and find the row with an invalid CRON expression (blank space in front of the CRON expression)e.g:

- Temporarily update the affected report to SYNC_PERIOD Once, and fix the Cron using the UI. (Recommended
)
update "AO_8542F1_IFJ_WIDGET" SET "SYNC_PERIOD_CRON" = NULL, "SYNC_PERIOD" = 'ONCE' WHERE "ID" = REPORT_ID;
- Replace <REPORT_ID> with the affected Asset report ID.
- Or, update the CRON Expression column running the SQL query below:
update "AO_8542F1_IFJ_WIDGET" SET "SYNC_PERIOD_CRON" = '<CRON_EXPRESSION>' WHERE "SYNC_PERIOD" = 'ADVANCED' AND "ID" = REPORT_ID;
- Replace <CRON_EXPRESSION> with the CRON_EXPRESSION without blank space.
Make sure that the CRON expression is valid.
- Replace <REPORT_ID> with the affected Asset report ID.