HVR Jobs Don't Load and the REST API Returns a 504 Gateway Timeout Error
Issue
The HVR Hub UI doesn't display jobs, and a GET request for job status returns the following error:
504 Gateway Timeout
Environment
HVR 6
Resolution
To resolve this issue, complete the following steps:
Identify the affected job
Query the HVR repository database to locate jobs configured with invalid trig_crono values. For PostgreSQL, run the following query. Replace <schema> with the schema name:
SELECT hub_name, job_name, attr_arg1
FROM <schema>.hvr_job_attribute
WHERE attr_name = 'trig_crono'
AND (
attr_arg1 ~ '(^|[[:space:]])(30|31)[[:space:]]+2([[:space:]]|$)'
OR attr_arg1 ~ '(^|[[:space:]])31[[:space:]]+(4|6|9|11)([[:space:]]|$)'
);
For Oracle, SQL Server, or MySQL, adapt the regular expression syntax.
Correct the job schedule
For each affected job, use the returned hub_name and job_name values with the hvrjobconfig command to set a valid schedule. For example, the following command schedules the job for midnight on February 28:
hvrjobconfig -A "trig_crono=0 0 28 * *" <hub_name> <job_name>
Verify the UI
Refresh the HVR Hub UI or repeat the GET API request to confirm that the job list loads without timing out.
Cause
This issue occurs when a job's trig_crono attribute is set to an invalid cron expression that specifies an impossible calendar date, such as 0 0 31 2 * (February 31).
When we evaluate a non-existent date, we repeatedly advance the year while searching for a matching leap year. Since the date never occurs, the thread hangs indefinitely. When the job status query hits the configured API response timeout, the gateway terminates the request and returns a 504 Gateway Timeout error.