<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Why hdfs throwing LeaseExpiredException in Hadoop cluster (AWS EMR) in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-hdfs-throwing-LeaseExpiredException-in-Hadoop-cluster/m-p/164811#M41457</link>
    <description>&lt;P&gt;@Sunile Manjee This configuration didn't work. I found the issue of this problem. And, it lies in application layer code only. I will update the answer.&lt;/P&gt;</description>
    <pubDate>Tue, 27 Sep 2016 12:52:19 GMT</pubDate>
    <dc:creator>mail2jhamb</dc:creator>
    <dc:date>2016-09-27T12:52:19Z</dc:date>
    <item>
      <title>Why hdfs throwing LeaseExpiredException in Hadoop cluster (AWS EMR)</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-hdfs-throwing-LeaseExpiredException-in-Hadoop-cluster/m-p/164806#M41452</link>
      <description>&lt;P&gt;
	I am getting LeaseExpiredException in hadoop cluster - &lt;/P&gt;&lt;H4&gt;tail -f /var/log/hadoop-hdfs/hadoop-hdfs-namenode-ip-172-30-2-148.log&lt;/H4&gt;&lt;PRE&gt;	&amp;gt; 2016-09-21 11:54:14,533 INFO BlockStateChange (IPC Server handler 10
&amp;gt; on 8020): BLOCK* InvalidateBlocks: add blk_1073747501_6677 to
&amp;gt; 172.30.2.189:50010 2016-09-21 11:54:14,534 INFO org.apache.hadoop.ipc.Server (IPC Server handler 31 on 8020): IPC
&amp;gt; Server handler 31 on 8020, call
&amp;gt; org.apache.hadoop.hdfs.protocol.ClientProtocol.complete from
&amp;gt; 172.30.2.189:37674 Call#34 Retry#0: org.apache.hadoop.hdfs.server.namenode.LeaseExpiredException: No lease
&amp;gt; on
&amp;gt; /tmp/hive/hadoop/_tez_session_dir/1e4f71f0-9f29-468d-980e-9f19690bf849/.tez/application_1474442135017_0114/recovery/1/summary
&amp;gt; (inode 26350): File does not exist. Holder
&amp;gt; DFSClient_NONMAPREDUCE_-143782605_1 does not have any open files.
&amp;gt; 2016-09-21 11:54:15,557 INFO org.apache.hadoop.hdfs.StateChange (IPC
&amp;gt; Server handler 0 on 8020): BLOCK* allocate
&amp;gt; blk_1073747503_6679{UCState=UNDER_CONSTRUCTION, truncateBlock=null,
&amp;gt; primaryNodeIndex=-1,
&amp;gt; replicas=[ReplicaUC[[DISK]DS-86592ba7-c51a-431d-8019-9e362d721b28:NORMAL:172.30.2.189:50010|RBW]]} for
&amp;gt; /var/log/hadoop-yarn/apps/hadoop/logs/application_1474442135017_0114/ip-172-30-2-122.us-west-2.compute.internal_8041.tmp &lt;/PRE&gt;&lt;P&gt;
	And, some of the hive query is also failing. I am guessing, it is because of above issue.&lt;/P&gt;&lt;H4&gt;
	tail -f /var/log/hive/hive-server2.log&lt;/H4&gt;
