title: Hadoop : java.io.IOException: No live nodes contain current block. Will get new block locations from namenode and retry
body: <p>I am using Hadoop in a pseudo-distributed mode and everything was working fine.But whenever I restart my computer namenode goes into safenode. In order to forcefully let the namenode leave safemode, I am using <code>$ bin/hadoop dfsadmin -safemode leave</code>command. but after that I have a situation here that I'm wondering where it's coming from. When I use -ls, I can see files but when I try to get the file, I'm not able to retrieve this block. I am getting following error</p>
  
  <pre><code> $ hadoop fs -cat /user/op/part-r-00000 
  
  13/11/21 12:45:12 INFO hdfs.DFSClient: No node available for block: blk_-4538200827997952429_1071 file=/user/op/part-r-00000
  13/11/21 12:45:12 INFO hdfs.DFSClient: Could not obtain block blk_-4538200827997952429_1071 from any node: java.io.IOException: No live nodes contain current block. Will get new block locations from namenode and retry...
  
  13/11/21 12:45:15 INFO hdfs.DFSClient: No node available for block: blk_-4538200827997952429_1071 file=/user/op/part-r-00000
  13/11/21 12:45:15 INFO hdfs.DFSClient: Could not obtain block blk_-4538200827997952429_1071 from any node: java.io.IOException: No live nodes contain current block. Will get new block locations from namenode and retry...
  
  13/11/21 12:45:18 INFO hdfs.DFSClient: No node available for block: blk_-4538200827997952429_1071 file=/user/op/part-r-00000
  13/11/21 12:45:18 INFO hdfs.DFSClient: Could not obtain block blk_-4538200827997952429_1071 from any node: java.io.IOException: No live nodes contain current block. Will get new block locations from namenode and retry...
  
  13/11/21 12:45:21 WARN hdfs.DFSClient: DFS Read: java.io.IOException: Could not obtain block: blk_-4538200827997952429_1071 file=/user/op/part-r-00000
      at org.apache.hadoop.hdfs.DFSClient$DFSInputStream.chooseDataNode(DFSClient.java:2426)
      at org.apache.hadoop.hdfs.DFSClient$DFSInputStream.blockSeekTo(DFSClient.java:2218)
      at org.apache.hadoop.hdfs.DFSClient$DFSInputStream.read(DFSClient.java:2381)
      at java.io.DataInputStream.read(DataInputStream.java:100)
      at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:68)
      at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:47)
      at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:100)
      at org.apache.hadoop.fs.FsShell.printToStdout(FsShell.java:114)
      at org.apache.hadoop.fs.FsShell.access$100(FsShell.java:49)
      at org.apache.hadoop.fs.FsShell$1.process(FsShell.java:349)
      at org.apache.hadoop.fs.FsShell$DelayedExceptionThrowing.globAndProcess(FsShell.java:1913)
      at org.apache.hadoop.fs.FsShell.cat(FsShell.java:346)
      at org.apache.hadoop.fs.FsShell.doall(FsShell.java:1557)
      at org.apache.hadoop.fs.FsShell.run(FsShell.java:1776)
      at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
      at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)
      at org.apache.hadoop.fs.FsShell.main(FsShell.java:1895)
  
  cat: Could not obtain block: blk_-4538200827997952429_1071 file=/user/op/part-r-00000
  </code></pre>