Fixing incorrect start time and duration on Hue Job Browser

Some users may notice incorrect values in the "Started" and "Duration" columns on the Job Browser page in Hue. This could be because the user is unauthorized to view the application according to the Job ACLs. Learn more about this issue and how to fix it.

Condition

Some users see that the "Started" and "Duration" columns show wrong or unexpected values. For example, the Started column displays a value such as: "1 January 1970 00:00" and Duration column displays a value such as: "0s". However, all users do not face this issue. For example, the admin user can see the values fine.

Cause

This issue occurs when Hue accesses the Resource Manager (RM) when Job ACLs are enabled. To confirm this, run the following command and check the output:
curl -kiv --negotiate -u : http://[***RM-HTTP-ADDRESS***]:8088/ws/v1/cluster/apps/[***APP-ID***]
Sample output:
{"app":{"id":"appid","user":"testuser","name":"PySparkShell","queue":"root.users.testuser",
"state":"FINISHED","finalStatus":"SUCCEEDED","progress":100.0,
"trackingUI":"History","trackingUrl":"http://[***RM-HTTP-ADDRESS***]:8088/proxy/[***APP-ID***]/",
"diagnostics":"","clusterId":12345678,"applicationType":"SPARK","applicationTags":"",
"startedTime":0,"finishedTime":0,"elapsedTime":0,"allocatedMB":0,"allocatedVCores":0,
"runningContainers":0,"memorySeconds":175016,"vcoreSeconds":170,
"preemptedResourceMB":0,"preemptedResourceVCores":0,
"numNonAMContainerPreempted":0,"numAMContainerPreempted":0}}
"startedTime"=0 in the output indicates that the user is not authorized to view the application according to the following two Job ACLs:
  • application VIEW acl (i.e. mapreduce.job.acl-view-job in combination with mapreduce.cluster.acls.enabled)
  • queue ADMIN acl (aclAdministerApps for the FS)

Solution

  1. Log in to Cloudera Manager as an Administrator.
  2. Go to Clusters > YARN > Configuration and add the following lines in the YARN Service MapReduce Advanced Configuration Snippet (Safety Valve) and MapReduce Client Advanced Configuration Snippet (Safety Valve) for mapred-site.xml field:
    <property>
    <name>mapreduce.cluster.acls.enabled</name>
    <value>true</value>
    </property>
    <property>
    <name>mapreduce.job.acl-view-job</name>
    <value>mapred,hue group1,group2</value>
    </property>
  3. Restart the Job History Service and run Deploy Client Configuration.
  4. Restart all affected services.