&lt;PRE&gt;    2016-09-21T11:59:35,126 INFO  [HiveServer2-Background-Pool: Thread-3883([])]: ql.Driver (Driver.java:execute(1477)) - Executing command(queryId=hive_20160921115934_c56d9c91-640b-4f5d-b490-34549a4258c7): 
    INSERT INTO TABLE validation_logs 
    SELECT 
    "18364", 
    "TABLE_VALIDATION",
    error.code,
    error.validator,
    get_json_object(key, '$.table_name'),
    NULL,
    NULL,
    error.failure_msg,
    FROM_UNIXTIME(UNIX_TIMESTAMP('20160921','yyyyMMdd')), 
    from_unixtime(unix_timestamp())
    FROM
    (SELECT 
    MAP(concat("{\"table_name\" : \"", table_name , "\"}"), error) AS err_map
    FROM table_level_validation_result
    ) AS res
    LATERAL VIEW EXPLODE(res.err_map) tmp AS key, error WHERE error IS NOT NULL AND (error.code="error" OR error.code="warn")
    2016-09-21T11:59:35,126 INFO  [HiveServer2-Background-Pool: Thread-3883([])]: ql.Driver (SessionState.java:printInfo(1054)) - Query ID = hive_20160921115934_c56d9c91-640b-4f5d-b490-34549a4258c7
    2016-09-21T11:59:35,126 INFO  [HiveServer2-Background-Pool: Thread-3883([])]: ql.Driver (SessionState.java:printInfo(1054)) - Total jobs = 1
    2016-09-21T11:59:35,127 INFO  [HiveServer2-Background-Pool: Thread-3883([])]: ql.Driver (SessionState.java:printInfo(1054)) - Launching Job 1 out of 1
    2016-09-21T11:59:35,127 INFO  [HiveServer2-Background-Pool: Thread-3883([])]: ql.Driver (Driver.java:launchTask(1856)) - Starting task [Stage-1:MAPRED] in serial mode
    2016-09-21T11:59:35,127 INFO  [HiveServer2-Background-Pool: Thread-3883([])]: tez.TezSessionPoolManager (TezSessionPoolManager.java:canWorkWithSameSession(404)) - The current user: hadoop, session user: hadoop
    2016-09-21T11:59:35,127 INFO  [HiveServer2-Background-Pool: Thread-3883([])]: tez.TezSessionPoolManager (TezSessionPoolManager.java:canWorkWithSameSession(421)) - Current queue name is null incoming queue name is null
    2016-09-21T11:59:35,173 INFO  [HiveServer2-Background-Pool: Thread-3883([])]: ql.Context (Context.java:getMRScratchDir(340)) - New scratch dir is hdfs://ip-172-30-2-148.us-west-2.compute.internal:8020/tmp/hive/hadoop/65cf7f02-a7d3-40ba-a93f-ff5214afbdfc/hive_2016-09-21_11-59-34_474_5003281239065359634-127
    2016-09-21T11:59:35,174 INFO  [HiveServer2-Background-Pool: Thread-3883([])]: exec.Task (TezTask.java:updateSession(279)) - Session is already open
    2016-09-21T11:59:35,175 INFO  [HiveServer2-Background-Pool: Thread-3883([])]: tez.DagUtils (DagUtils.java:createLocalResource(758)) - Resource modification time: 1474459142291 for hdfs://ip-172-30-2-148.us-west-2.compute.internal:8020/tmp/hive/hadoop/_tez_session_dir/85d36c12-c629-44a8-b23c-c628898a79b7/commons-vfs2-2.0.jar
    2016-09-21T11:59:35,176 INFO  [HiveServer2-Background-Pool: Thread-3883([])]: tez.DagUtils (DagUtils.java:createLocalResource(758)) - Resource modification time: 1474459142320 for hdfs://ip-172-30-2-148.us-west-2.compute.internal:8020/tmp/hive/hadoop/_tez_session_dir/85d36c12-c629-44a8-b23c-c628898a79b7/emr-ddb-hive.jar
    2016-09-21T11:59:35,177 INFO  [HiveServer2-Background-Pool: Thread-3883([])]: tez.DagUtils (DagUtils.java:createLocalResource(758)) - Resource modification time: 1474459142353 for hdfs://ip-172-30-2-148.us-west-2.compute.internal:8020/tmp/hive/hadoop/_tez_session_dir/85d36c12-c629-44a8-b23c-c628898a79b7/emr-hive-goodies.jar
    2016-09-21T11:59:35,178 INFO  [HiveServer2-Background-Pool: Thread-3883([])]: tez.DagUtils (DagUtils.java:createLocalResource(758)) - Resource modification time: 1474459142389 for hdfs://ip-172-30-2-148.us-west-2.compute.internal:8020/tmp/hive/hadoop/_tez_session_dir/85d36c12-c629-44a8-b23c-c628898a79b7/emr-kinesis-hive.jar
    2016-09-21T11:59:35,178 INFO  [HiveServer2-Background-Pool: Thread-3883([])]: tez.DagUtils (DagUtils.java:createLocalResource(758)) - Resource modification time: 1474459142423 for hdfs://ip-172-30-2-148.us-west-2.compute.internal:8020/tmp/hive/hadoop/_tez_session_dir/85d36c12-c629-44a8-b23c-c628898a79b7/hive-contrib-2.1.0-amzn-0.jar
    2016-09-21T11:59:35,179 INFO  [HiveServer2-Background-Pool: Thread-3883([])]: tez.DagUtils (DagUtils.java:createLocalResource(758)) - Resource modification time: 1474459142496 for hdfs://ip-172-30-2-148.us-west-2.compute.internal:8020/tmp/hive/hadoop/_tez_session_dir/85d36c12-c629-44a8-b23c-c628898a79b7/hive-plugins-0.0.1-emr-upgrade-20160919.070538-1.jar
    2016-09-21T11:59:35,179 INFO  [HiveServer2-Background-Pool: Thread-3883([])]: exec.Task (TezTask.java:build(321)) - Dag name: INSERT INTO TABLE valid...error.code="warn")(Stage-1)
    2016-09-21T11:59:35,180 INFO  [HiveServer2-Background-Pool: Thread-3883([])]: ql.Context (Context.java:getMRScratchDir(340)) - New scratch dir is hdfs://ip-172-30-2-148.us-west-2.compute.internal:8020/tmp/hive/hadoop/65cf7f02-a7d3-40ba-a93f-ff5214afbdfc/hive_2016-09-21_11-59-34_474_5003281239065359634-127
    2016-09-21T11:59:35,223 INFO  [HiveServer2-Background-Pool: Thread-3881([])]: impl.YarnClientImpl (YarnClientImpl.java:submitApplication(273)) - Submitted application application_1474442135017_0147
    2016-09-21T11:59:35,224 INFO  [HiveServer2-Background-Pool: Thread-3881([])]: client.TezClient (TezClient.java:start(477)) - The url to track the Tez Session: &lt;A href="http://ip-172-30-2-148.us-west-2.compute.internal:20888/proxy/application_1474442135017_0147/" target="_blank"&gt;http://ip-172-30-2-148.us-west-2.compute.internal:20888/proxy/application_1474442135017_0147/&lt;/A&gt;
    2016-09-21T11:59:35,391 INFO  [HiveServer2-Background-Pool: Thread-3429([])]: SessionState (SessionState.java:printInfo(1054)) - Map 1: 0(+0,-4)/1
    2016-09-21T11:59:35,446 ERROR [HiveServer2-Background-Pool: Thread-3429([])]: SessionState (SessionState.java:printError(1063)) - Status: Failed
    2016-09-21T11:59:35,447 ERROR [HiveServer2-Background-Pool: Thread-3429([])]: SessionState (SessionState.java:printError(1063)) - Vertex failed, vertexName=Map 1, vertexId=vertex_1474442135017_0134_2_00, diagnostics=[Task failed, taskId=task_1474442135017_0134_2_00_000000, diagnostics=[TaskAttempt 0 failed, info=[Error: Error while running task ( failure ) : attempt_1474442135017_0134_2_00_000000_0:java.lang.RuntimeException: java.lang.RuntimeException: java.io.IOException: java.io.FileNotFoundException: No such file or directory 's3://data-platform-insights/data-platform/internal_test_automation/2016/09/21/18364/logs/validations/table_col_aggregate_validation_result/.hive-staging_hive_2016-09-21_11-57-58_703_5106478639780932144-1/_tmp.-ext-10000/000000_0.gz'
    at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.initializeAndRunProcessor(TezProcessor.java:198)
    at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.run(TezProcessor.java:160)
    at org.apache.tez.runtime.LogicalIOProcessorRuntimeTask.run(LogicalIOProcessorRuntimeTask.java:370)
    at org.apache.tez.runtime.task.TaskRunner2Callable$1.run(TaskRunner2Callable.java:73)
    at org.apache.tez.runtime.task.TaskRunner2Callable$1.run(TaskRunner2Callable.java:61)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:422)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
    at org.apache.tez.runtime.task.TaskRunner2Callable.callInternal(TaskRunner2Callable.java:61)
    at org.apache.tez.runtime.task.TaskRunner2Callable.callInternal(TaskRunner2Callable.java:37)
    at org.apache.tez.common.CallableWithNdc.call(CallableWithNdc.java:36)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.RuntimeException: java.io.IOException: java.io.FileNotFoundException: No such file or directory 's3://data-platform-insights/data-platform/internal_test_automation/2016/09/21/18364/logs/validations/table_col_aggregate_validation_result/.hive-staging_hive_2016-09-21_11-57-58_703_5106478639780932144-1/_tmp.-ext-10000/000000_0.gz'
    at org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat$TezGroupedSplitsRecordReader.initNextRecordReader(TezGroupedSplitsInputFormat.java:206)
    at org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat$TezGroupedSplitsRecordReader.next(TezGroupedSplitsInputFormat.java:152)
    at org.apache.tez.mapreduce.lib.MRReaderMapred.next(MRReaderMapred.java:116)
    at org.apache.hadoop.hive.ql.exec.tez.MapRecordSource.pushRecord(MapRecordSource.java:62)
    at org.apache.hadoop.hive.ql.exec.tez.MapRecordProcessor.run(MapRecordProcessor.java:360)
    at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.initializeAndRunProcessor(TezProcessor.java:172)
    ... 14 more
    Caused by: java.io.IOException: java.io.FileNotFoundException: No such file or directory 's3://data-platform-insights/data-platform/internal_test_automation/2016/09/21/18364/logs/validations/table_col_aggregate_validation_result/.hive-staging_hive_2016-09-21_11-57-58_703_5106478639780932144-1/_tmp.-ext-10000/000000_0.gz'
    at org.apache.hadoop.hive.io.HiveIOExceptionHandlerChain.handleRecordReaderCreationException(HiveIOExceptionHandlerChain.java:97)
    at org.apache.hadoop.hive.io.HiveIOExceptionHandlerUtil.handleRecordReaderCreationException(HiveIOExceptionHandlerUtil.java:57)
    at org.apache.hadoop.hive.ql.io.HiveInputFormat.getRecordReader(HiveInputFormat.java:299)
    at org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat$TezGroupedSplitsRecordReader.initNextRecordReader(TezGroupedSplitsInputFormat.java:203)
    ... 19 more
    Caused by: java.io.FileNotFoundException: No such file or directory 's3://data-platform-insights/data-platform/internal_test_automation/2016/09/21/18364/logs/validations/table_col_aggregate_validation_result/.hive-staging_hive_2016-09-21_11-57-58_703_5106478639780932144-1/_tmp.-ext-10000/000000_0.gz'
    at com.amazon.ws.emr.hadoop.fs.s3n.S3NativeFileSystem.getFileStatus(S3NativeFileSystem.java:818)
    at com.amazon.ws.emr.hadoop.fs.s3n.S3NativeFileSystem.open(S3NativeFileSystem.java:1193)
    at org.apache.hadoop.fs.FileSystem.open(FileSystem.java:771)
    at com.amazon.ws.emr.hadoop.fs.EmrFileSystem.open(EmrFileSystem.java:168)
    at org.apache.hadoop.mapred.LineRecordReader.&amp;lt;init&amp;gt;(LineRecordReader.java:109)
    at org.apache.hadoop.mapred.TextInputFormat.getRecordReader(TextInputFormat.java:67)
    at org.apache.hadoop.hive.ql.io.HiveInputFormat.getRecordReader(HiveInputFormat.java:297)
    ... 20 more
    ], TaskAttempt 1 failed, info=[Error: Error while running task ( failure ) : attempt_1474442135017_0134_2_00_000000_1:java.lang.RuntimeException: java.lang.RuntimeException: java.io.IOException: java.io.FileNotFoundException: No such file or directory 's3://data-platform-insights/data-platform/internal_test_automation/2016/09/21/18364/logs/validations/table_col_aggregate_validation_result/.hive-staging_hive_2016-09-21_11-57-58_703_5106478639780932144-1/_tmp.-ext-10000/000000_0.gz'
    at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.initializeAndRunProcessor(TezProcessor.java:198)
    at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.run(TezProcessor.java:160)
    at org.apache.tez.runtime.LogicalIOProcessorRuntimeTask.run(LogicalIOProcessorRuntimeTask.java:370)
    at org.apache.tez.runtime.task.TaskRunner2Callable$1.run(TaskRunner2Callable.java:73)
    at org.apache.tez.runtime.task.TaskRunner2Callable$1.run(TaskRunner2Callable.java:61)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:422)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
    at org.apache.tez.runtime.task.TaskRunner2Callable.callInternal(TaskRunner2Callable.java:61)
    at org.apache.tez.runtime.task.TaskRunner2Callable.callInternal(TaskRunner2Callable.java:37)
    at org.apache.tez.common.CallableWithNdc.call(CallableWithNdc.java:36)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.RuntimeException: java.io.IOException: java.io.FileNotFoundException: No such file or directory 's3://data-platform-insights/data-platform/internal_test_automation/2016/09/21/18364/logs/validations/table_col_aggregate_validation_result/.hive-staging_hive_2016-09-21_11-57-58_703_5106478639780932144-1/_tmp.-ext-10000/000000_0.gz'
    at org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat$TezGroupedSplitsRecordReader.initNextRecordReader(TezGroupedSplitsInputFormat.java:206)
    at org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat$TezGroupedSplitsRecordReader.next(TezGroupedSplitsInputFormat.java:152)
    at org.apache.tez.mapreduce.lib.MRReaderMapred.next(MRReaderMapred.java:116)
    at org.apache.hadoop.hive.ql.exec.tez.MapRecordSource.pushRecord(MapRecordSource.java:62)
    at org.apache.hadoop.hive.ql.exec.tez.MapRecordProcessor.run(MapRecordProcessor.java:360)
    at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.initializeAndRunProcessor(TezProcessor.java:172)
    ... 14 more
    Caused by: java.io.IOException: java.io.FileNotFoundException: No such file or directory 's3://data-platform-insights/data-platform/internal_test_automation/2016/09/21/18364/logs/validations/table_col_aggregate_validation_result/.hive-staging_hive_2016-09-21_11-57-58_703_5106478639780932144-1/_tmp.-ext-10000/000000_0.gz'
    at org.apache.hadoop.hive.io.HiveIOExceptionHandlerChain.handleRecordReaderCreationException(HiveIOExceptionHandlerChain.java:97)
    at org.apache.hadoop.hive.io.HiveIOExceptionHandlerUtil.handleRecordReaderCreationException(HiveIOExceptionHandlerUtil.java:57)
    at org.apache.hadoop.hive.ql.io.HiveInputFormat.getRecordReader(HiveInputFormat.java:299)
    at org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat$TezGroupedSplitsRecordReader.initNextRecordReader(TezGroupedSplitsInputFormat.java:203)
    ... 19 more
    Caused by: java.io.FileNotFoundException: No such file or directory 's3://data-platform-insights/data-platform/internal_test_automation/2016/09/21/18364/logs/validations/table_col_aggregate_validation_result/.hive-staging_hive_2016-09-21_11-57-58_703_5106478639780932144-1/_tmp.-ext-10000/000000_0.gz'
    at com.amazon.ws.emr.hadoop.fs.s3n.S3NativeFileSystem.getFileStatus(S3NativeFileSystem.java:818)
    at com.amazon.ws.emr.hadoop.fs.s3n.S3NativeFileSystem.open(S3NativeFileSystem.java:1193)
    at org.apache.hadoop.fs.FileSystem.open(FileSystem.java:771)
    at com.amazon.ws.emr.hadoop.fs.EmrFileSystem.open(EmrFileSystem.java:168)
    at org.apache.hadoop.mapred.LineRecordReader.&amp;lt;init&amp;gt;(LineRecordReader.java:109)
    at org.apache.hadoop.mapred.TextInputFormat.getRecordReader(TextInputFormat.java:67)
    at org.apache.hadoop.hive.ql.io.HiveInputFormat.getRecordReader(HiveInputFormat.java:297)
    ... 20 more
    ], TaskAttempt 2 failed, info=[Error: Error while running task ( failure ) : attempt_1474442135017_0134_2_00_000000_2:java.lang.RuntimeException: java.lang.RuntimeException: java.io.IOException: java.io.FileNotFoundException: No such file or directory 's3://data-platform-insights/data-platform/internal_test_automation/2016/09/21/18364/logs/validations/table_col_aggregate_validation_result/.hive-staging_hive_2016-09-21_11-57-58_703_5106478639780932144-1/_tmp.-ext-10000/000000_0.gz'
    at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.initializeAndRunProcessor(TezProcessor.java:198)
    at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.run(TezProcessor.java:160)
    at org.apache.tez.runtime.LogicalIOProcessorRuntimeTask.run(LogicalIOProcessorRuntimeTask.java:370)
    at org.apache.tez.runtime.task.TaskRunner2Callable$1.run(TaskRunner2Callable.java:73)
    at org.apache.tez.runtime.task.TaskRunner2Callable$1.run(TaskRunner2Callable.java:61)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:422)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
    at org.apache.tez.runtime.task.TaskRunner2Callable.callInternal(TaskRunner2Callable.java:61)
    at org.apache.tez.runtime.task.TaskRunner2Callable.callInternal(TaskRunner2Callable.java:37)
    at org.apache.tez.common.CallableWithNdc.call(CallableWithNdc.java:36)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.RuntimeException: java.io.IOException: java.io.FileNotFoundException: No such file or directory 's3://data-platform-insights/data-platform/internal_test_automation/2016/09/21/18364/logs/validations/table_col_aggregate_validation_result/.hive-staging_hive_2016-09-21_11-57-58_703_5106478639780932144-1/_tmp.-ext-10000/000000_0.gz'
    at org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat$TezGroupedSplitsRecordReader.initNextRecordReader(TezGroupedSplitsInputFormat.java:206)
    at org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat$TezGroupedSplitsRecordReader.next(TezGroupedSplitsInputFormat.java:152)
    at org.apache.tez.mapreduce.lib.MRReaderMapred.next(MRReaderMapred.java:116)
    at org.apache.hadoop.hive.ql.exec.tez.MapRecordSource.pushRecord(MapRecordSource.java:62)
    at org.apache.hadoop.hive.ql.exec.tez.MapRecordProcessor.run(MapRecordProcessor.java:360)
    at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.initializeAndRunProcessor(TezProcessor.java:172)
    ... 14 more
    Caused by: java.io.IOException: java.io.FileNotFoundException: No such file or directory 's3://data-platform-insights/data-platform/internal_test_automation/2016/09/21/18364/logs/validations/table_col_aggregate_validation_result/.hive-staging_hive_2016-09-21_11-57-58_703_5106478639780932144-1/_tmp.-ext-10000/000000_0.gz'
    at org.apache.hadoop.hive.io.HiveIOExceptionHandlerChain.handleRecordReaderCreationException(HiveIOExceptionHandlerChain.java:97)
    at org.apache.hadoop.hive.io.HiveIOExceptionHandlerUtil.handleRecordReaderCreationException(HiveIOExceptionHandlerUtil.java:57)
    at org.apache.hadoop.hive.ql.io.HiveInputFormat.getRecordReader(HiveInputFormat.java:299)
    at org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat$TezGroupedSplitsRecordReader.initNextRecordReader(TezGroupedSplitsInputFormat.java:203)
    ... 19 more
    Caused by: java.io.FileNotFoundException: No such file or directory 's3://data-platform-insights/data-platform/internal_test_automation/2016/09/21/18364/logs/validations/table_col_aggregate_validation_result/.hive-staging_hive_2016-09-21_11-57-58_703_5106478639780932144-1/_tmp.-ext-10000/000000_0.gz'
    at com.amazon.ws.emr.hadoop.fs.s3n.S3NativeFileSystem.getFileStatus(S3NativeFileSystem.java:818)
    at com.amazon.ws.emr.hadoop.fs.s3n.S3NativeFileSystem.open(S3NativeFileSystem.java:1193)
    at org.apache.hadoop.fs.FileSystem.open(FileSystem.java:771)
    at com.amazon.ws.emr.hadoop.fs.EmrFileSystem.open(EmrFileSystem.java:168)
    at org.apache.hadoop.mapred.LineRecordReader.&amp;lt;init&amp;gt;(LineRecordReader.java:109)
    at org.apache.hadoop.mapred.TextInputFormat.getRecordReader(TextInputFormat.java:67)
    at org.apache.hadoop.hive.ql.io.HiveInputFormat.getRecordReader(HiveInputFormat.java:297)
    ... 20 more
    ], TaskAttempt 3 failed, info=[Error: Error while running task ( failure ) : attempt_1474442135017_0134_2_00_000000_3:java.lang.RuntimeException: java.lang.RuntimeException: java.io.IOException: java.io.FileNotFoundException: No such file or directory 's3://data-platform-insights/data-platform/internal_test_automation/2016/09/21/18364/logs/validations/table_col_aggregate_validation_result/.hive-staging_hive_2016-09-21_11-57-58_703_5106478639780932144-1/_tmp.-ext-10000/000000_0.gz'
    at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.initializeAndRunProcessor(TezProcessor.java:198)
    at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.run(TezProcessor.java:160)
    at org.apache.tez.runtime.LogicalIOProcessorRuntimeTask.run(LogicalIOProcessorRuntimeTask.java:370)
    at org.apache.tez.runtime.task.TaskRunner2Callable$1.run(TaskRunner2Callable.java:73)
    at org.apache.tez.runtime.task.TaskRunner2Callable$1.run(TaskRunner2Callable.java:61)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:422)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
    at org.apache.tez.runtime.task.TaskRunner2Callable.callInternal(TaskRunner2Callable.java:61)
    at org.apache.tez.runtime.task.TaskRunner2Callable.callInternal(TaskRunner2Callable.java:37)
    at org.apache.tez.common.CallableWithNdc.call(CallableWithNdc.java:36)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.RuntimeException: java.io.IOException: java.io.FileNotFoundException: No such file or directory 's3://data-platform-insights/data-platform/internal_test_automation/2016/09/21/18364/logs/validations/table_col_aggregate_validation_result/.hive-staging_hive_2016-09-21_11-57-58_703_5106478639780932144-1/_tmp.-ext-10000/000000_0.gz'
    at org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat$TezGroupedSplitsRecordReader.initNextRecordReader(TezGroupedSplitsInputFormat.java:206)
    at org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat$TezGroupedSplitsRecordReader.next(TezGroupedSplitsInputFormat.java:152)
    at org.apache.tez.mapreduce.lib.MRReaderMapred.next(MRReaderMapred.java:116)
    at org.apache.hadoop.hive.ql.exec.tez.MapRecordSource.pushRecord(MapRecordSource.java:62)
    at org.apache.hadoop.hive.ql.exec.tez.MapRecordProcessor.run(MapRecordProcessor.java:360)
    at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.initializeAndRunProcessor(TezProcessor.java:172)
    ... 14 more
    Caused by: java.io.IOException: java.io.FileNotFoundException: No such file or directory 's3://data-platform-insights/data-platform/internal_test_automation/2016/09/21/18364/logs/validations/table_col_aggregate_validation_result/.hive-staging_hive_2016-09-21_11-57-58_703_5106478639780932144-1/_tmp.-ext-10000/000000_0.gz'
    at org.apache.hadoop.hive.io.HiveIOExceptionHandlerChain.handleRecordReaderCreationException(HiveIOExceptionHandlerChain.java:97)
    at org.apache.hadoop.hive.io.HiveIOExceptionHandlerUtil.handleRecordReaderCreationException(HiveIOExceptionHandlerUtil.java:57)
    at org.apache.hadoop.hive.ql.io.HiveInputFormat.getRecordReader(HiveInputFormat.java:299)
    at org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat$TezGroupedSplitsRecordReader.initNextRecordReader(TezGroupedSplitsInputFormat.java:203)
    ... 19 more
    Caused by: java.io.FileNotFoundException: No such file or directory 's3://data-platform-insights/data-platform/internal_test_automation/2016/09/21/18364/logs/validations/table_col_aggregate_validation_result/.hive-staging_hive_2016-09-21_11-57-58_703_5106478639780932144-1/_tmp.-ext-10000/000000_0.gz'
    at com.amazon.ws.emr.hadoop.fs.s3n.S3NativeFileSystem.getFileStatus(S3NativeFileSystem.java:818)
    at com.amazon.ws.emr.hadoop.fs.s3n.S3NativeFileSystem.open(S3NativeFileSystem.java:1193)
    at org.apache.hadoop.fs.FileSystem.open(FileSystem.java:771)
    at com.amazon.ws.emr.hadoop.fs.EmrFileSystem.open(EmrFileSystem.java:168)
    at org.apache.hadoop.mapred.LineRecordReader.&amp;lt;init&amp;gt;(LineRecordReader.java:109)
    at org.apache.hadoop.mapred.TextInputFormat.getRecordReader(TextInputFormat.java:67)
    at org.apache.hadoop.hive.ql.io.HiveInputFormat.getRecordReader(HiveInputFormat.java:297)
    ... 20 more
    ]], Vertex did not succeed due to OWN_TASK_FAILURE, failedTasks:1 killedTasks:0, Vertex vertex_1474442135017_0134_2_00 [Map 1] killed/failed due to:OWN_TASK_FAILURE]
    2016-09-21T11:59:35,447 ERROR [HiveServer2-Background-Pool: Thread-3429([])]: SessionState (SessionState.java:printError(1063)) - DAG did not succeed due to VERTEX_FAILURE. failedVertices:1 killedVertices:0
