The following error occurs:-1000 dueto: RemoteTrace: java. io. FileNotFoundException: Filedoesnotexist: hdfs:
The following error occurs: Application failed 3 times due to AM Container for processing exited with exitCode:-1000 due to: RemoteTrace: java. io. FileNotFoundException: File does not exist: hdfs:
Symptom
The following error is reported:
Application application_1405852606905_0014 failed 3 times due to AM Container for appattempt_1405852606905_0014_000003 exited with exitCode: -1000 due to: RemoteTrace: java.io.FileNotFoundException: File does not exist: hdfs://mycluster:8020/user/kpi/.staging/job_1405852606905_0014/appTokens at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:809)
It is also noted that the Node Manager is restarted every time.
First, I used the keyword "apptokens FileNotFoundException" and found no problems in google and issue searches.
Cause of speculation
Possible cause: 1. The client failed to upload 2. the upload was successful, but I don't know who to delete it.
Reproduction
Since it cannot be found online, try to reproduce this problem in the test environment and run a sleep job
cd /opt/cloudera/parcels/CDH/lib/hadoop-mapreduce;hadoop jar hadoop-mapreduce-client-*-tests.jar sleep -Dmapred.job.queue.name=sleep -m5 -r5 -mt 60000 -rt 30000 -recordt 1000
After you restart nodemanage, an error is reported.
Analyze logs
However, where can I find the AM log not found? We have configured "log aggregation" (yarn. log-aggregation-enable). If the task fails, the log is deleted (possibly due to a bug). After the task is disabled, locate the AM log from the crontainer log.
You can also view ResourceManager, NameNode, HDFS audit log (hdfs-audit.log)
From the AM log, we can see that the first attempt seems to be successful. From the HDFS audit log, we found the directory for deleting staging.
Cmd = delete src = "http://fatkun.com/user/kpi/.staging/job_1405852606905_0013At this point, we can confirm that the directory has been deleted, resulting in the subsequent job failure. But who deleted the directory?
Continue searchThere are a lot of code. You need to locate the directory to operate. staging and determine who has deleted the directory. Search for "staging delete" in issue to see if there is any relevant operation code. At the same time, read the code and find the org. apache. hadoop. mapreduce. v2.app. MRAppMaster. cleanupStagingDir () method. Check the log and check whether this method deletes the staging directory.
Public synchronized void stop () {... // check whether it is the last attempt of AM. if so, clear if (isLastAMRetry) {cleanupStagingDir ();}...}This logic is still normal. How did I find isLastAMRetry?
public void shutDownJob() {... //We are finishing cleanly so this is the last retry isLastAMRetry = true; // Stop all services // This will also send the final report to the ResourceManager LOG.info("Calling stop for all the services"); MRAppMaster.this.stop();... }If shutDownJob is called, isLastAMRetry is set to true. shutDownJob is called because it receives a JobFinishEvent event.
We have some additional information and are lazy at issue to continue searching to see if anyone has solved the problem.
I found issue this time, https://issues.apache.org/jira/browse/MAPREDUCE-5086.
After reading the patch, we found that an error reported by RM was ignored.
org.apache.hadoop.yarn.exceptions.impl.pb.YarnRemoteExceptionPBImpl: Application doesn't exist in cache appattempt_1405852606905_0014_000001
ResultRestart nodemanager to delete the RM appattempt cache array. JobImpl returns InternalError. AM considers that there is no need to retry if an error occurs. Set isLastRetry to true directly.
The modification method adds a state, indicating that this is "RM restart" (note that nodemanager is not restarted here and there are some associations), and you can continue to try again. See the patch https://issues.apache.org/jira/browse/MAPREDUCE-5086 for details
Finally, because the patch version is different from the version we use, we need to use the version we use to change it according to its ideas.
Original article address: When hadoop restarts Namenode, appTokens reports FileNotFoundException. Thanks to the original author for sharing.