&lt;/PRE&gt;&lt;P&gt;Also set hive configuration properties before executing the query -&lt;/P&gt;&lt;PRE&gt;    set hive.mapjoin.smalltable.filesize = 2000000000
    set mapreduce.map.speculative = false
    set mapreduce.output.fileoutputformat.compress = true
    set hive.exec.compress.output = true
    set mapreduce.task.timeout = 6000000
    set hive.optimize.bucketmapjoin.sortedmerge = true
    set io.compression.codecs = org.apache.hadoop.io.compress.GzipCodec
    set hive.auto.convert.sortmerge.join.noconditionaltask = false
    set hive.optimize.bucketmapjoin = true
    set hive.exec.compress.intermediate = true
    set hive.enforce.bucketmapjoin = true
    set mapred.output.compress = true
    set mapreduce.map.output.compress = true
    set hive.auto.convert.sortmerge.join = false
    set hive.auto.convert.join = false
    set mapreduce.reduce.speculative = false
    set mapred.output.compression.codec = org.apache.hadoop.io.compress.GzipCodec
    set hive.cache.expr.evaluation=false
    set mapred.output.compress=true
    set hive.exec.compress.output=true
    set mapred.output.compression.codec=org.apache.hadoop.io.compress.GzipCodec
    set io.compression.codecs=org.apache.hadoop.io.compress.GzipCodec
    set hive.exec.compress.intermediate=true
    set mapreduce.map.output.compress=true
    set hive.auto.convert.join=false
    set mapreduce.map.speculative=false
    set mapreduce.reduce.speculative=false
&lt;/PRE&gt;&lt;P&gt;Cluster details-&lt;/P&gt;&lt;PRE&gt;1. one Data-node with 32 GB disk space.
2. Hive - 2.1.0, execution engine - tez 0.8.3
3. hadoop - 2.7.2&lt;/PRE&gt;&lt;P&gt;Questions- &lt;/P&gt;&lt;PRE&gt;1. Why it is throwing LeaseExpiredException ?
2. IS Hive query failure related to LeaseExpiredException ?
3. Is it because of wrong hive configuration properties ?&lt;/PRE&gt;&lt;P&gt;Update-1&lt;/P&gt;&lt;PRE&gt;As per this answer - &lt;A href="http://stackoverflow.com/questions/26842933/leaseexpiredexception-no-lease-error-on-hdfs-failed-to-close-file" target="_blank"&gt;http://stackoverflow.com/questions/26842933/leaseexpiredexception-no-lease-error-on-hdfs-failed-to-close-file&lt;/A&gt;, 
I added 
    SET hive.exec.max.dynamic.partitions=100000; 
    SET hive.exec.max.dynamic.partitions.pernode=100000;
But then also showing the same exception.&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Sep 2016 13:17:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-hdfs-throwing-LeaseExpiredException-in-Hadoop-cluster/m-p/164806#M41452</guid>
      <dc:creator>mail2jhamb</dc:creator>
      <dc:date>2016-09-22T13:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why hdfs throwing LeaseExpiredException in Hadoop cluster (AWS EMR)</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-hdfs-throwing-LeaseExpiredException-in-Hadoop-cluster/m-p/164807#M41453</link>
      <description>&lt;P&gt; &lt;A rel="user" href="https://community.cloudera.com/users/13188/mail2jhamb.html" nodeid="13188"&gt;@Hitesh Jamb&lt;/A&gt; Are you getting this error (namenode) during MR job?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2016 08:59:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-hdfs-throwing-LeaseExpiredException-in-Hadoop-cluster/m-p/164807#M41453</guid>
      <dc:creator>sunile_manjee</dc:creator>
      <dc:date>2016-09-23T08:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Why hdfs throwing LeaseExpiredException in Hadoop cluster (AWS EMR)</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-hdfs-throwing-LeaseExpiredException-in-Hadoop-cluster/m-p/164808#M41454</link>
      <description>&lt;P&gt;@SunileManjee That also I am unaware of. In my application there is no Mapreduce code. Only, we are using is Hive. Previously, execution engine was mr, now I upgraded to tez. Previously, it was working fine. 


And, hive internally divides tasks between multiple mappers, and reducers. May be, that is causing problem.&lt;/P&gt;&lt;P&gt;As per hive-default.xml, hive.exec.stagingdir = .hive-staging.

This property is not present in earlier version.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2016 10:15:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-hdfs-throwing-LeaseExpiredException-in-Hadoop-cluster/m-p/164808#M41454</guid>
      <dc:creator>mail2jhamb</dc:creator>
      <dc:date>2016-09-23T10:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Why hdfs throwing LeaseExpiredException in Hadoop cluster (AWS EMR)</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-hdfs-throwing-LeaseExpiredException-in-Hadoop-cluster/m-p/164809#M41455</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/13188/mail2jhamb.html" nodeid="13188"&gt;@Hitesh Jamb&lt;/A&gt; I hit this issue on my sandbox.  what is your default for max dynamic partitions on hive?  I did the following and it fixed my issues&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SET hive.exec.max.dynamic.partitions=100000; 
SET hive.exec.max.dynamic.partitions.pernode=100000;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 24 Sep 2016 03:51:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-hdfs-throwing-LeaseExpiredException-in-Hadoop-cluster/m-p/164809#M41455</guid>
      <dc:creator>sunile_manjee</dc:creator>
      <dc:date>2016-09-24T03:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why hdfs throwing LeaseExpiredException in Hadoop cluster (AWS EMR)</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-hdfs-throwing-LeaseExpiredException-in-Hadoop-cluster/m-p/164810#M41456</link>
      <description>&lt;P&gt; &lt;A rel="user" href="https://community.cloudera.com/users/13188/mail2jhamb.html" nodeid="13188"&gt;@Hitesh Jamb&lt;/A&gt; any update?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2016 12:00:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-hdfs-throwing-LeaseExpiredException-in-Hadoop-cluster/m-p/164810#M41456</guid>
      <dc:creator>sunile_manjee</dc:creator>
      <dc:date>2016-09-27T12:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: Why hdfs throwing LeaseExpiredException in Hadoop cluster (AWS EMR)</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-hdfs-throwing-LeaseExpiredException-in-Hadoop-cluster/m-p/164811#M41457</link>
      <description>&lt;P&gt;@Sunile Manjee This configuration didn't work. I found the issue of this problem. And, it lies in application layer code only. I will update the answer.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2016 12:52:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-hdfs-throwing-LeaseExpiredException-in-Hadoop-cluster/m-p/164811#M41457</guid>
      <dc:creator>mail2jhamb</dc:creator>
      <dc:date>2016-09-27T12:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Why hdfs throwing LeaseExpiredException in Hadoop cluster (AWS EMR)</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-hdfs-throwing-LeaseExpiredException-in-Hadoop-cluster/m-p/164812#M41458</link>
      <description>&lt;P&gt;I resolved the issue. Let me explain in detail.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Exceptions that is coming -&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;
&lt;LI&gt;LeaveExpirtedException - from HDFS side.&lt;/LI&gt;&lt;LI&gt;FileNotFoundException - from Hive side (when Tez execution engine executes DAG)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;Problem scenario-&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;
&lt;LI&gt;We just upgraded the hive version from 0.13.0 to 2.1.0. And, everything was working fine with previous version. Zero runtime exception.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;Different thoughts to resolve the issue -&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;
&lt;LI&gt;First thought was, two threads was working on same piece because of NN intelligence. But as per below settings&lt;P&gt;set mapreduce.map.speculative=false set mapreduce.reduce.speculative=false&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;that was not possible. &lt;/P&gt;&lt;OL&gt;
&lt;LI&gt;then, I increase the count from 1000 to 100000 for below settings -&lt;P&gt;SET hive.exec.max.dynamic.partitions=100000; SET hive.exec.max.dynamic.partitions.pernode=100000;&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;that also didn't work.&lt;/P&gt;&lt;OL&gt;
&lt;LI&gt;Then the third thought was, definitely in a same process, what mapper-1 was created was deleted by another mapper/reducer. But, we didn't found any such logs in Hveserver2, Tez logs.&lt;/LI&gt;&lt;LI&gt;Finally the root cause lies in a application layer code itself. In hive-exec-2.1.0 version, they introduced new configuration property &lt;P&gt;&lt;STRONG&gt;"hive.exec.stagingdir":".hive-staging"&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;Description of above property -&lt;/STRONG&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;Directory name that will be created inside table locations in order to support HDFS encryption. This is replaces ${hive.exec.scratchdir} for query results with the exception of read-only tables. In all cases ${hive.exec.scratchdir} is still used for other temporary files, such as job plans.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So if there is any concurrent jobs in Application layer code (ETL), and are doing operation(rename/delete/move) on same table, then it may lead to this problem.&lt;/P&gt;&lt;P&gt;And, in our case, 2 concurrent jobs are doing "&lt;STRONG&gt;INSERT OVERWRITE&lt;/STRONG&gt;" on same table, that leads to delete metadata file of 1 mapper, that is causing this issue.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resolution -&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;
&lt;LI&gt;Move the metadata file location to outside table(table lies in S3).&lt;/LI&gt;&lt;LI&gt;Disable HDFS encryption (as mentioned in Description of stagingdir property.)&lt;/LI&gt;&lt;LI&gt;Change into your Application layer code to avoid concurrency issue.&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Tue, 27 Sep 2016 12:53:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-hdfs-throwing-LeaseExpiredException-in-Hadoop-cluster/m-p/164812#M41458</guid>
      <dc:creator>mail2jhamb</dc:creator>
      <dc:date>2016-09-27T12:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why hdfs throwing LeaseExpiredException in Hadoop cluster (AWS EMR)</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-hdfs-throwing-LeaseExpiredException-in-Hadoop-cluster/m-p/164813#M41459</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1486/smanjee.html" nodeid="1486"&gt;@Sunile Manjee&lt;/A&gt; Updated the answer.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2016 12:53:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-hdfs-throwing-LeaseExpiredException-in-Hadoop-cluster/m-p/164813#M41459</guid>
      <dc:creator>mail2jhamb</dc:creator>
      <dc:date>2016-09-27T12:53:41Z</dc:date>
    </item>
  </channel>
</rss>

